lqmac 10 months ago
parent e39c0dc12d
commit 33d3220df4
  1. 2
      app/common/model/Goods.php
  2. 4
      app/job/service/goods/AdminImport.php
  3. 2
      app/store/controller/Store.php

@ -524,7 +524,7 @@ class Goods extends BaseModel
*/ */
protected function setGoodsData($goodsInfo, callable $callback = null) 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['channel_name'] = $channel['name'] ?? "";
$goodsInfo['goods_images'] = helper::getArrayColumn($goodsInfo['images'], 'file'); $goodsInfo['goods_images'] = helper::getArrayColumn($goodsInfo['images'], 'file');

@ -214,14 +214,14 @@ class AdminImport extends BaseService
list($province, $city) = explode(".", $value); list($province, $city) = explode(".", $value);
$cityNames[] = $city; $cityNames[] = $city;
} }
$regions = Region::whereIn('name', $cityNames)->select()->toArray(); $regions = Region::withoutGlobalScope()->whereIn('name', $cityNames)->select()->toArray();
$regionsnew = []; $regionsnew = [];
foreach ($regions as $key => $value) { foreach ($regions as $key => $value) {
$regionsnew[$value['pid']][] = $value; $regionsnew[$value['pid']][] = $value;
} }
foreach ($regionsnew as $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'] ?? ""; $region_text[$pid]['name'] = $privince['name'] ?? "";
$citys = []; $citys = [];

@ -76,7 +76,7 @@ class Store extends Controller
public function platformList(): Json public function platformList(): Json
{ {
//$list = Channel::where('status', 1)->whereIn('code',['jd','sn','zy'])->select(); //$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 = []; $platformList = [];
foreach ($list as $key => $value) { foreach ($list as $key => $value) {
$platformList[$value['code']] = $value['name']; $platformList[$value['code']] = $value['name'];

Loading…
Cancel
Save