更新申请接口

This commit is contained in:
liu 2024-03-20 11:57:33 +08:00
parent 7675060d60
commit 230847a59b

View File

@ -311,20 +311,21 @@ class MerchantIntention extends BaseController
public function changeIdentity() public function changeIdentity()
{ {
$data = $this->request->params([ $data = $this->request->params([
'phone',
'mer_name',
'mer_type_id',
'merchant_category_id',
'type', 'type',
'name'
]); ]);
if(empty($data['type'])){
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('参数缺失请检查'); return app('json')->fail('参数缺失请检查');
} }
if ($this->userInfo) $data['uid'] = $this->userInfo->uid; if ($this->userInfo) $data['uid'] = $this->userInfo->uid;
$merchantInfo = Merchant::getDB()->where('uid',$this->userInfo->uid)->find();
if(empty($merchantInfo)) return app('json')->fail('没有该商户');
$data['phone'] = $merchantInfo->mer_phone;
$data['mer_name'] = $merchantInfo->mer_name;
$data['name'] = $merchantInfo->real_name;
$data['merchant_category_id'] = $merchantInfo->category_id;
$data['mer_type_id'] = $data['type'];
$data['status'] = 0; $data['status'] = 0;
$data['create_time'] = date('Y-m-d H:i:s',time());
$intention = $this->repository->create($data); $intention = $this->repository->create($data);
if ($intention) { if ($intention) {
return app('json')->success('申请更改商户身份成功'); return app('json')->success('申请更改商户身份成功');