|
|
@@ -109,27 +109,27 @@ func NursingHomeOrdList(req md.NursingHomeOrdListReq) (resp []md.NursingHomeOrdL |
|
|
|
classWithUserDb := db.ClassWithUserDb{} |
|
|
|
classWithUserDb.Set() |
|
|
|
|
|
|
|
sess := db.Db.Desc("central_kitchen_for_school_package_ord.id") |
|
|
|
sess := db.Db.Desc("nursing_home_package_ord.id") |
|
|
|
if req.EnterpriseId != 0 { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.enterprise_id =?", req.EnterpriseId) |
|
|
|
sess.And("nursing_home_package_ord.enterprise_id =?", req.EnterpriseId) |
|
|
|
} |
|
|
|
if req.StartDate != "" { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.create_at >= ?", req.StartDate) |
|
|
|
sess.And("nursing_home_package_ord.create_at >= ?", req.StartDate) |
|
|
|
} |
|
|
|
if req.EndDate != "" { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.create_at <= ?", req.EndDate) |
|
|
|
sess.And("nursing_home_package_ord.create_at <= ?", req.EndDate) |
|
|
|
} |
|
|
|
if req.Kind != 0 { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.kind = ", req.Kind) |
|
|
|
sess.And("nursing_home_package_ord.kind = ", req.Kind) |
|
|
|
} |
|
|
|
if req.Sate != 0 { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.state = ", req.Sate) |
|
|
|
sess.And("nursing_home_package_ord.state = ", req.Sate) |
|
|
|
} |
|
|
|
if req.OrdSate != 0 { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.ord_state = ", req.OrdSate) |
|
|
|
sess.And("nursing_home_package_ord.ord_state = ", req.OrdSate) |
|
|
|
} |
|
|
|
if req.OutTradeNo != "" { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.out_trade_no like ?", "%"+req.OutTradeNo+"%") |
|
|
|
sess.And("nursing_home_package_ord.out_trade_no like ?", "%"+req.OutTradeNo+"%") |
|
|
|
} |
|
|
|
|
|
|
|
if req.Name != "" { |
|
|
@@ -148,7 +148,7 @@ func NursingHomeOrdList(req md.NursingHomeOrdListReq) (resp []md.NursingHomeOrdL |
|
|
|
|
|
|
|
var m []*db.NursingHomePackageOrdWithUserIdentity |
|
|
|
count, err = sess. |
|
|
|
Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). |
|
|
|
Join("LEFT", "user_identity", "nursing_home_package_ord.user_identity_id = user_identity.id"). |
|
|
|
Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). |
|
|
|
Join("LEFT", "user", "user.id = user_identity.uid"). |
|
|
|
Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) |
|
|
@@ -216,8 +216,8 @@ func NursingHomeReserveList(req md.NursingHomeReserveListReq) (resp []md.Nursing |
|
|
|
|
|
|
|
var m []*db.NursingHomePackageOrdForReserveWithUserIdentity |
|
|
|
count, err = sess. |
|
|
|
Join("LEFT", "central_kitchen_for_school_package_ord", "central_kitchen_for_school_package_ord_for_reserve.out_trade_no = central_kitchen_for_school_package_ord.out_trade_no"). |
|
|
|
Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord.user_identity_id = user_identity.id"). |
|
|
|
Join("LEFT", "nursing_home_package_ord", "nursing_home_package_ord_for_reserve.out_trade_no = nursing_home_package_ord.out_trade_no"). |
|
|
|
Join("LEFT", "user_identity", "nursing_home_package_ord.user_identity_id = user_identity.id"). |
|
|
|
Join("LEFT", "enterprise", "enterprise.id = user_identity.enterprise_id"). |
|
|
|
Join("LEFT", "user", "user.id = user_identity.uid"). |
|
|
|
Limit(req.Limit, (req.Page-1)*req.Limit).FindAndCount(&m) |
|
|
|