...
|
...
|
@@ -210,7 +210,23 @@ class Order extends Api |
|
|
$goods_array[] = $goods;
|
|
|
$sum_price = bcadd($sum_price,bcmul($sku['goods_price'],$value['number'],2),2);
|
|
|
}
|
|
|
$this->success('下单页详情',['list'=>$goods_array,'price'=>$sum_price]);
|
|
|
$addressmodel = new UserAddress();
|
|
|
$address = $addressmodel->where('user_id',$this->auth->id)->where('normal_status','1')->find();
|
|
|
$express_price = 0;
|
|
|
if ($address){
|
|
|
// 计算运费
|
|
|
$lat1 = $address['lat'];
|
|
|
$lng1 = $address['lng'];
|
|
|
$admin_address = Db::name('admin_address')->find();
|
|
|
$lat2 = $admin_address['lat'];
|
|
|
$lng2 = $admin_address['lng'];
|
|
|
$express_price = $this->distancePrice($lat1,$lng1,$lat2,$lng2);
|
|
|
if ($express_price === false) $express_price = 0;
|
|
|
}else{
|
|
|
$address = [];
|
|
|
}
|
|
|
$sum_price += $express_price;
|
|
|
$this->success('下单页详情',['list'=>$goods_array,'price'=>$sum_price,'address'=>$address]);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|