修改订单发货

This commit is contained in:
liaofei 2023-05-11 10:15:16 +08:00
parent 9c1dde8622
commit 16ee3f8733
4 changed files with 11 additions and 14 deletions

View File

@ -254,8 +254,7 @@ class StoreOrder extends AuthController
['fictitious_content', '']//虚拟发货内容
]);
$services->delivery((int)$id, $data);
return app('json')->success(100010);
return app('json')->success(100010, $services->delivery((int)$id, $data));
}
/**

View File

@ -88,9 +88,7 @@ class StoreOrder extends AuthController
]);
$data['express_record_type'] = 1;
$data['type'] = 1;
$this->services->delivery($order_id, $data);
return app('json')->success(100010);
return app('json')->success(100010, $this->services->delivery($order_id, $data));
}
/**

View File

@ -303,12 +303,12 @@ class OutStoreOrderServices extends BaseServices
* 发货
* @param string $orderId 订单号
* @param array $data
* @return bool
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function delivery(string $orderId, array $data): bool
public function delivery(string $orderId, array $data)
{
$orderInfo = $this->dao->get(['order_id' => $orderId]);
if (!$orderInfo) {

View File

@ -45,7 +45,7 @@ class StoreOrderDeliveryServices extends BaseServices
* 订单发货
* @param int $id
* @param array $data
* @return bool
* @return array
*/
public function delivery(int $id, array $data)
{
@ -80,8 +80,7 @@ class StoreOrderDeliveryServices extends BaseServices
if ($storeOrderRefundServices->count(['store_order_id' => $id, 'refund_type' => [1, 2, 4, 5], 'is_cancel' => 0, 'is_del' => 0])) {
throw new AdminException(400475);
}
$this->doDelivery($id, $orderInfo, $data);
return true;
return $this->doDelivery($id, $orderInfo, $data);
}
/**
@ -431,7 +430,7 @@ class StoreOrderDeliveryServices extends BaseServices
* @param int $id
* @param $orderInfo
* @param array $data
* @return bool
* @return array
*/
public function doDelivery(int $id, $orderInfo, array $data)
{
@ -441,9 +440,10 @@ class StoreOrderDeliveryServices extends BaseServices
/** @var StoreOrderCartInfoServices $orderInfoServices */
$orderInfoServices = app()->make(StoreOrderCartInfoServices::class);
$storeName = $orderInfoServices->getCarIdByProductTitle((int)$orderInfo->id);
$res = [];
switch ($type) {
case 1://快递发货
$this->orderDeliverGoods($id, $data, $orderInfo, $storeName);
$res = $this->orderDeliverGoods($id, $data, $orderInfo, $storeName);
event('NoticeListener', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_postage_success']);
break;
case 2://配送
@ -458,7 +458,7 @@ class StoreOrderDeliveryServices extends BaseServices
}
//到期自动收货
event('OrderDeliveryListener', [$orderInfo, $storeName, $data, $type]);
return true;
return $res;
}
/**
@ -543,7 +543,7 @@ class StoreOrderDeliveryServices extends BaseServices
throw new AdminException(400529);
}
});
return true;
return $dump;
}
/**