Commit 92d3794c by lujunyi

json自动转换

parent 635587a2
......@@ -133,7 +133,7 @@ public function create(Request $request)
$is_abnormal = 1; // 如果有一个answer是1,设置$is_abnormal为1
}
}
$prescription->inquiry_info = json_encode($inquiry_info);
$prescription->inquiry_info = $inquiry_info;
// 用药信息
$drug_info = [];
foreach ($drugs as $drug) {
......@@ -148,7 +148,7 @@ public function create(Request $request)
'num' => $drug['num'],
];
}
$prescription->drug_info = json_encode($drug_info);
$prescription->drug_info = $drug_info;
// 获取全局开方配置
$site_config = admin_setting_array('site_config');
......
......@@ -15,6 +15,12 @@ class PrescriptionModel extends Model
protected $table = 'prescription';
// 数组json相互转换
protected $casts = [
'drug_info' => 'array',
'inquiry_info' => 'array',
];
// 审方状态[0=待开方,1=待审方,2=审方成功]
const PRESCRIPTION_STATUS_PENDING = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment