ryan 1 неделя назад
Родитель
Сommit
cab2e7f493

+ 1 - 0
frontendApi/config/params.php

@@ -20,6 +20,7 @@ return [
         'v1/shop/no-login-reconsume',
         'v1/shop/no-login-reconsume-sure-order',
         'v1/shop/no-login-show-cart',
+        'v1/config/no-login-region-list',
         'v1/user/guest-dec',
         'v1/user/guest-dec-debug-paid',
         'v1/user/guest-dec-status',

+ 1 - 0
frontendApi/config/urlManagerRules.php

@@ -223,6 +223,7 @@ return [
             'POST ba-receive-address-default' => 'ba-receive-address-default',
             'POST ba-receive-address-delete' => 'ba-receive-address-delete',
             'GET region-list' => 'region-list',
+            'GET no-login-region-list' => 'no-login-region-list',
         ],
     ],
     [

+ 17 - 1
frontendApi/modules/v1/controllers/ConfigController.php

@@ -127,6 +127,22 @@ class ConfigController extends BaseController
         return static::notice($data);
     }
 
+    /**
+     * 无需登录的行政区划列表
+     * @return mixed
+     * @throws \yii\web\HttpException
+     */
+    public function actionNoLoginRegionList() {
+        $countryId = \Yii::$app->request->get('countryId');
+        if (!$countryId) {
+            return static::notice('countryId is required', 400);
+        }
+
+        $data = Region::getByCountryId($countryId);
+
+        return static::notice($data);
+    }
+
     /**
      * 获取一条收货地址
      * @return mixed
@@ -291,4 +307,4 @@ class ConfigController extends BaseController
         }
         return static::notice(Yii::t('app', 'illegalRequest'), 400);
     }
-}
+}