支付回调信息修复
This commit is contained in:
@@ -275,59 +275,78 @@ class ProductOrderSubmitForm extends BaseModel
|
||||
return true;
|
||||
}
|
||||
|
||||
if($ProductOrder->is_online != 1){
|
||||
$Prescription = $ProductOrder->prescription;
|
||||
$Prescription->is_pay = 1;
|
||||
$Prescription->pay_time = time();
|
||||
$Prescription->saveOrFail();
|
||||
if ($ProductOrder->order_type === 2) {
|
||||
|
||||
//中药处方订单同步江奥川erp
|
||||
if($Prescription->prescription_type == 1 && $Prescription->status== 1){
|
||||
//触发订单支付事件,同步江奥川ERP
|
||||
$event = new ProductOrderEvent();
|
||||
$event->order = $ProductOrder;
|
||||
$event->sender = $this;
|
||||
\Yii::$app->trigger(ProductOrder::EVENT_PAYED, $event);
|
||||
$ProductOrder->is_pay = 1;
|
||||
$ProductOrder->status = ProductOrderEnum::WAIT_SEND;
|
||||
$ProductOrder->pay_time = time();
|
||||
$ProductOrder->type = isset($data['pay_type']) ? $data['pay_type'] : 0;
|
||||
$ProductOrder->saveOrFail();
|
||||
|
||||
$paymentProduct_Order->transaction_id = $transaction_id;
|
||||
$paymentProduct_Order->is_pay = 1;
|
||||
$paymentProduct_Order->pay_type = $ProductOrder->type;
|
||||
$paymentProduct_Order->saveOrFail();
|
||||
// 订单支付进行分账
|
||||
\Yii::$app->queue->delay(0)->push(new ProductOrderPaidJob([
|
||||
'orderId' => $ProductOrder->id,
|
||||
]));
|
||||
} else {
|
||||
if($ProductOrder->is_online != 1){
|
||||
$Prescription = $ProductOrder->prescription;
|
||||
$Prescription->is_pay = 1;
|
||||
$Prescription->pay_time = time();
|
||||
$Prescription->saveOrFail();
|
||||
|
||||
//中药处方订单同步江奥川erp
|
||||
if($Prescription->prescription_type == 1 && $Prescription->status== 1){
|
||||
//触发订单支付事件,同步江奥川ERP
|
||||
$event = new ProductOrderEvent();
|
||||
$event->order = $ProductOrder;
|
||||
$event->sender = $this;
|
||||
\Yii::$app->trigger(ProductOrder::EVENT_PAYED, $event);
|
||||
}
|
||||
}
|
||||
|
||||
$ProductOrder->is_pay = 1;
|
||||
$ProductOrder->status = ProductOrderEnum::WAIT_SEND;
|
||||
$ProductOrder->pay_time = time();
|
||||
$ProductOrder->type = isset($data['pay_type']) ? $data['pay_type'] : 0;
|
||||
$ProductOrder->saveOrFail();
|
||||
|
||||
$paymentProduct_Order->transaction_id = $transaction_id;
|
||||
$paymentProduct_Order->is_pay = 1;
|
||||
$paymentProduct_Order->pay_type = $ProductOrder->type;
|
||||
$paymentProduct_Order->saveOrFail();
|
||||
|
||||
// 订单支付进行分账
|
||||
\Yii::$app->queue->delay(0)->push(new ProductOrderPaidJob([
|
||||
'orderId' => $ProductOrder->id,
|
||||
]));
|
||||
|
||||
if($ProductOrder->order_type ==1 && $ProductOrder->p_id){//线下挂号处方订单
|
||||
$prescription = Prescription::find()->where(['id' => $ProductOrder->p_id])->one();
|
||||
//发送处方已支付通知
|
||||
$systemNotice = new SystemNotice();
|
||||
$systemNotice->data = $prescription->id;
|
||||
$systemNotice->store_id = $prescription->store_id;
|
||||
$systemNotice->content = '您开具的处方,编号:'.$prescription->prescription_no.' 患者已取药!';
|
||||
$systemNotice->base_type = 4;//处方通知
|
||||
$systemNotice->scene_type = 2;
|
||||
$systemNotice->user_id = $prescription->user_id;
|
||||
$systemNotice->notice_at = date('Y-m-d H:i:s',time());
|
||||
$systemNotice->saveOrFail();
|
||||
}
|
||||
|
||||
|
||||
if($ProductOrder->is_online){ //平台订单状态同步
|
||||
\Yii::$app->queue->delay(0)->push(new ProductOrderSyncPlatformJob([
|
||||
'orderId' => $ProductOrder->id,
|
||||
'status' => 1
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
$ProductOrder->is_pay = 1;
|
||||
$ProductOrder->status = ProductOrderEnum::WAIT_SEND;
|
||||
$ProductOrder->pay_time = time();
|
||||
$ProductOrder->type = isset($data['pay_type']) ? $data['pay_type'] : 0;
|
||||
$ProductOrder->saveOrFail();
|
||||
|
||||
$paymentProduct_Order->transaction_id = $transaction_id;
|
||||
$paymentProduct_Order->is_pay = 1;
|
||||
$paymentProduct_Order->pay_type = $ProductOrder->type;
|
||||
$paymentProduct_Order->saveOrFail();
|
||||
|
||||
// 订单支付进行分账
|
||||
\Yii::$app->queue->delay(0)->push(new ProductOrderPaidJob([
|
||||
'orderId' => $ProductOrder->id,
|
||||
]));
|
||||
|
||||
if($ProductOrder->order_type ==1 && $ProductOrder->p_id){//线下挂号处方订单
|
||||
$prescription = Prescription::find()->where(['id' => $ProductOrder->p_id])->one();
|
||||
//发送处方已支付通知
|
||||
$systemNotice = new SystemNotice();
|
||||
$systemNotice->data = $prescription->id;
|
||||
$systemNotice->store_id = $prescription->store_id;
|
||||
$systemNotice->content = '您开具的处方,编号:'.$prescription->prescription_no.' 患者已取药!';
|
||||
$systemNotice->base_type = 4;//处方通知
|
||||
$systemNotice->scene_type = 2;
|
||||
$systemNotice->user_id = $prescription->user_id;
|
||||
$systemNotice->notice_at = date('Y-m-d H:i:s',time());
|
||||
$systemNotice->saveOrFail();
|
||||
}
|
||||
|
||||
|
||||
if($ProductOrder->is_online){ //平台订单状态同步
|
||||
\Yii::$app->queue->delay(0)->push(new ProductOrderSyncPlatformJob([
|
||||
'orderId' => $ProductOrder->id,
|
||||
'status' => 1
|
||||
]));
|
||||
}
|
||||
$t->commit();
|
||||
} catch (\Exception $e) {
|
||||
$t->rollBack();
|
||||
|
||||
Reference in New Issue
Block a user