11
This commit is contained in:
parent
226b106997
commit
ffbc1c83c2
@ -210,7 +210,12 @@ func (r *OrderProductDao) GetOrderProductPageSearch(req requests.GetOrderProduct
|
||||
|
||||
// 处方编号
|
||||
if req.PrescriptionCode != "" {
|
||||
query = query.Where("prescription_code = ?", req.PrescriptionCode)
|
||||
// 处方编号存在于处方表中,这里通过处方表查询出对应的处方ID,再反查商品订单
|
||||
subQuery := global.Db.Model(&model.OrderPrescription{}).
|
||||
Select("order_prescription_id").
|
||||
Where("prescription_code = ?", req.PrescriptionCode)
|
||||
|
||||
query = query.Where("order_prescription_id IN (?)", subQuery)
|
||||
}
|
||||
|
||||
// 订单编号
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user