feature/main20240421
guojia 7 months ago
parent 7827116a8f
commit a32101d2a7
  1. 4
      app/common/model/Style.php
  2. 4
      app/store/controller/Merchant.php

@ -34,11 +34,11 @@ class Style extends BaseModel
* @param int $storeId * @param int $storeId
* @return static|array|null * @return static|array|null
*/ */
public static function detail(int $styleId) public static function detail(int $styleId, int $storeId)
{ {
$where = [ $where = [
'style_id' => $styleId, 'style_id' => $styleId,
'store_id' => self::$storeId 'store_id' => $storeId
]; ];
return static::get($where, []); return static::get($where, []);
} }

@ -132,7 +132,7 @@ class Merchant extends Controller
public function setPageStyle(): Json public function setPageStyle(): Json
{ {
$model = new StyleModel; $model = new StyleModel;
$detail = StyleModel::detail(1); $detail = StyleModel::detail(1, $this->storeId);
$data = $this->postForm(); $data = $this->postForm();
if (empty($detail)) { if (empty($detail)) {
if ($model->add($data)) { if ($model->add($data)) {
@ -150,7 +150,7 @@ class Merchant extends Controller
public function getPageStyle(): Json public function getPageStyle(): Json
{ {
// 新增记录 // 新增记录
$detail = StyleModel::detail(1); $detail = StyleModel::detail(1, $this->storeId);
return $this->renderSuccess(compact('detail')); return $this->renderSuccess(compact('detail'));
} }

Loading…
Cancel
Save