feature/main20240421
guojia 9 months ago
parent 6e6bdd4f54
commit 6c7b1ae4c0
  1. 4
      app/api/controller/Merchant.php
  2. 7
      app/store/controller/Controller.php

@ -77,10 +77,10 @@ class Merchant extends Controller
} }
public function detail(int $merchantId): Json public function detail(int $id): Json
{ {
// 获取商品详情 // 获取商品详情
$detail = MerchantModel::detail($merchantId); $detail = MerchantModel::detail($id);
return $this->renderSuccess(compact('detail')); return $this->renderSuccess(compact('detail'));
} }

@ -33,7 +33,7 @@ class Controller extends BaseController
protected int $storeId; protected int $storeId;
// 当前商户ID // 当前商户ID
protected int $merchantId; protected int $merchantId = 0;
// 当前控制器名称 // 当前控制器名称
protected string $controller = ''; protected string $controller = '';
@ -157,8 +157,9 @@ class Controller extends BaseController
protected function getMerchantId() protected function getMerchantId()
{ {
$user = StoreUserService::getLoginInfo(); $user = StoreUserService::getLoginInfo();
if (!empty($user)) {
$this->merchantId = MerchantModel::getMerchantId($user['user']['user_name']); $this->merchantId = MerchantModel::getMerchantId($user['user']['user_name']);
}
} }
/** /**

Loading…
Cancel
Save