From 933ef035e72d0ec427f5b95b2fead199e520f47a Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 21 Apr 2024 16:05:45 +0800 Subject: [PATCH] 1 --- app/api/controller/Goods.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 = [];