ryan 1 vecka sedan
förälder
incheckning
72f3fec3e4
1 ändrade filer med 6 tillägg och 5 borttagningar
  1. 6 5
      frontendApi/modules/v1/controllers/ShopController.php

+ 6 - 5
frontendApi/modules/v1/controllers/ShopController.php

@@ -805,18 +805,19 @@ class ShopController extends BaseController {
             return static::notice('countryId is required', 400);
             return static::notice('countryId is required', 400);
         }
         }
 
 
-        $userId = User::find()
-            ->select('ID')
+        $user = User::find()
+            ->select('ID,USER_NAME')
             ->where(['COUNTRY_ID' => (int)$countryId, 'IS_DEC' => 1])
             ->where(['COUNTRY_ID' => (int)$countryId, 'IS_DEC' => 1])
             ->orderBy(['USER_NAME' => SORT_ASC])
             ->orderBy(['USER_NAME' => SORT_ASC])
-            ->scalar();
+            ->asArray()
+            ->one();
 
 
-        if (!$userId) {
+        if (!$user) {
             return static::notice(Yii::t('app', 'stockistDoesNotExist'), 400);
             return static::notice(Yii::t('app', 'stockistDoesNotExist'), 400);
         }
         }
 
 
         // 会员信息
         // 会员信息
-        $user = User::findOneAsArray('ID=:ID', [':ID' => $userId['ID']]);
+        $user = User::findOneAsArray('ID=:ID', [':ID' => $user['ID']]);
         if (!$user) {
         if (!$user) {
             return static::notice(Yii::t('app', 'memberDoesNotExist'), 400);
             return static::notice(Yii::t('app', 'memberDoesNotExist'), 400);
         }
         }