diff --git a/app/admin/model/Store.php b/app/admin/model/Store.php index d4824e29..b7638c5c 100644 --- a/app/admin/model/Store.php +++ b/app/admin/model/Store.php @@ -97,7 +97,8 @@ class Store extends StoreModel 10046,10243,10244,10246,10245,10050,10051, 10052,10205,10054,10189,10055,10223,10139,10252,10056,10058, 10059,10057,10201,10238,10241,10239,10240,10242,10202,10203, - 10206,10207,10208,10209,10213,10210,10211,10115 + 10206,10207,10208,10209,10213,10210,10211,10115,10247,10248, + 10249 ], 'store_id' => $storeId ]; diff --git a/app/api/model/Goods.php b/app/api/model/Goods.php index d60de044..b6848ba1 100644 --- a/app/api/model/Goods.php +++ b/app/api/model/Goods.php @@ -463,6 +463,24 @@ class Goods extends GoodsModel if (isset($goodsInfo->skuList1)) { unset($goodsInfo->skuList1); } + $goodsInfo['merchant'] = null; + //商户信息 + if ($goodsInfo['merchant_id']) { + $merchant = \app\common\model\Merchant::detail($goodsInfo['merchant_id'], $goodsInfo->store_id); + if ($merchant) { + if ($merchant['license_img_id']) { + $img_ids = explode(",", $merchant['license_img_id']); + $files = UploadFileModel::getFileList($img_ids, $goodsInfo->store_id); + $merchant['licenseImg'] = $files ?: null; + } + if ($merchant['logo_image_id']) { + $files = UploadFileModel::getFileList([$merchant['logo_image_id']], $goodsInfo->store_id); + $merchant['logoImage'] = $files ?: null; + } + } + + $goodsInfo['merchant'] = $merchant; + } //加入足迹 $userId = UserService::getCurrentLoginUserId(false) ?? ''; if ($userId) { diff --git a/app/common/model/Merchant.php b/app/common/model/Merchant.php index 696814df..44136f60 100644 --- a/app/common/model/Merchant.php +++ b/app/common/model/Merchant.php @@ -69,11 +69,12 @@ class Merchant extends BaseModel * @param int $storeId * @return static|array|null */ - public static function detail(int $merchantId) + public static function detail(int $merchantId, $store_id = 0) { + $store_id = $store_id ? $store_id : self::$storeId; $where = [ 'merchant_id' => $merchantId, - 'store_id' => self::$storeId + 'store_id' => $store_id ]; return static::get($where, []); } diff --git a/app/store/controller/store/User.php b/app/store/controller/store/User.php index 1adab547..a37d4969 100644 --- a/app/store/controller/store/User.php +++ b/app/store/controller/store/User.php @@ -37,13 +37,22 @@ class User extends Controller { // 当前登录用户的ID $storeUserId = StoreUserService::getLoginUserId(); + $roles = StoreRoleService::getLoginPermissions(); + $modules = StoreModuleModel::getModules(); + if ($roles['isSuper'] == 1) { + $modules = array_flip($modules); + // var_dump($modules1); + // exit(); + unset($modules['apps-collector']); + $modules = array_keys($modules); + } return $this->renderSuccess([ // 用户信息 'userInfo' => StoreUserModel::detail($storeUserId), // 菜单权限 - 'roles' => StoreRoleService::getLoginPermissions(), + 'roles' => $roles, // 开启的功能模块 - 'modules' => StoreModuleModel::getModules(), + 'modules' => $modules, ]); }