wang hou sheng 7 months ago
parent 0e3eddc37e
commit 933ef035e7
  1. 12
      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 = [];

Loading…
Cancel
Save