diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 3d80d359..244e7b71 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -308,6 +308,33 @@ class MerchantIntention extends BaseController return app('json')->success($data); } + public function changeIdentity() + { + $data = $this->request->params([ + 'phone', + 'mer_name', + 'mer_type_id', + 'merchant_category_id', + 'type', + 'name' + ]); + + if(empty($data['phone'])||empty($data['mer_name'])||empty($data['mer_type_id'])||empty($data['merchant_category_id'])||empty($data['type'])||empty($data['name'])){ + return app('json')->fail('参数缺失请检查'); + } + + if ($this->userInfo) $data['uid'] = $this->userInfo->uid; + $data['status'] = 0; + $intention = $this->repository->create($data); + if ($intention) { + return app('json')->success('申请更改商户身份成功'); + } else { + return app('json')->fail('申请更改商户身份失败'); + } + } + + + protected function checkParams() { $data = $this->request->params([ diff --git a/route/api.php b/route/api.php index 786564ec..3c34e37f 100644 --- a/route/api.php +++ b/route/api.php @@ -558,6 +558,8 @@ Route::group('api/', function () { Route::post('intention/create', 'api.store.merchant.MerchantIntention/create'); Route::get('intention/cate', 'api.store.merchant.MerchantIntention/cateLst'); Route::get('intention/type', 'api.store.merchant.MerchantIntention/typeLst'); + + Route::post('intention/change', 'api.store.merchant.MerchantIntention/changeIdentity');//更新身份 //浏览 Route::post('common/visit', 'api.Common/visit'); Route::get('store/product/assist/count', 'api.store.product.StoreProductAssist/userCount');