新增api通知处方生成功能

This commit is contained in:
2025-03-06 17:13:20 +08:00
parent cf169fb514
commit baac8cc73d

View File

@@ -231,19 +231,19 @@ class DataController extends BaseAdminController
['product_order', 'required'],
]);
$prescription = $param['prescription'];
$productOrder = $param['product_order'];
// $productOrder = $param['product_order'];
//触发处方自动失效事件
$prescriptionEvent = new PrescriptionEvent();
$prescriptionEvent->prescription = $prescription;
$prescriptionEvent->sender = $this;
\Yii::$app->trigger(Prescription::AUTO_EXPIRE, $prescriptionEvent);
//触发订单创建事件
$event = new ProductOrderEvent();
$event->order = $productOrder;
$event->sender = $this;
\Yii::$app->trigger(ProductOrder::EVENT_CREATED, $event);
// $prescriptionEvent = new PrescriptionEvent();
// $prescriptionEvent->prescription = $prescription;
// $prescriptionEvent->sender = $this;
// \Yii::$app->trigger(Prescription::AUTO_EXPIRE, $prescriptionEvent);
//
//
// //触发订单创建事件
// $event = new ProductOrderEvent();
// $event->order = $productOrder;
// $event->sender = $this;
// \Yii::$app->trigger(ProductOrder::EVENT_CREATED, $event);
//处方开具待支付订阅消息通知
\Yii::$app->queue->push(new PrescriptionCreated([