liugc vor 1 Jahr
Ursprung
Commit
5947ad1f0d

+ 4 - 4
app/adminapi/logic/master_worker_register/MasterWorkerRegisterLogic.php

@@ -57,8 +57,8 @@ class MasterWorkerRegisterLogic extends BaseLogic
             }
 
             MasterWorkerRegister::create([
-                'maintain_exp_type' => $params['maintain_exp_type'],
-                'other_exp_type' => $params['other_exp_type'],
+                'maintain_exp_type' => isset($params['maintain_exp_type'])?$params['maintain_exp_type']:0,
+                'other_exp_type' => isset($params['other_exp_type'])?$params['other_exp_type']:'',
                 'city' => $params['city'],
                 'vehicle_type' => $params['vehicle_type'],
                 'name' => $params['name'],
@@ -92,8 +92,8 @@ class MasterWorkerRegisterLogic extends BaseLogic
         Db::startTrans();
         try {
             $updata = [
-                'maintain_exp_type' => $params['maintain_exp_type'],
-                'other_exp_type' => $params['other_exp_type'],
+                'maintain_exp_type' => isset($params['maintain_exp_type'])?$params['maintain_exp_type']:0,
+                'other_exp_type' => isset($params['other_exp_type'])?$params['other_exp_type']:'',
                 'city' => $params['city'],
                 'vehicle_type' => $params['vehicle_type'],
                 'name' => $params['name'],

+ 2 - 2
app/workerapi/logic/LoginLogic.php

@@ -94,8 +94,8 @@ class LoginLogic extends BaseLogic
                 ]);
             }else{
                 MasterWorkerRegister::create([
-                    'maintain_exp_type' => $params['maintain_exp_type'],
-                    'other_exp_type' => $params['other_exp_type'],
+                    'maintain_exp_type' => isset($params['maintain_exp_type'])?$params['maintain_exp_type']:0,
+                    'other_exp_type' => isset($params['other_exp_type'])?$params['other_exp_type']:'',
                     'other_exp_name' => (isset($params['other_exp_name']) && $params['other_exp_type'] == 4)?$params['other_exp_name']:'',
                     'city' => $params['city'],
                     'vehicle_type' => $params['vehicle_type'],

+ 4 - 4
app/workerapi/validate/RegisterValidate.php

@@ -16,20 +16,20 @@ use app\common\validate\BaseValidate;
 class RegisterValidate extends BaseValidate
 {
     protected $rule = [
-        'other_exp_type' => 'require',
+        //'other_exp_type' => 'require',
         'vehicle_type' => 'require',
         'name' => 'require',
         'age' => 'require|number|between:18,55',
         'mobile' => 'require|mobile',
         'code' => 'require',
         'city' => 'require',
-        'maintain_exp_type' => 'require',
+        //'maintain_exp_type' => 'require',
         'lon' => 'require',
         'lat' => 'require',
     ];
 
     protected $message = [
-        'other_exp_type.require' => '其他经验必填',
+        //'other_exp_type.require' => '其他经验必填',
         'vehicle_type.require' => '交通工具必填',
         'name.require' => '账号必填',
         'age.require' => '年龄必填',
@@ -38,7 +38,7 @@ class RegisterValidate extends BaseValidate
         'mobile.mobile' => '请输入正确手机号',
         'code.require' => '请输入验证码',
         'city.require' => '请输入城市',
-        'maintain_exp_type.require' => '请输入维修经验',
+        //'maintain_exp_type.require' => '请输入维修经验',
         'lon.require' => '请输入经度',
         'lat.require' => '请输入维度',
     ];