|
|
|
@ -93,15 +93,13 @@ class OrderOnlineController extends BaseController |
|
|
|
]) |
|
|
|
->select('id') |
|
|
|
->first(); |
|
|
|
$res['location'] = $this->userAddressService->getAddressAndDistributionRrice($address->id,$marketId); |
|
|
|
$res['location'] = $this->userAddressService->getAddressAndDistributionRrice($address->id,$marketId); |
|
|
|
//返回预约送达时间 数组
|
|
|
|
$res['appointment_time'] = $this->appointmentTimeService->do(); |
|
|
|
//
|
|
|
|
$res['store_list'] = $this->shopCartService->getGoodsByShopcartId($shopcartIds); |
|
|
|
//获取用户优惠券
|
|
|
|
$res['coupon'] = $this->couponRecService->allForOnlineOrderAvailable($userId, $marketId); |
|
|
|
//获取配送费
|
|
|
|
$res['distribution_price'] = '5.0'; |
|
|
|
//增值服务接口
|
|
|
|
$res['value_added_service'] = [ |
|
|
|
'select' => 1, |
|
|
|
@ -110,10 +108,10 @@ class OrderOnlineController extends BaseController |
|
|
|
$total = 0; |
|
|
|
foreach ($res['store_list'] as $store) |
|
|
|
{ |
|
|
|
$total+= $store['subtotal']; |
|
|
|
$total = bcadd($total,$store['subtotal'],2); |
|
|
|
} |
|
|
|
$total+= $res['value_added_service']['price']; |
|
|
|
$total+= $res['distribution_price']; |
|
|
|
$total = bcadd($total,$res['value_added_service']['price'],2); |
|
|
|
$total = bcadd($total,$res['location']['distribution_price'],2); |
|
|
|
$res['total'] = $total; |
|
|
|
return $this->success($res); |
|
|
|
} |
|
|
|
|