modify('this week monday'); // 存储周一到周日的日期 $weekDays = []; // 循环获取本周的每一天 for ($i = 0; $i < 7; $i++) { // 获取当前日期并添加到数组 $weekDays[] = [ 'date' => $currentDate->format('Y-m-d') ]; // 将日期调整到下一个日期(例如,周二 -> 周三) $currentDate->modify('+1 day'); } return $weekDays; } function getNewOrderId($type) { list($msec, $sec) = explode(' ', microtime()); $msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', ''); $orderId = $type . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369)); return $orderId; }