diff --git a/app/admin/controller/Store.php b/app/admin/controller/Store.php index 5d8f9175..2695df96 100644 --- a/app/admin/controller/Store.php +++ b/app/admin/controller/Store.php @@ -406,17 +406,17 @@ class Store extends Controller } $goods_ids = array_column($goods_list->toArray(), "goods_id"); // 分批每次导入20条 - $limit = 200; - // 根据商品总数量计算需要的队列任务数量 - $jobCount = \count($goods_ids) / $limit; - // 逐次发布队列任务 - for ($i = 0; $i < $jobCount; $i++) { - $data = array_slice($goods_ids, $i * $limit, $limit); - GoodsRealDeleteJob::dispatch([ - 'list' => $data, - ]); + // $limit = 200; + // // 根据商品总数量计算需要的队列任务数量 + // $jobCount = \count($goods_ids) / $limit; + // // 逐次发布队列任务 + // for ($i = 0; $i < $jobCount; $i++) { + // $data = array_slice($goods_ids, $i * $limit, $limit); + // GoodsRealDeleteJob::dispatch([ + // 'list' => $data, + // ]); - } + // } //删除商品sku GoodsSku::whereIn('goods_id', $goods_ids)->delete(); diff --git a/app/api/controller/Dealer.php b/app/api/controller/Dealer.php index 951ad334..43cb0cfe 100644 --- a/app/api/controller/Dealer.php +++ b/app/api/controller/Dealer.php @@ -63,7 +63,7 @@ class Dealer extends Controller { $dealer = $this->dealer; if (!$dealer) { - return $this->renderError('您没有购买分销会员'); + return $this->renderError('您还没有成为服务商'); } $dealer = $dealer->toArray(); $dealer['update_time'] = date("Y-m-d", strtotime($dealer['update_time'])); diff --git a/app/api/controller/Invite.php b/app/api/controller/Invite.php index e39bbecb..d7bbf448 100644 --- a/app/api/controller/Invite.php +++ b/app/api/controller/Invite.php @@ -15,6 +15,7 @@ use app\common\model\UploadFile; use app\common\model\dealer\Setting; use app\store\model\User; use app\store\model\user\GradeLog; +use app\store\model\dealer\User; class Invite extends Controller { @@ -184,6 +185,21 @@ class Invite extends Controller 'create_time' => time(), ]; GradeLog::create($gradeLog); + + if (!DealerUserModel::isDealerUser($this->user['user_id'])) { + // 新增分销商用户 + $model = new UserModel(); + $mobile = $model->where(['user_id' => $this->user['user_id']])->value('mobile'); + DealerUserModel::add($this->user['user_id'], [ + 'real_name' => $mobile, + 'mobile' => $mobile, + 'store_id' => $storeId, + ]); + } else { + //更新分销用户 + DealerUserModel::update(['is_delete' => 0], ['user_id' => $this->user['user_id']]); + } + return $this->renderSuccess('升级成功'); } diff --git a/app/api/controller/Region copy.php b/app/api/controller/Region copy.php deleted file mode 100644 index 2ea0c90a..00000000 --- a/app/api/controller/Region copy.php +++ /dev/null @@ -1,52 +0,0 @@ - -// +---------------------------------------------------------------------- -declare (strict_types=1); - -namespace app\api\controller; - -use app\api\model\Region as RegionModel; -use think\response\Json; - -/** - * 地区管理 - * Class Region - * @package app\api\controller - */ -class Region extends Controller -{ - /** - * 获取所有地区 - * @return Json - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public function all(): Json - { - $list = RegionModel::getCacheAll(); - return $this->renderSuccess(compact('list')); - } - - /** - * 获取所有地区(树状) - * @return Json - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public function tree(): Json - { - $model = new RegionModel(); - $list = $model->getNewTreeList(); - //$list = array_values($list); - return $this->renderSuccess(compact('list')); - } -}