From 1be278da4dd942685493280218d7c9e35e4018b1 Mon Sep 17 00:00:00 2001 From: lqmac Date: Wed, 22 May 2024 12:37:11 +0800 Subject: [PATCH] 1 --- app/admin/controller/goods/Import.php | 2 +- app/api/controller/Goods.php | 2 +- app/common/model/Goods.php | 2 +- app/store/model/Store.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/controller/goods/Import.php b/app/admin/controller/goods/Import.php index 9437a517..ba31bc5a 100644 --- a/app/admin/controller/goods/Import.php +++ b/app/admin/controller/goods/Import.php @@ -35,7 +35,7 @@ class Import extends Controller $params['store_id'] = 0; $model = new ImportModel; $platform = $this->getUserPlatform(); - $params['channels'] = $platform ? array_column($platform->toArray(), "code") : []; + $params['channels'] = $this->admin['user']['role'] == 0 ? [] : ($platform ? array_column($platform->toArray(), "code") : []); $list = $model->getList($params); return $this->renderSuccess(compact('list')); } diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index d94d3570..dee1faf1 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -411,7 +411,7 @@ class Goods extends Controller $wxConfig = WxappSettingModel::getConfigBasic($store_id); // 请求api获取短连接 $link_obj = new ShortLink($wxConfig['app_id'], $wxConfig['app_secret']); - $url = $link_obj->shortUrl($page_url, $page_title); + $url = $link_obj->shortUrl($page_url, ""); return $this->renderSuccess(['url' => $url]); } diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index 880bbc3b..286a6a82 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -584,7 +584,7 @@ class Goods extends BaseModel protected function setGoodsData($goodsInfo, callable $callback = null) { $channel = Channel::withoutGlobalScope()->where('code', $goodsInfo['channel'])->find(); - $goodsInfo['channel_name'] = $channel['name'] ?? ""; + $goodsInfo['channel_name'] = $channel['alias'] ?? ""; $goodsInfo['goods_images'] = helper::getArrayColumn($goodsInfo['images'], 'file'); // 商品主图 diff --git a/app/store/model/Store.php b/app/store/model/Store.php index 0bbf86e5..32fcc630 100644 --- a/app/store/model/Store.php +++ b/app/store/model/Store.php @@ -30,7 +30,7 @@ class Store extends StoreModel { // 是否删除图片 !isset($data['logo_image_id']) && $data['logo_image_id'] = 0; - $data['fliter_condition'] = json_encode($data['fliter_condition'], JSON_UNESCAPED_UNICODE); + $data['fliter_condition'] = isset($data['fliter_condition']) ? json_encode($data['fliter_condition'], JSON_UNESCAPED_UNICODE) : ""; return $this->save($data) !== false; } }