From ae3fbcbf95dce21c81713eb5750e357f249a26d5 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sat, 6 Apr 2024 15:58:17 +0800 Subject: [PATCH] 1 --- app/command/CalDealerTime.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/command/CalDealerTime.php b/app/command/CalDealerTime.php index a41e9e2f..e881d00d 100644 --- a/app/command/CalDealerTime.php +++ b/app/command/CalDealerTime.php @@ -7,6 +7,7 @@ namespace app\command; use app\api\model\dealer\User as DealerUserModel; use app\api\model\User; use app\common\enum\user\UserTypeEnum; +use app\common\model\wholesaler\Apply; use think\console\Command; use think\console\Input; use think\console\Output; @@ -79,6 +80,10 @@ class CalDealerTime extends Command if ($normalUserIds) { $normalUserIds = array_unique($normalUserIds); (new User)->whereIn('user_id', $normalUserIds)->update(['user_type' => UserTypeEnum::NORMAL]); + //删除采购商申请 + Apply::destroy(function ($query) use ($normalUserIds) { + $query->whereIn('user_id', $normalUserIds); + }); } $dealerUserIds = array_unique(array_merge($normalUserIds, $plusUserIds)); //删除分销商(软) @@ -113,7 +118,12 @@ class CalDealerTime extends Command } if ($normalUserIds) { (new User)->whereIn('user_id', $normalUserIds)->update(['user_type' => UserTypeEnum::NORMAL]); + //删除采购商申请 + Apply::destroy(function ($query) use ($normalUserIds) { + $query->whereIn('user_id', $normalUserIds); + }); } + } } }