diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index 4b15b7c6..05984a13 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -88,10 +88,8 @@ class Goods extends Controller $goods = GoodsModel::where('goods_id', $value['goods_id'])->find(); switch ($goods->channel) { case 'sn': - $city = Region::where('name', $params['city'])->where('level', 2)->find(); - $district = Region::where('name', $params['district'])->where('level', 3)->find(); - // var_dump($city); - // var_dump($district); + $city = Region::withoutGlobalScope()->where('name', $params['city'])->where('level', 2)->find(); + $district = Region::withoutGlobalScope()->where('name', $params['district'])->where('level', 3)->find(); $suning = new \app\common\service\Suning(); $goods->num = $param['num'] ?? 1; $data = $suning->shoppingCartPrice([$goods->toArray()], $city->sn_code, $district->sn_code); @@ -99,9 +97,9 @@ class Goods extends Controller $data['goods_id'] = $goods['goods_id']; break; case 'jd': - $province = Region::where('name', $params['province'])->where('level', 1)->find(); - $city = Region::where('name', $params['city'])->where('level', 2)->find(); - $district = Region::where('name', $params['district'])->where('level', 3)->find(); + $province = Region::withoutGlobalScope()->where('name', $params['province'])->where('level', 1)->find(); + $city = Region::withoutGlobalScope()->where('name', $params['city'])->where('level', 2)->find(); + $district = Region::withoutGlobalScope()->where('name', $params['district'])->where('level', 3)->find(); $jd = new \app\common\service\Jd(); $arr = [];