From a3befd977b516da53492b049b92bdaa06643b6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Sat, 7 Feb 2026 16:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E5=85=B3?= =?UTF-8?q?=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v1/controllers/ProductOrderController.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/member/modules/v1/controllers/ProductOrderController.php b/member/modules/v1/controllers/ProductOrderController.php index 2ded5f8..e1f6d13 100644 --- a/member/modules/v1/controllers/ProductOrderController.php +++ b/member/modules/v1/controllers/ProductOrderController.php @@ -181,12 +181,13 @@ class ProductOrderController extends BaseAppController // 获取处方来源诊所信息 $prescriptionStore = null; - if ($prescription && isset($prescription['store_id']) && $prescription['store_id']) { - $prescriptionStore = Store::find()->select('id,name,mobile,position')->where(['id' => $prescription['store_id']])->asArray()->one(); + if ($prescription && $prescription->store_id) { + $prescriptionStore = Store::find()->select('id,name,mobile,position')->where(['id' => $prescription->store_id])->asArray()->one(); } - if($prescription && $prescription['wr_ids']){ - $wr_ids = explode(',', $prescription['wr_ids']); + $count = 0; + if($prescription && $prescription->wr_ids){ + $wr_ids = explode(',', $prescription->wr_ids); if ($ProductOrder['prescription_type'] == 5) { $west = ServicePackageRepice::find()->select('content,number,total_price')->where([ 'in', 'id', $wr_ids @@ -200,8 +201,8 @@ class ProductOrderController extends BaseAppController $value['content']=Json::decode($value['content']); } $count = count($west); - }else if($prescription && $prescription['cr_ids']){ - $cr_ids = explode(',', $prescription['cr_ids']); + }else if($prescription && $prescription->cr_ids){ + $cr_ids = explode(',', $prescription->cr_ids); $chinese = ChineseRepice::find()->select('content,total_price')->where([ 'in', 'id', $cr_ids ])->all(); @@ -212,8 +213,8 @@ class ProductOrderController extends BaseAppController } } $count = count($chinese['list']); - }else{ - $gr_ids = explode(',', $prescription['gr_ids']); + }else if($prescription && $prescription->gr_ids){ + $gr_ids = explode(',', $prescription->gr_ids); $granular = GranularRepice::find()->select('content,total_price')->where([ 'in', 'id', $gr_ids ])->all(); @@ -226,7 +227,7 @@ class ProductOrderController extends BaseAppController $count = count($granular['list']); } if ($ProductOrder['p_id'] !== 0 && $ProductOrder['order_type'] !== 2) { - if ($prescription && isset($prescription['category']) && $prescription['category'] === 2) { + if ($prescription && $prescription->category === 2) { $ProductOrder['total_pay_price'] = $ProductOrder['trans_expenses']; $ProductOrder['items_price'] = 0; }