|
|
@ -7,6 +7,7 @@ namespace app\command; |
|
|
|
use app\api\model\dealer\User as DealerUserModel; |
|
|
|
use app\api\model\dealer\User as DealerUserModel; |
|
|
|
use app\api\model\User; |
|
|
|
use app\api\model\User; |
|
|
|
use app\common\enum\user\UserTypeEnum; |
|
|
|
use app\common\enum\user\UserTypeEnum; |
|
|
|
|
|
|
|
use app\common\model\wholesaler\Apply; |
|
|
|
use think\console\Command; |
|
|
|
use think\console\Command; |
|
|
|
use think\console\Input; |
|
|
|
use think\console\Input; |
|
|
|
use think\console\Output; |
|
|
|
use think\console\Output; |
|
|
@ -79,6 +80,10 @@ class CalDealerTime extends Command |
|
|
|
if ($normalUserIds) { |
|
|
|
if ($normalUserIds) { |
|
|
|
$normalUserIds = array_unique($normalUserIds); |
|
|
|
$normalUserIds = array_unique($normalUserIds); |
|
|
|
(new User)->whereIn('user_id', $normalUserIds)->update(['user_type' => UserTypeEnum::NORMAL]); |
|
|
|
(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)); |
|
|
|
$dealerUserIds = array_unique(array_merge($normalUserIds, $plusUserIds)); |
|
|
|
//删除分销商(软) |
|
|
|
//删除分销商(软) |
|
|
@ -113,7 +118,12 @@ class CalDealerTime extends Command |
|
|
|
} |
|
|
|
} |
|
|
|
if ($normalUserIds) { |
|
|
|
if ($normalUserIds) { |
|
|
|
(new User)->whereIn('user_id', $normalUserIds)->update(['user_type' => UserTypeEnum::NORMAL]); |
|
|
|
(new User)->whereIn('user_id', $normalUserIds)->update(['user_type' => UserTypeEnum::NORMAL]); |
|
|
|
|
|
|
|
//删除采购商申请 |
|
|
|
|
|
|
|
Apply::destroy(function ($query) use ($normalUserIds) { |
|
|
|
|
|
|
|
$query->whereIn('user_id', $normalUserIds); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|