|
|
@@ -17,13 +17,8 @@ use linslin\yii2\curl;
|
|
|
|
|
|
class OrderSendService extends BaseService
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
public static $baseFile = '\biz\order\classes\OrderSendClass';
|
|
|
-
|
|
|
- public static function sendDetail($orderId)
|
|
|
- {
|
|
|
- return OrderSendClass::sendDetail($orderId);
|
|
|
- }
|
|
|
|
|
|
//打单 shish 2019.12.17
|
|
|
public static function printOrder($data)
|
|
|
@@ -112,7 +107,7 @@ class OrderSendService extends BaseService
|
|
|
}
|
|
|
$time = time();
|
|
|
OrderSendClass::updateByCondition(['orderId' => $id, 'actionId' => $reachId], ['option' => $option, 'finishTime' => $time]);
|
|
|
-
|
|
|
+
|
|
|
//进入完成流程
|
|
|
$finishId = $actionIdList['finish'];
|
|
|
$data = ['actionId' => $finishId, 'orderId' => $id, 'finishTime' => $time, 'addTime' => $time, 'inTurn' => $finishId];
|
|
|
@@ -121,5 +116,48 @@ class OrderSendService extends BaseService
|
|
|
$data['actionSign'] = isset($actionList[$finishId]['sign']) ? $actionList[$finishId]['sign'] : '';
|
|
|
util::success(['nextAction' => $data]);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //发货详情 shish 2019.12.15
|
|
|
+ public static function sendList($order)
|
|
|
+ {
|
|
|
+ $orderId = $order['id'];
|
|
|
+ $list = OrderSendClass::getAllByCondition(['orderId' => $orderId], 'inTurn DESC', '*');
|
|
|
+ if (empty($list)) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ $nameList = OrderSendClass::$action;
|
|
|
+ $idList = OrderSendClass::$actionId;
|
|
|
+ foreach ($list as $key => $val) {
|
|
|
+ $actionId = $val['actionId'];
|
|
|
+ $list[$key]['actionName'] = isset($nameList[$actionId]['name']) ? $nameList[$actionId]['name'] : '';
|
|
|
+ $list[$key]['actionSign'] = isset($nameList[$actionId]['sign']) ? $nameList[$actionId]['sign'] : '';
|
|
|
+ if ($actionId == $idList['printOrder']) {
|
|
|
+ $list[$key]['receive'] = [];
|
|
|
+ if (!empty($order['receiveUserName'])) {
|
|
|
+ $list[$key]['receive'] = ['receiveUserName' => $order['receiveUserName'], 'receiveMobile' => $order['receiveMobile'], 'receiveAddress' => $order['receiveAddress']];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($actionId == $idList['deliver']) {
|
|
|
+ $list[$key]['sendInfo'] = [];
|
|
|
+ if ($order['sendType'] == 2) {
|
|
|
+ $list[$key]['sendInfo'] = [
|
|
|
+ 'sendSideName' => '达达',
|
|
|
+ 'sendDistance' => 5.5,
|
|
|
+ 'sendCost' => 20,
|
|
|
+ 'sendTip' => 5,
|
|
|
+ 'sendTime' => '1576549653',
|
|
|
+ 'sendStatus' => 0,
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($actionId == $idList['finish']) {
|
|
|
+ $list[$key]['classify'] = [];
|
|
|
+ if ($order['classify'] == 1) {
|
|
|
+ $list[$key]['classify'] = ['category' => '花束', 'usage' => '开业'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
+
|
|
|
}
|