|
|
@@ -77,14 +77,14 @@ class Order extends Base |
|
|
|
} |
|
|
|
|
|
|
|
/** 默认地址 **/ |
|
|
|
$address = (new AddressModel)->where(['user_id' => $user_id, 'is_default' => AddressModel::IS_DEFAULT_YES])->find(); |
|
|
|
if ($address) { |
|
|
|
$area = (new Area)->whereIn('id', [$address->province_id, $address->city_id, $address->area_id])->column('name', 'id'); |
|
|
|
$address = $address->toArray(); |
|
|
|
$address['province']['name'] = $area[$address['province_id']]; |
|
|
|
$address['city']['name'] = $area[$address['city_id']]; |
|
|
|
$address['area']['name'] = $area[$address['area_id']]; |
|
|
|
} |
|
|
|
// $address = (new AddressModel)->where(['user_id' => $user_id, 'is_default' => AddressModel::IS_DEFAULT_YES])->find(); |
|
|
|
// if ($address) { |
|
|
|
// $area = (new Area)->whereIn('id', [$address->province_id, $address->city_id, $address->area_id])->column('name', 'id'); |
|
|
|
// $address = $address->toArray(); |
|
|
|
// $address['province']['name'] = $area[$address['province_id']]; |
|
|
|
// $address['city']['name'] = $area[$address['city_id']]; |
|
|
|
// $address['area']['name'] = $area[$address['area_id']]; |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
/** 可用优惠券 **/ |
|
|
@@ -101,8 +101,8 @@ class Order extends Base |
|
|
|
|
|
|
|
|
|
|
|
/** 运费数据 **/ |
|
|
|
$cityId = $address['city_id'] ? $address['city_id'] : 0; |
|
|
|
$delivery = (new DeliveryRuleModel())->getDelivetyByArea($cityId); |
|
|
|
// $cityId = $address['city_id'] ? $address['city_id'] : 0; |
|
|
|
// $delivery = (new DeliveryRuleModel())->getDelivetyByArea($cityId); |
|
|
|
|
|
|
|
foreach ($productData as &$product) { |
|
|
|
$product['image'] = Config::getImagesFullUrl($product['image']); |
|
|
@@ -112,9 +112,9 @@ class Order extends Base |
|
|
|
|
|
|
|
$this->success('', [ |
|
|
|
'product' => $productData, |
|
|
|
'address' => $address, |
|
|
|
// 'address' => $address, |
|
|
|
'coupon' => $coupon, |
|
|
|
'delivery' => $delivery['list'] |
|
|
|
// 'delivery' => $delivery['list'] |
|
|
|
]); |
|
|
|
|
|
|
|
} catch (Exception $e) { |
|
|
|