This commit is contained in:
2023-03-13 11:06:35 +08:00
parent 673dca88ca
commit 802a5081fb
5 changed files with 55 additions and 2 deletions
+19
View File
@@ -213,4 +213,23 @@ class OrderPrescription extends Model
return $data;
}
/**
* 单条
* 处方疾病表
* 处方商品表
* @param array $params
* @param array $fields
* @param int|null $page
* @param int|null $per_page
* @return object|null
*/
public static function getWithOne(array $params, array $fields = ["*"], int $page = null, ?int $per_page = 10): object|null
{
return self::with([
"UserDoctor:doctor_id,user_name,doctor_title",
"OrderPrescriptionIcd:prescription_icd_id,order_prescription_id,icd_name",
"OrderPrescriptionProduct:prescription_product_id,order_prescription_id,product_name,product_spec"
])
->where($params)->first($fields);
}
}