diff --git a/app/controller/api/store/merchant/MerchantIntention.php b/app/controller/api/store/merchant/MerchantIntention.php index e81b065b..b010941c 100644 --- a/app/controller/api/store/merchant/MerchantIntention.php +++ b/app/controller/api/store/merchant/MerchantIntention.php @@ -106,7 +106,20 @@ class MerchantIntention extends BaseController protected function checkParams() { - $data = $this->request->params(['phone', 'mer_name', 'name', 'code', 'images', 'merchant_category_id', 'mer_type_id','area_id','street_id','village_id','is_nmsc']); + $data = $this->request->params([ + 'phone', + 'mer_name', + 'name', + 'code', + 'images', + 'merchant_category_id', + 'mer_type_id', + 'area_id', + 'street_id', + 'village_id', + 'is_nmsc' + ]); + app()->make(MerchantIntentionValidate::class)->check($data); $check = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['code'], 'intention'); $data['mer_type_id'] = (int)$data['mer_type_id']; diff --git a/app/validate/api/MerchantIntentionValidate.php b/app/validate/api/MerchantIntentionValidate.php index e3d1e81d..eddcc03d 100644 --- a/app/validate/api/MerchantIntentionValidate.php +++ b/app/validate/api/MerchantIntentionValidate.php @@ -24,7 +24,7 @@ class MerchantIntentionValidate extends Validate 'name|姓名' => 'require', 'mer_name|姓名' => 'require|max:32', 'merchant_category_id|商户分类' => 'require', - 'mer_type_id|店铺类型' => 'integer', + 'mer_type_id|店铺类型' => 'require|integer', 'code|验证码' => 'require', 'images|资质' => 'array', ];