diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index 40d7b93f..f3ffc512 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -524,7 +524,7 @@ class Goods extends BaseModel */ protected function setGoodsData($goodsInfo, callable $callback = null) { - $channel = Channel::where('code', $goodsInfo['channel'])->find(); + $channel = Channel::withoutGlobalScope()->where('code', $goodsInfo['channel'])->find(); $goodsInfo['channel_name'] = $channel['name'] ?? ""; $goodsInfo['goods_images'] = helper::getArrayColumn($goodsInfo['images'], 'file'); diff --git a/app/job/service/goods/AdminImport.php b/app/job/service/goods/AdminImport.php index dbf48b39..41e674c6 100644 --- a/app/job/service/goods/AdminImport.php +++ b/app/job/service/goods/AdminImport.php @@ -214,14 +214,14 @@ class AdminImport extends BaseService list($province, $city) = explode(".", $value); $cityNames[] = $city; } - $regions = Region::whereIn('name', $cityNames)->select()->toArray(); + $regions = Region::withoutGlobalScope()->whereIn('name', $cityNames)->select()->toArray(); $regionsnew = []; foreach ($regions as $key => $value) { $regionsnew[$value['pid']][] = $value; } foreach ($regionsnew as $pid => $value) { - $privince = Region::where('id', $pid)->find(); + $privince = Region::withoutGlobalScope()->where('id', $pid)->find(); $region_text[$pid]['name'] = $privince['name'] ?? ""; $citys = []; diff --git a/app/store/controller/Store.php b/app/store/controller/Store.php index bef6dcf2..ea33af9e 100644 --- a/app/store/controller/Store.php +++ b/app/store/controller/Store.php @@ -76,7 +76,7 @@ class Store extends Controller public function platformList(): Json { //$list = Channel::where('status', 1)->whereIn('code',['jd','sn','zy'])->select(); - $list = Channel::where('status', 1)->whereIn('code',['zy'])->select(); + $list = Channel::withoutGlobalScope()->where('status', 1)->whereIn('code',['zy'])->select(); $platformList = []; foreach ($list as $key => $value) { $platformList[$value['code']] = $value['name'];