|
|
@@ -87,6 +87,8 @@ class OrderController extends BaseController
|
|
|
}
|
|
|
|
|
|
$post['shopAdminId'] = $this->shopAdminId;
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ $post['shopAdminName'] = $shopAdmin['adminName'] ?? '';
|
|
|
$post['shopId'] = $shopId;
|
|
|
$post['payWay'] = $this->isWx == true ? 0 : 1;
|
|
|
$post['merchantId'] = $this->sjId;
|
|
|
@@ -249,30 +251,30 @@ class OrderController extends BaseController
|
|
|
{
|
|
|
//2021.3.28 接入达达
|
|
|
$get = Yii::$app->request->get();
|
|
|
- $orderId = $get['id']??0; //订单ID
|
|
|
- $customId = $get['customId']??0;
|
|
|
- if(!empty($customId)){
|
|
|
+ $orderId = $get['id'] ?? 0; //订单ID
|
|
|
+ $customId = $get['customId'] ?? 0;
|
|
|
+ if (!empty($customId)) {
|
|
|
util::success(['sedCost' => 27]);
|
|
|
}
|
|
|
- $province = $get['province']??'';
|
|
|
- $city = $get['city']??'';
|
|
|
- $address = $get['address']??'';
|
|
|
- $floor = $get['floor']??'';
|
|
|
- $fullAddress = $province.$city.$address.$floor;
|
|
|
- $sendTime = $get['sendTime']??'';
|
|
|
- $lat = $get['lat']??'';
|
|
|
- $lng = $get['long']??'';
|
|
|
- if(empty($lat) || empty($lng) || empty($fullAddress)) {
|
|
|
+ $province = $get['province'] ?? '';
|
|
|
+ $city = $get['city'] ?? '';
|
|
|
+ $address = $get['address'] ?? '';
|
|
|
+ $floor = $get['floor'] ?? '';
|
|
|
+ $fullAddress = $province . $city . $address . $floor;
|
|
|
+ $sendTime = $get['sendTime'] ?? '';
|
|
|
+ $lat = $get['lat'] ?? '';
|
|
|
+ $lng = $get['long'] ?? '';
|
|
|
+ if (empty($lat) || empty($lng) || empty($fullAddress)) {
|
|
|
util::fail('请选择配送地址');
|
|
|
}
|
|
|
- if(!empty($sendTime)){
|
|
|
+ if (!empty($sendTime)) {
|
|
|
//配送时间不为空
|
|
|
// 预约发单时间(预约时间unix时间戳(10位),精确到分;整分钟为间隔,并且需要至少提前5分钟预约
|
|
|
$sendTimeInt = strtotime($sendTime);
|
|
|
$now = time();
|
|
|
$diff = $sendTimeInt - $now;
|
|
|
//因服务器写入时间,改为至少提前6分钟
|
|
|
- if($diff <= 360){
|
|
|
+ if ($diff <= 360) {
|
|
|
util::fail('配送时间至少提前6分钟');
|
|
|
}
|
|
|
}
|
|
|
@@ -280,15 +282,15 @@ class OrderController extends BaseController
|
|
|
$info = OrderClass::getOrderInfo($orderId);
|
|
|
OrderClass::valid($info, $this->shopId);
|
|
|
$expressAddInfo = [
|
|
|
- 'province'=>$province,
|
|
|
- 'city'=>$city,
|
|
|
- 'address'=>$address,
|
|
|
- 'floor'=>$floor,
|
|
|
- 'lat'=>$lat,
|
|
|
- 'long'=>$lng,
|
|
|
- 'sendTime'=>date('Y-m-d H:i', strtotime($sendTime)),
|
|
|
+ 'province' => $province,
|
|
|
+ 'city' => $city,
|
|
|
+ 'address' => $address,
|
|
|
+ 'floor' => $floor,
|
|
|
+ 'lat' => $lat,
|
|
|
+ 'long' => $lng,
|
|
|
+ 'sendTime' => date('Y-m-d H:i', strtotime($sendTime)),
|
|
|
];
|
|
|
- OrderClass::updateCustomExpressInfo($orderId,$expressAddInfo);
|
|
|
+ OrderClass::updateCustomExpressInfo($orderId, $expressAddInfo);
|
|
|
//计算运费
|
|
|
$info['province'] = $province;
|
|
|
$info['city'] = $city;
|
|
|
@@ -318,7 +320,7 @@ class OrderController extends BaseController
|
|
|
} catch (\Exception $exception) {
|
|
|
$transaction->rollBack();
|
|
|
Yii::info("发快递操作报错:" . $exception->getMessage());
|
|
|
- util::fail('操作失败'. $exception->getMessage());
|
|
|
+ util::fail('操作失败' . $exception->getMessage());
|
|
|
}
|
|
|
}
|
|
|
|