关闭老系统的中药订单同步功能

This commit is contained in:
2025-08-29 09:15:16 +08:00
parent ec0f0a5b93
commit 788cfac9fe
2 changed files with 28 additions and 11 deletions

View File

@@ -17,6 +17,7 @@ use common\models\oldDb\ProductOrder;
use common\models\oldDb\Store;
use common\models\oldDb\SystemNotice;
use common\services\PrescriptionService;
use GuzzleHttp\Client;
use yii\base\Exception;
/**
@@ -175,18 +176,18 @@ class ExamineController extends BasePharmacistController
$form = new ProductRefundForm();
$form->refund(['user_id' =>$productOrder->user_id, 'order_id' => $productOrder->id], 'auto');
}
}else{
} else {
//中药处方订单同步江奥川erp
if($prescription->prescription_type == 1){
$productOrder = ProductOrder::find()->where(['p_id' => $prescription->id, 'status' => 1])->one();
if($productOrder){
//触发订单支付事件同步江奥川ERP
$event = new ProductOrderEvent();
$event->order = $productOrder;
$event->sender = $this;
\Yii::$app->trigger(ProductOrder::EVENT_PAYED, $event);
}
}
// if($prescription->prescription_type == 1){
// $productOrder = ProductOrder::find()->where(['p_id' => $prescription->id, 'status' => 1])->one();
// if($productOrder){
// //触发订单支付事件同步江奥川ERP
// $event = new ProductOrderEvent();
// $event->order = $productOrder;
// $event->sender = $this;
// \Yii::$app->trigger(ProductOrder::EVENT_PAYED, $event);
// }
// }
}
$systemNotice = new SystemNotice();