diff --git a/app/common/model/Style.php b/app/common/model/Style.php index ba29c312..bf0bdc00 100644 --- a/app/common/model/Style.php +++ b/app/common/model/Style.php @@ -34,11 +34,11 @@ class Style extends BaseModel * @param int $storeId * @return static|array|null */ - public static function detail(int $styleId) + public static function detail(int $styleId, int $storeId) { $where = [ 'style_id' => $styleId, - 'store_id' => self::$storeId + 'store_id' => $storeId ]; return static::get($where, []); } diff --git a/app/store/controller/Merchant.php b/app/store/controller/Merchant.php index 5d8c932e..71fc562c 100644 --- a/app/store/controller/Merchant.php +++ b/app/store/controller/Merchant.php @@ -132,7 +132,7 @@ class Merchant extends Controller public function setPageStyle(): Json { $model = new StyleModel; - $detail = StyleModel::detail(1); + $detail = StyleModel::detail(1, $this->storeId); $data = $this->postForm(); if (empty($detail)) { if ($model->add($data)) { @@ -150,7 +150,7 @@ class Merchant extends Controller public function getPageStyle(): Json { // 新增记录 - $detail = StyleModel::detail(1); + $detail = StyleModel::detail(1, $this->storeId); return $this->renderSuccess(compact('detail')); }