فهرست منبع

修复:getAll方法获取不到storeId

Yahoo 4 سال پیش
والد
کامیت
9683681b54
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  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
     public static function getAll(int $storeId = null): array
     {
     {
-        is_null($storeId) && $storeId = static::$storeId;
         $model = new static;
         $model = new static;
+        is_null($storeId) && $storeId = static::$storeId;
         if (!$data = Cache::get("h5_setting_{$storeId}")) {
         if (!$data = Cache::get("h5_setting_{$storeId}")) {
             // 获取全部设置
             // 获取全部设置
             $setting = $model->getList($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
     public static function getAll(int $storeId = null): array
     {
     {
-        is_null($storeId) && $storeId = static::$storeId;
         $model = new static;
         $model = new static;
+        is_null($storeId) && $storeId = static::$storeId;
         if (!$data = Cache::get("setting_{$storeId}")) {
         if (!$data = Cache::get("setting_{$storeId}")) {
             // 获取商城设置列表
             // 获取商城设置列表
             $setting = $model->getList($storeId);
             $setting = $model->getList($storeId);