From 582c52e3a1b07b5ce639be8fb23307a180bf0138 Mon Sep 17 00:00:00 2001 From: xiadc <251308692@qq.com> Date: Tue, 3 Jun 2025 11:28:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(shopro):=20=E4=BF=AE=E5=A4=8D=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 拆分 startTime 和 endTime 字段,将日期和时间分开存储 - 优化活动时间的显示格式,提高可读性 --- addons/shopro/job/Test.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/shopro/job/Test.php b/addons/shopro/job/Test.php index 3d92b49..3ce8683 100644 --- a/addons/shopro/job/Test.php +++ b/addons/shopro/job/Test.php @@ -82,6 +82,13 @@ class Test extends BaseJob } $act['public_time'] = date('Y-m-d H:i:s', $public_time - $publicBefore * 86400); //设定的时间 $act['date'] = date('Y-m-d', $public_time - $publicBefore * 86400); //设定的日期 + $startTime = explode(' ', $act['startTime']); + if (count($startTime) == 2) { + $act['date'] = $startTime[0]; + $act['startTime'] = $startTime[1]; + } + $endTime = explode(' ', $act['endTime']); + if (count($endTime) == 2) $act['endTime'] = $endTime[1]; $query = (clone $_gameModel)::where('act_id', $act['id']); if ($act['type'] == 0) { //一次性活动 $query->where('public_time', $act['public_time'])->where('date', $act['date']);