1. 处方详情
This commit is contained in:
@@ -10,6 +10,7 @@ use common\forms\ProductRefundForm;
|
||||
use common\jobs\ProductOrderSyncPlatformJob;
|
||||
use common\models\oldDb\Address;
|
||||
use common\models\oldDb\ChineseRepice;
|
||||
use common\models\oldDb\Drug;
|
||||
use common\models\oldDb\DoctorInfo;
|
||||
use common\models\oldDb\GranularRepice;
|
||||
use common\models\oldDb\Prescription;
|
||||
@@ -198,7 +199,13 @@ class ProductOrderController extends BaseAppController
|
||||
])->all();
|
||||
}
|
||||
foreach ($west as $value) {
|
||||
$value['content']=Json::decode($value['content']);
|
||||
$value['content'] = Json::decode($value['content']);
|
||||
if (is_array($value['content']) && !empty($value['content']['id']) && empty($value['content']['instruction'])) {
|
||||
$drugInstruction = Drug::find()->select('instruction')->where(['id' => $value['content']['id']])->scalar();
|
||||
if ($drugInstruction) {
|
||||
$value['content']['instruction'] = $drugInstruction;
|
||||
}
|
||||
}
|
||||
}
|
||||
$count = count($west);
|
||||
}else if($prescription && $prescription->cr_ids){
|
||||
@@ -399,7 +406,7 @@ class ProductOrderController extends BaseAppController
|
||||
$this->requestValidate($post, [
|
||||
['order_id', 'required']
|
||||
]);
|
||||
$ProductOrder = ProductOrder::find()->select('id,is_online,order_no,delivery_method,su_id,p_id,user_id,is_pay,prescription_type,address_id,address,decoct_price,items_price,process_price,treatement_price,total_pay_price,pay_method,trans_expenses,created_at,cancel_status,refund_status,status,pay_time')->where([
|
||||
$ProductOrder = ProductOrder::find()->select('id,store_id,is_online,order_no,delivery_method,su_id,p_id,user_id,is_pay,prescription_type,address_id,address,decoct_price,items_price,process_price,treatement_price,total_pay_price,pay_method,trans_expenses,created_at,cancel_status,refund_status,status,pay_time')->where([
|
||||
'id' => $post['order_id'],
|
||||
'user_id' => \Yii::$app->user->identity->getId(),
|
||||
// 'store_id' => $post['store_id']
|
||||
@@ -431,7 +438,7 @@ class ProductOrderController extends BaseAppController
|
||||
$h->select('name');
|
||||
}])->asArray()->one();
|
||||
$ProductOrderItems = ProductOrderItems::find()->where(['product_order_id' => $ProductOrder['id']])->with(['drug' => function($q){
|
||||
$q->select('id,drug_name,function,specification,usage,instruction');
|
||||
$q->select('id,drug_name,is_otc,type,function,specification,usage,instruction');
|
||||
}])->asArray()->all();
|
||||
$ProductOrder['count'] = count($ProductOrderItems);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user