Bläddra i källkod

请填写地址

shish 5 år sedan
förälder
incheckning
d42eb0612b
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      app-ghs/controllers/CustomController.php

+ 4 - 1
app-ghs/controllers/CustomController.php

@@ -24,6 +24,7 @@ class CustomController extends BaseController
         $post['introStyle'] = SjClass::STYLE_SUPPLIER;
         $mobile = $post['mobile'] ?? '';
         $confirmMobile = $post['confirmMobile'];
+        $address = $post['address'] ?? '';
         if (stringUtil::isMobile($mobile) == false) {
             util::fail(' 请填写正确的手机号');
         }
@@ -45,6 +46,9 @@ class CustomController extends BaseController
         if (!empty($has)) {
             util::fail('手机号已经添加过');
         }
+        if (empty($address)) {
+            util::fail('请填写地址');
+        }
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
@@ -54,7 +58,6 @@ class CustomController extends BaseController
             $sjName = $this->sj->name ?? '';
             $city = $shop->city ?? '';
             $dist = $shop->dist ?? '';
-            $address = $post['address'] ?? '';
             $applyData = [
                 'name' => $name,
                 'licenseNo' => $mobile,