Explorar o código

修复:getAll方法获取不到storeId

Yahoo %!s(int64=4) %!d(string=hai) anos
pai
achega
9683681b54
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  1. 1 1
      app/common/model/h5/Setting.php
  2. 1 1
      app/common/model/store/Setting.php

+ 1 - 1
app/common/model/h5/Setting.php

@@ -86,8 +86,8 @@ class Setting extends BaseModel
      */
     public static function getAll(int $storeId = null): array
     {
-        is_null($storeId) && $storeId = static::$storeId;
         $model = new static;
+        is_null($storeId) && $storeId = static::$storeId;
         if (!$data = Cache::get("h5_setting_{$storeId}")) {
             // 获取全部设置
             $setting = $model->getList($storeId);

+ 1 - 1
app/common/model/store/Setting.php

@@ -92,8 +92,8 @@ class Setting extends BaseModel
      */
     public static function getAll(int $storeId = null): array
     {
-        is_null($storeId) && $storeId = static::$storeId;
         $model = new static;
+        is_null($storeId) && $storeId = static::$storeId;
         if (!$data = Cache::get("setting_{$storeId}")) {
             // 获取商城设置列表
             $setting = $model->getList($storeId);