From 857e36c8384170fa438dc43d7470391eda38606c Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Mon, 29 Jan 2024 14:33:12 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E4=BF=A1=E6=81=AF=E6=9F=A5=E8=AF=A2=20-=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=BB=85=E6=98=BE=E7=A4=BA=E6=8B=A5=E6=9C=89=E9=82=80?= =?UTF-8?q?=E8=AF=B7=E4=BE=9B=E5=BA=94=E5=95=86=E6=9D=83=E9=99=90=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/marketing/AgentDao.php | 4 ++++ app/controller/admin/marketing/Agent.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/common/dao/marketing/AgentDao.php b/app/common/dao/marketing/AgentDao.php index 60cd5fd..200385f 100644 --- a/app/common/dao/marketing/AgentDao.php +++ b/app/common/dao/marketing/AgentDao.php @@ -38,6 +38,10 @@ class AgentDao extends BaseDao{ ->when(isset($params['agent_type']) && $params['agent_type'] !== '',function($query) use ($params){ $query->where('agent_type', (int)$params['agent_type']); }) + ->when(isset($params['is_invite_supplier']) && $params['is_invite_supplier'] !== '',function($query) use ($params){ + // 仅获取拥有【供应商】邀请权限的代理人员 类型:1=发起人,2=省公司,3=省合伙人(外勤),4=省合伙人(内勤),5=区县运营商 + $query->whereIn('agent_type',[1,2,3,4,5]); + }) ->with([ 'user' => function($query){ $query->field('uid,nickname,avatar'); diff --git a/app/controller/admin/marketing/Agent.php b/app/controller/admin/marketing/Agent.php index fd2d71e..343901f 100644 --- a/app/controller/admin/marketing/Agent.php +++ b/app/controller/admin/marketing/Agent.php @@ -17,7 +17,7 @@ class Agent extends BaseController{ */ public function agentList(){ [$page, $limit] = $this->getPage(); - $params = $this->request->params(['uid','agent_type','contact_name','contact_phone']); + $params = $this->request->params(['uid','agent_type','contact_name','contact_phone','is_invite_supplier']); $data = app()->make(AgentRepository::class)->getList((array)$params,(int)$page,(int)$limit); return app('json')->success($data); From 7aba307a8dae76831b0211a4920c2fe89e8d8de5 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Mon, 29 Jan 2024 18:03:41 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E7=94=9F?= =?UTF-8?q?=E6=88=90=E4=BE=9B=E5=BA=94=E5=95=86=E9=82=80=E8=AF=B7=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E4=BA=8C=E7=BB=B4=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marketing/AgentRepository.php | 42 ++++++++++++-- app/controller/api/Agent.php | 56 +++++++++++++++++++ route/api.php | 20 ++++++- 3 files changed, 109 insertions(+), 9 deletions(-) create mode 100644 app/controller/api/Agent.php diff --git a/app/common/repositories/marketing/AgentRepository.php b/app/common/repositories/marketing/AgentRepository.php index 6927bb3..7164d86 100644 --- a/app/common/repositories/marketing/AgentRepository.php +++ b/app/common/repositories/marketing/AgentRepository.php @@ -6,6 +6,8 @@ use app\common\dao\marketing\AgentDao; use app\common\model\marketing\Agent; use app\common\model\system\merchant\Merchant; use app\common\repositories\BaseRepository; +use crmeb\services\QrcodeService; +use think\exception\ValidateException; use think\facade\Db; class AgentRepository extends BaseRepository{ @@ -34,6 +36,40 @@ class AgentRepository extends BaseRepository{ return compact('count','list'); } + /** + * Common: 获取全部信息列表 + * Author: wu-hui + * Time: 2024/01/29 16:00 + * @param array $params + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function getAllList(array $params):array{ + $query = $this->dao->searchList($params); + return $query->select()->toArray(); + } + /** + * Common: 生成对应的二维码 + * Author: wu-hui + * Time: 2024/01/29 17:40 + * @param array $data + * @param string $type + * @return mixed + */ + public function createQrCode(array $data,string $type = 'inviteSupplier'){ + // 参数获取 + switch($type){ + case 'inviteSupplier': + $valueData = 'agent_id=' . $data['agent_id']; + $path = 'pages/supplier/apply_join'; + return app()->make(QrcodeService::class)->createQrCode($valueData,$path); + break; + } + + throw new ValidateException('小程序码生成失败!'); + } /** @@ -197,10 +233,4 @@ class AgentRepository extends BaseRepository{ - - - - - - } diff --git a/app/controller/api/Agent.php b/app/controller/api/Agent.php new file mode 100644 index 0000000..93f0ba3 --- /dev/null +++ b/app/controller/api/Agent.php @@ -0,0 +1,56 @@ +repository = $repository; + } + /** + * Common: 获取代理列表 + * Author: wu-hui + * Time: 2024/01/29 16:00 + * @return mixed + */ + public function agentList(){ + // 参数处理 + [$page, $limit] = $this->getPage(); + $params = $this->request->params(['is_get_self','not_page']); + if((int)$params['is_get_self'] > 0) $params['uid'] = $this->request->uid(); + // 信息列表获取 + if((int)$params['not_page'] > 0) $data = app()->make(AgentRepository::class)->getAllList((array)$params); + else $data = app()->make(AgentRepository::class)->getList((array)$params,(int)$page,(int)$limit); + + return app('json')->success($data); + } + /** + * Common: 二维码 - 供应商入驻二维码 + * Author: wu-hui + * Time: 2024/01/29 17:40 + * @return mixed + */ + public function qrCodeInviteSupplier(){ + // 参数获取 + $agentId = (int)$this->request->param('agent_id'); + if((int)$agentId > 0){ + $qrcode = $this->repository->createQrCode(['agent_id'=>$agentId]); + + return app('json')->success(['qr_code' => $qrcode]); + } + + return app('json')->fail('小程序码生成失败!'); + } + + + +} diff --git a/route/api.php b/route/api.php index 72edefe..0a839bf 100644 --- a/route/api.php +++ b/route/api.php @@ -381,10 +381,24 @@ Route::group('api/', function () { Route::group('merchant', function () { Route::get('promote_qr_code', 'Merchant/promoteQrCode');// 推广二维码 Route::get('online_payment_qr_code', 'Merchant/onlinePaymentQrCode');// 买单二维码 - - - })->prefix('api.store.merchant.'); + // 代理中心 + Route::group('agent', function () { + Route::get('agent_list', 'agentList');// 我的代理身份列表 + Route::get('qr_code_invite_supplier', 'qrCodeInviteSupplier');// 推广二维码 + + + + + + + + })->prefix('api.Agent/'); + + + + + })->middleware(UserTokenMiddleware::class, true); From 24fe60facd063cf6407711c6f33d1405f8ba3108 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Tue, 30 Jan 2024 14:50:57 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E7=94=B3=E8=AF=B7=E5=85=A5=E9=A9=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marketing/AgentRepository.php | 10 ++ app/controller/api/Agent.php | 15 +++ app/controller/api/Supplier.php | 97 +++++++++++++++++++ app/dao/supplier/SystemSupplierApplyDao.php | 28 ++++++ app/model/supplier/SystemSupplierApply.php | 23 +++++ .../supplier/SystemSupplierApplyServices.php | 44 +++++++++ route/api.php | 15 ++- 7 files changed, 229 insertions(+), 3 deletions(-) create mode 100644 app/controller/api/Supplier.php create mode 100644 app/dao/supplier/SystemSupplierApplyDao.php create mode 100644 app/model/supplier/SystemSupplierApply.php create mode 100644 app/services/supplier/SystemSupplierApplyServices.php diff --git a/app/common/repositories/marketing/AgentRepository.php b/app/common/repositories/marketing/AgentRepository.php index 7164d86..036c614 100644 --- a/app/common/repositories/marketing/AgentRepository.php +++ b/app/common/repositories/marketing/AgentRepository.php @@ -50,6 +50,16 @@ class AgentRepository extends BaseRepository{ $query = $this->dao->searchList($params); return $query->select()->toArray(); } + /** + * Common: 获取单条代理人员信息 + * Author: wu-hui + * Time: 2024/01/30 9:27 + * @param $id + * @return array + */ + public function getSingleInfo($id){ + return $this->dao->searchList(['id'=>$id])->findOrEmpty()->toArray(); + } /** * Common: 生成对应的二维码 * Author: wu-hui diff --git a/app/controller/api/Agent.php b/app/controller/api/Agent.php index 93f0ba3..4234f2c 100644 --- a/app/controller/api/Agent.php +++ b/app/controller/api/Agent.php @@ -50,6 +50,21 @@ class Agent extends BaseController{ return app('json')->fail('小程序码生成失败!'); } + /** + * Common: 获取单条代理人员信息 + * Author: wu-hui + * Time: 2024/01/30 9:27 + * @param $id + * @return mixed + */ + public function singleAgentInfo($id){ + $res = $this->repository->getSingleInfo($id); + + return app('json')->success($res); + } + + + diff --git a/app/controller/api/Supplier.php b/app/controller/api/Supplier.php new file mode 100644 index 0000000..78df55e --- /dev/null +++ b/app/controller/api/Supplier.php @@ -0,0 +1,97 @@ +services = $services; + } + + /** + * Common: 申请入驻 + * Author: wu-hui + * Time: 2024/01/30 14:28 + * @return mixed + */ + public function applyJoin(){ + // 参数获取 + $data = $this->checkParam(); + if((int)$data['supplierApplyId'] > 0){ + // 编辑账号信息 + app()->make(SystemSupplierApplyServices::class)->editInfo((array)$data); + }else{ + // 添加账号 + app()->make(SystemSupplierApplyServices::class)->createApplyInfo((array)$data); + } + + return app('json')->success('操作成功'); + } + /** + * Common: 申请信息接收 + * Author: wu-hui + * Time: 2024/01/30 14:18 + * @return array + */ + private function checkParam():array{ + // 接收表单参数 + $supplierApplyId = (int)$this->request->param('id'); + $applyInfo = $this->request->params([ + 'invite_agent_id', + 'winery_name', + 'scale', + 'cellar_size', + 'corporation_name', + 'corporation_phone', + ['corporation_id_card',[]], + 'chairman_name', + 'chairman_phone', + ['chairman_id_card',[]], + 'contacts_name', + 'contacts_phone', + 'business_license', + 'production_icense', + 'circulative_license', + ]); + // 数据校验 + if (empty($applyInfo['invite_agent_id'])) throw new ValidateException('非法请求,无有效邀请人!'); + if (empty($applyInfo['winery_name'])) throw new ValidateException('请输入酒厂名称!'); + if (empty($applyInfo['scale'])) throw new ValidateException('请输入年产量多少吨!'); + if (empty($applyInfo['cellar_size'])) throw new ValidateException('请输入窖池大小!'); + if (empty($applyInfo['corporation_name'])) throw new ValidateException('请输入法人姓名!'); + if (empty($applyInfo['corporation_phone'])) throw new ValidateException('请输入法人电话!'); + if (isPhone($applyInfo['corporation_phone'])) throw new ValidateException('请输入正确的法人电话!'); + if (empty($applyInfo['corporation_id_card'])) throw new ValidateException('请上传法人身份证正反面图片!'); + if (empty($applyInfo['chairman_name'])) throw new ValidateException('请输入董事长姓名!'); + if (empty($applyInfo['chairman_phone'])) throw new ValidateException('请输入董事长电话!'); + if (isPhone($applyInfo['chairman_phone'])) throw new ValidateException('请输入正确的董事长电话!'); + if (empty($applyInfo['chairman_id_card'])) throw new ValidateException('请上传董事长身份证正反面图片!'); + if (empty($applyInfo['contacts_name'])) throw new ValidateException('请输入联系人姓名!'); + if (empty($applyInfo['contacts_phone'])) throw new ValidateException('请输入联系人电话!'); + if (isPhone($applyInfo['contacts_phone'])) throw new ValidateException('请输入正确的联系人电话!'); + if (empty($applyInfo['business_license'])) throw new ValidateException('请上传营业执照!'); + if (empty($applyInfo['production_icense'])) throw new ValidateException('请上传生产许可证!'); + if (empty($applyInfo['circulative_license'])) throw new ValidateException('请上传流通许可证!'); + // 联系人及联系人手机号 + $isHas = app()->make(SystemSupplierApplyServices::class)->searchModel(['contacts_phone'=>$applyInfo['contacts_phone']])->count(); + if($isHas >= 1) throw new ValidateException('联系人已经存在,请勿重复申请!'); + + return compact('supplierApplyId','applyInfo'); + } + + + + + + +} diff --git a/app/dao/supplier/SystemSupplierApplyDao.php b/app/dao/supplier/SystemSupplierApplyDao.php new file mode 100644 index 0000000..5861130 --- /dev/null +++ b/app/dao/supplier/SystemSupplierApplyDao.php @@ -0,0 +1,28 @@ +getModel() + ->when(isset($search['id']) && $search['id'] !== '', function ($query) use ($search) { + $query->where('id',$search['id']); + }) + ->when(isset($search['contacts_phone']) && $search['contacts_phone'] !== '', function ($query) use ($search) { + $query->where('contacts_phone', $search['contacts_phone']); + }); + } + + + + +} diff --git a/app/model/supplier/SystemSupplierApply.php b/app/model/supplier/SystemSupplierApply.php new file mode 100644 index 0000000..6a83741 --- /dev/null +++ b/app/model/supplier/SystemSupplierApply.php @@ -0,0 +1,23 @@ +dao = $dao; + } + /** + * Common: 查询模型 + * Author: wu-hui + * Time: 2024/01/30 14:46 + * @param $where + * @return \crmeb\basic\BaseModel + */ + public function searchModel($where){ + return $this->dao->searchModel($where); + } + /** + * Common: 添加申请信息 + * Author: wu-hui + * Time: 2024/01/30 14:28 + * @param array $data + * @return mixed + */ + public function createApplyInfo(array $data){ + return $this->transaction(function() use ($data){ + // 添加供应商信息 + $relation_id = $this->dao->save($data['applyInfo'])->id; + if(!$relation_id) throw new AdminException('申请失败'); + + return $relation_id; + }); + } + + + + + +} diff --git a/route/api.php b/route/api.php index 0a839bf..6a593a4 100644 --- a/route/api.php +++ b/route/api.php @@ -382,11 +382,11 @@ Route::group('api/', function () { Route::get('promote_qr_code', 'Merchant/promoteQrCode');// 推广二维码 Route::get('online_payment_qr_code', 'Merchant/onlinePaymentQrCode');// 买单二维码 })->prefix('api.store.merchant.'); - // 代理中心 + // 代理中心相关 Route::group('agent', function () { Route::get('agent_list', 'agentList');// 我的代理身份列表 - Route::get('qr_code_invite_supplier', 'qrCodeInviteSupplier');// 推广二维码 - + Route::get('qr_code_invite_supplier', 'qrCodeInviteSupplier');// 供应商邀请二维码 + Route::get('single_agent_info/:id', 'singleAgentInfo');// 获取单个代理人员信息 @@ -394,12 +394,21 @@ Route::group('api/', function () { })->prefix('api.Agent/'); + // 供应商相关 + Route::group('supplier', function () { + Route::post('apply', 'applyJoin');// 申请成为供应商 + })->prefix('api.Supplier/'); + + + + + })->middleware(UserTokenMiddleware::class, true); //非强制登录 From ec5992ffb037b8927c660a59d7ec5c0861f3bb3a Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Tue, 30 Jan 2024 16:57:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86=E7=94=B3=E8=AF=B7=E5=AE=A1=E6=A0=B8=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/supplier/Apply.php | 55 ++++++++++++++++++ app/controller/api/Supplier.php | 12 ++-- app/dao/supplier/SystemSupplierApplyDao.php | 30 ++++++++-- app/model/supplier/SystemSupplierApply.php | 18 +++++- .../supplier/SystemSupplierApplyServices.php | 57 ++++++++++++++++++- route/admin/supplier.php | 18 ++++-- 6 files changed, 175 insertions(+), 15 deletions(-) create mode 100644 app/controller/admin/supplier/Apply.php diff --git a/app/controller/admin/supplier/Apply.php b/app/controller/admin/supplier/Apply.php new file mode 100644 index 0000000..cba51a6 --- /dev/null +++ b/app/controller/admin/supplier/Apply.php @@ -0,0 +1,55 @@ +services = $services; + } + /** + * Common: 列表获取 + * Author: wu-hui + * Time: 2024/01/30 15:13 + * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function applyList(){ + $search = $this->request->params(['winery_name','contacts_name','contacts_phone','invite_agent_id','status']); + [$page, $limit] = $this->getPage(); + $data = $this->services->getList($search, $page, $limit); + + return app('json')->success($data); + } + /** + * Common: 审核 + * Author: wu-hui + * Time: 2024/01/30 15:53 + * @return mixed + */ + public function toExamine(){ + // 参数获取 + $params = $this->request->params(['id','status','reason']); + if($params['id'] <= 0) throw new ValidateException('方法请求,信息不明确!'); + // 审核通过 主动生成账号 + if((int)$params['status'] === 1){ + // 审核通过 + $this->services->toExaminePass((array)$params); + }else{ + // 驳回 + $this->services->update($params['id'],['status'=>$params['status'],'reason'=>$params['reason']]); + } + + return app('json')->success('操作成功'); + } + + +} diff --git a/app/controller/api/Supplier.php b/app/controller/api/Supplier.php index 78df55e..4187618 100644 --- a/app/controller/api/Supplier.php +++ b/app/controller/api/Supplier.php @@ -85,13 +85,17 @@ class Supplier extends BaseController{ // 联系人及联系人手机号 $isHas = app()->make(SystemSupplierApplyServices::class)->searchModel(['contacts_phone'=>$applyInfo['contacts_phone']])->count(); if($isHas >= 1) throw new ValidateException('联系人已经存在,请勿重复申请!'); + // 酒厂是否已经存在 + $isHas = app()->make(SystemSupplierApplyServices::class)->searchModel(['winery_name'=>$applyInfo['winery_name']])->count(); + if($isHas >= 1) throw new ValidateException('酒厂已经存在,请勿重复申请!'); + $isHas = app()->make(SystemSupplierApplyServices::class)->searchModel(['winery_name'=>$applyInfo['winery_name']])->count(); + if($isHas >= 1) throw new ValidateException('酒厂已经存在,请勿重复申请!'); + $nameIsHave = $this->services->isHave('supplier_name',$applyInfo['winery_name']); + if($nameIsHave) throw new ValidateException('该酒厂已经入驻,请勿重复申请!'); + return compact('supplierApplyId','applyInfo'); } - - - - } diff --git a/app/dao/supplier/SystemSupplierApplyDao.php b/app/dao/supplier/SystemSupplierApplyDao.php index 5861130..2ca4e72 100644 --- a/app/dao/supplier/SystemSupplierApplyDao.php +++ b/app/dao/supplier/SystemSupplierApplyDao.php @@ -14,12 +14,34 @@ class SystemSupplierApplyDao extends BaseDao{ // 公共搜索模型 public function searchModel(array $search){ return $this->getModel() - ->when(isset($search['id']) && $search['id'] !== '', function ($query) use ($search) { + ->when(isset($search['id']) && $search['id'] !== '',function($query) use ($search){ $query->where('id',$search['id']); }) - ->when(isset($search['contacts_phone']) && $search['contacts_phone'] !== '', function ($query) use ($search) { - $query->where('contacts_phone', $search['contacts_phone']); - }); + ->when(isset($search['contacts_phone']) && $search['contacts_phone'] !== '',function($query) use ($search){ + $query->where('contacts_phone',$search['contacts_phone']); + }) + ->when(isset($search['winery_name']) && $search['winery_name'] !== '',function($query) use ($search){ + $query->where('winery_name','like',"%{$search['winery_name']}%"); + }) + ->when(isset($search['contacts_name']) && $search['contacts_name'] !== '',function($query) use ($search){ + $query->where('contacts_name','like',"%{$search['contacts_name']}%"); + }) + ->when(isset($search['invite_agent_id']) && $search['invite_agent_id'] !== '',function($query) use ($search){ + $query->where('invite_agent_id',$search['invite_agent_id']); + }) + ->when(isset($search['status']) && $search['status'] !== '',function($query) use ($search){ + $query->where('status',$search['status']); + }) + ->with([ + 'agent' => function($query){ + $query->field('id,uid') + ->with([ + 'user' => function($query){ + $query->field('uid,nickname,avatar')->bind(['nickname','avatar']); + } + ]); + } + ]); } diff --git a/app/model/supplier/SystemSupplierApply.php b/app/model/supplier/SystemSupplierApply.php index 6a83741..340a290 100644 --- a/app/model/supplier/SystemSupplierApply.php +++ b/app/model/supplier/SystemSupplierApply.php @@ -1,6 +1,7 @@ hasOne(Agent::class,'id','invite_agent_id'); + } } diff --git a/app/services/supplier/SystemSupplierApplyServices.php b/app/services/supplier/SystemSupplierApplyServices.php index 0d6a505..5d34a6b 100644 --- a/app/services/supplier/SystemSupplierApplyServices.php +++ b/app/services/supplier/SystemSupplierApplyServices.php @@ -20,6 +20,32 @@ class SystemSupplierApplyServices extends BaseServices{ public function searchModel($where){ return $this->dao->searchModel($where); } + + + /** + * Common: 获取列表信息 + * Author: wu-hui + * Time: 2024/01/30 15:13 + * @param $search + * @param $page + * @param $limit + * @param string $field + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function getList($search, $page, $limit, $field = '*'){ + $query = $this->dao->searchModel($search); + $list = $query + ->field($field) + ->order('create_time desc,id desc') + ->page($page, $limit) + ->select(); + $count = $query->count(); + + return compact('count', 'list'); + } /** * Common: 添加申请信息 * Author: wu-hui @@ -36,7 +62,36 @@ class SystemSupplierApplyServices extends BaseServices{ return $relation_id; }); } - + /** + * Common: 审核通过的操作 + * Author: wu-hui + * Time: 2024/01/30 16:54 + * @param $params + * @return mixed + */ + public function toExaminePass($params){ + return $this->transaction(function() use ($params){ + // 修改状态 + $this->update($params['id'],['status'=>$params['status']]); + // 自动生成账号信息 + $applyInfo = $this->searchModel(['id'=>$params['id']])->findOrEmpty()->toArray(); + app()->make(SystemSupplierServices::class)->create([ + 'accountInfo' => [ + 'supplier_name' => $applyInfo['winery_name'], + 'detailed_address' => '', + 'name' => $applyInfo['contacts_name'], + 'phone' => $applyInfo['contacts_phone'], + 'is_show' => 1, + 'invite_agent_id' => $applyInfo['agent']['id'] ?? 0, + 'invite_uid' => $applyInfo['agent']['uid'] ?? 0, + ], + 'accountPassword' => [ + 'supplier_account' => $applyInfo['contacts_phone'], + 'supplier_password' => substr($applyInfo['contacts_phone'],-6), + ], + ]); + }); + } diff --git a/route/admin/supplier.php b/route/admin/supplier.php index b0ff2a4..21b7f15 100644 --- a/route/admin/supplier.php +++ b/route/admin/supplier.php @@ -9,19 +9,29 @@ use app\common\middleware\LogMiddleware; Route::group(function () { // 供应商 Route::group('system/supplier', function () { - Route::post('edit_info', '/editInfo')->name('systemSupplierCreate')->option([ + // 列表相关 + Route::post('edit_info', 'Supplier/editInfo')->name('systemSupplierCreate')->option([ '_alias' => '添加供应商', ]); - Route::get('list', '/getList')->name('systemSupplierList')->option([ + Route::get('list', 'Supplier/getList')->name('systemSupplierList')->option([ '_alias' => '供应商列表', ]); - Route::post('info/:id', '/supplierInfo')->name('systemSupplierInfo')->option([ + Route::post('info/:id', 'Supplier/supplierInfo')->name('systemSupplierInfo')->option([ '_alias' => '获取信息', ]); + // 申请审核 + Route::get('apply_list', 'Apply/applyList')->name('systemSupplierApplyList')->option([ + '_alias' => '供应商申请列表', + ]); + Route::post('apply_to_examine', 'Apply/toExamine')->name('systemSupplierApplyToExamine')->option([ + '_alias' => '供应商申请审核', + ]); - })->prefix('admin.supplier.Supplier')->option([ + + + })->prefix('admin.supplier.')->option([ '_path' => '/supplier/supplier', '_auth' => true, ]);