|
|
|
@ -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]); |
|
|
|
|