feature/main20240421
guojia 9 months ago
parent 6e6bdd4f54
commit 6c7b1ae4c0
  1. 4
      app/api/controller/Merchant.php
  2. 5
      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'));
}

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

Loading…
Cancel
Save