新增创建检测订单
This commit is contained in:
@@ -393,9 +393,6 @@ class DetectionService extends BaseService
|
||||
$detection_pay_channel = 2;
|
||||
}
|
||||
|
||||
// 处理订单金额
|
||||
|
||||
|
||||
Db::beginTransaction();
|
||||
|
||||
$generator = $this->container->get(IdGeneratorInterface::class);
|
||||
@@ -443,18 +440,18 @@ class DetectionService extends BaseService
|
||||
}
|
||||
|
||||
// 增加至未支付取消订单延迟队列
|
||||
// $data = array();
|
||||
// $data['order_no'] = $order_detection['detection_no'];
|
||||
// $data['order_type'] = 3;
|
||||
//
|
||||
// $message = new CancelUnpayOrdersDelayDirectProducer($data);
|
||||
// $message->setDelayMs(1000 * 60 * 30);
|
||||
// $producer = $this->container->get(Producer::class);
|
||||
// $res = $producer->produce($message);
|
||||
// if (!$res) {
|
||||
// Db::rollBack();
|
||||
// return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
||||
// }
|
||||
$data = array();
|
||||
$data['order_no'] = $order_detection['detection_no'];
|
||||
$data['order_type'] = 3;
|
||||
|
||||
$message = new CancelUnpayOrdersDelayDirectProducer($data);
|
||||
$message->setDelayMs(1000 * 60 * 30);
|
||||
$producer = $this->container->get(Producer::class);
|
||||
$res = $producer->produce($message);
|
||||
if (!$res) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
}catch (\Exception $e){
|
||||
@@ -468,8 +465,15 @@ class DetectionService extends BaseService
|
||||
return success($result);
|
||||
}
|
||||
|
||||
// 取消未支付检测订单
|
||||
public function cancelUnpayDetectionOrder(string|int $order_no, string|int $cancel_reason, string|int $cancel_remarks){
|
||||
/**
|
||||
* 取消未支付检测订单
|
||||
* @param string|int $order_no 订单编号
|
||||
* @param string|int $cancel_reason 取消订单原因(1:主动取消 2:客服取消 3:支付超时)
|
||||
* @param string|int $cancel_remarks 取消备注
|
||||
* @return array
|
||||
*/
|
||||
public function cancelUnpayDetectionOrder(string|int $order_no, string|int $cancel_reason, string|int $cancel_remarks): array
|
||||
{
|
||||
$result = array();
|
||||
$result['status'] = 1;
|
||||
$result['message'] = "成功";
|
||||
|
||||
Reference in New Issue
Block a user