From 6da2be0b2b4d807f3ecaf2cef729241ae6cb41d4 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Tue, 26 Mar 2024 13:45:14 +0800 Subject: [PATCH] 11 --- app/command/CalDealerTime.php | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/app/command/CalDealerTime.php b/app/command/CalDealerTime.php index 48578419..90ddd391 100644 --- a/app/command/CalDealerTime.php +++ b/app/command/CalDealerTime.php @@ -15,7 +15,6 @@ use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; -// /www/server/php/74/bin/php /server/wwwroot/sass.royaum.com.cn/ think CalDealerTime class CalDealerTime extends Command { protected function configure() @@ -62,20 +61,17 @@ class CalDealerTime extends Command if (!$dealerUser->isEmpty()) { $dealerUser = $dealerUser->toArray(); foreach ($dealerUser as $value) { - $fx_effective_time = strtotime($value['fx_effective_time'] . ' 23:59:59'); - if (time() > $fx_effective_time) { - //分销商到期 会员未到期 - if (!empty($value['effective_time'])) { - $effective_time = strtotime($value['effective_time'] . ' 23:59:59'); - if (time() < $effective_time) { - $plusUserIds[] = $value['user_id']; - } else { - $normalUserIds[] = $value['user_id'];//会员已到期 - } + //分销商到期 会员未到期 + if (!empty($value['effective_time'])) { + $effective_time = strtotime($value['effective_time']); + if (strtotime($nowDay) < $effective_time) { + $plusUserIds[] = $value['user_id']; } else { - //普通会员 - $normalUserIds[] = $value['user_id']; + $normalUserIds[] = $value['user_id'];//会员已到期 } + } else { + //普通会员 + $normalUserIds[] = $value['user_id']; } } if ($plusUserIds) { @@ -114,10 +110,7 @@ class CalDealerTime extends Command if (!$list->isEmpty()) { $list = $list->toArray(); foreach ($list as $value) { - $effective_time = strtotime($value['effective_time'] . ' 23:59:59'); - if (time() > $effective_time) { - $normalUserIds[] = $value['user_id']; - } + $normalUserIds[] = $value['user_id']; } if ($normalUserIds) { (new User)->whereIn('user_id', $normalUserIds)->update(['user_type' => UserTypeEnum::NORMAL]);