wang hou sheng 8 months ago
parent f108d5ef44
commit ae3fbcbf95
  1. 10
      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);
});
}
}
}
}

Loading…
Cancel
Save