diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index f499306a..18c98a9d 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -170,6 +170,9 @@ class Merchant extends BaseController 'interest_rate', ]); + if(empty($data['service_phone'])) { + return app('json')->fail('客户电话不能为空'); + } // 如果手机号不存在,则使用入驻时的手机号 $data['service_phone'] = empty($data['service_phone'])?$merchant['mer_phone']:$data['service_phone']; diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index 0b814ec1..b3758bb3 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -115,6 +115,33 @@ class MerchantIntention extends BaseController public function businessApply() { + $data = $this->request->params([ + 'phone', + 'mer_name', + 'company_name', + 'address', + 'name', + 'code', + 'images', + 'merchant_category_id', + 'mer_type_id', + 'social_credit_code', + 'area_id', + 'street_id', + 'village_id', + 'is_nmsc', + 'bank_username', + 'bank_opening', + 'bank_front', + 'bank_back', + 'cardno_front', + 'cardno_back', + ]); + + if (empty($data['bank_username']) || empty($data['bank_opening']) || empty($data['bank_front']) || empty($data['bank_back']) || empty($data['cardno_front']) || empty($data['cardno_back'])) { + return app('json')->fail('请完善银行卡及身份信息'); + } + if (!systemConfig('mer_intention_open')) { return app('json')->fail('未开启商户入驻'); } @@ -130,6 +157,14 @@ class MerchantIntention extends BaseController if (empty($intenInfo)) { return app('json')->fail('商户状态异常'); } + + $intenInfo['bank_username'] = $data['bank_username']; + $intenInfo['bank_opening'] = $data['bank_opening']; + $intenInfo['bank_front'] = $data['bank_front']; + $intenInfo['bank_back'] = $data['bank_back']; + $intenInfo['cardno_front'] = $data['cardno_front']; + $intenInfo['cardno_back'] = $data['cardno_back']; + $intenInfo['type'] = 2; $intenInfo['status'] = 0; $intenInfo['create_time'] = date('Y-m-d H:i:s'); @@ -150,6 +185,12 @@ class MerchantIntention extends BaseController 'area' => $intenInfo['area_id'] ?? '', 'street' => $intenInfo['street_id'] ?? '', 'address' => $intenInfo['address'] ?? '', + 'bank_username' => $data['bank_username'] ?? '', + 'bank_opening' => $data['bank_opening'] ?? '', + 'bank_front' => $data['bank_front'] ?? '', + 'bank_back' => $data['bank_back'] ?? '', + 'cardno_front' => $data['cardno_front'] ?? '', + 'cardno_back' => $data['cardno_back'] ?? '', 'mer_intention_id' => $intentionId ]; $postUrl = env('TASK_WORKER_HOST_URL') . '/adminapi/company/createShopMerchant';