药品、处方列表关联药房信息
This commit is contained in:
@@ -132,6 +132,20 @@ func (r *OrderProductDao) GetOrderProductPageSearch(req requests.GetOrderProduct
|
||||
// 药品数据
|
||||
query = query.Preload("OrderProductItem")
|
||||
|
||||
// 药房数据
|
||||
query = query.Preload("Pharmacy")
|
||||
|
||||
// 药房筛选
|
||||
if req.PharmacyId != "" {
|
||||
query = query.Where("gdxz_order_product.pharmacy_id = ?", req.PharmacyId)
|
||||
}
|
||||
if req.PharmacyCode != "" {
|
||||
query = query.Where("gdxz_order_product.pharmacy_code LIKE ?", "%"+req.PharmacyCode+"%")
|
||||
}
|
||||
if req.PharmacyName != "" {
|
||||
query = query.Where("gdxz_order_product.pharmacy_name LIKE ?", "%"+req.PharmacyName+"%")
|
||||
}
|
||||
|
||||
// 医生
|
||||
query = query.Preload("UserDoctor", func(db *gorm.DB) *gorm.DB {
|
||||
return db.Omit("open_id", "union_id", "wx_session_key")
|
||||
@@ -463,8 +477,22 @@ func (r *OrderProductDao) GetOrderProductExportListSearch(req requests.OrderProd
|
||||
// 药品列表-药品
|
||||
query = query.Preload("OrderProductItem.Product")
|
||||
|
||||
// 药房数据
|
||||
query = query.Preload("Pharmacy")
|
||||
|
||||
// 当前搜索数据
|
||||
if req.Type == 1 {
|
||||
// 药房筛选
|
||||
if req.PharmacyId != "" {
|
||||
query = query.Where("gdxz_order_product.pharmacy_id = ?", req.PharmacyId)
|
||||
}
|
||||
if req.PharmacyCode != "" {
|
||||
query = query.Where("gdxz_order_product.pharmacy_code LIKE ?", "%"+req.PharmacyCode+"%")
|
||||
}
|
||||
if req.PharmacyName != "" {
|
||||
query = query.Where("gdxz_order_product.pharmacy_name LIKE ?", "%"+req.PharmacyName+"%")
|
||||
}
|
||||
|
||||
// 医生姓名 - 同时查询原医生和抄方医生
|
||||
if req.DoctorName != "" {
|
||||
// 原医生查询条件
|
||||
|
||||
Reference in New Issue
Block a user