Selaa lähdekoodia

update

add_mode
DengBiao 1 vuosi sitten
vanhempi
commit
f4a87840c7
2 muutettua tiedostoa jossa 8 lisäystä ja 3 poistoa
  1. +7
    -3
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  2. +1
    -0
      app/db/db_central_kitchen_for_school_package_ord_for_reserve.go

+ 7
- 3
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go Näytä tiedosto

@@ -738,15 +738,18 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis
}
}

sess := db.Db.Where("1=1").Desc("central_kitchen_for_school_package_ord_for_reserve.id")
sess := db.Db.
Where("central_kitchen_for_school_user_with_day.state = ?", enum2.CentralKitchenForSchoolUserWithDayStateForWait).
And("central_kitchen_for_school_user_with_day.state = ?", enum2.CentralKitchenForSchoolUserWithDayStateForAlready).
Desc("central_kitchen_for_school_package_ord_for_reserve.id")
if req.EnterpriseId != 0 {
sess.And("central_kitchen_for_school_package_ord_for_reserve.enterprise_id =?", req.EnterpriseId)
}
if req.StartDate != "" {
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ?", req.StartDate)
sess.And("central_kitchen_for_school_user_with_day.date >= ?", req.StartDate)
}
if req.EndDate != "" {
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.EndDate)
sess.And("central_kitchen_for_school_user_with_day.date <= ?", req.EndDate)
}
if req.Kind != 0 {
sess.And("central_kitchen_for_school_package_ord_for_reserve.kind = ?", req.Kind)
@@ -771,6 +774,7 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis
var m []*db.CentralKitchenForSchoolPackageOrdForReserveWithUserIdentity
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", "central_kitchen_for_school_user_with_day", "central_kitchen_for_school_user_with_day.ord_no = central_kitchen_for_school_package_ord_for_reserve.out_trade_no").
Join("LEFT", "user_identity", "central_kitchen_for_school_package_ord_for_reserve.user_identity_id = user_identity.id").
Join("LEFT", "enterprise", "enterprise.id = central_kitchen_for_school_package_ord_for_reserve.enterprise_id").
Join("LEFT", "user", "user.id = user_identity.uid").


+ 1
- 0
app/db/db_central_kitchen_for_school_package_ord_for_reserve.go Näytä tiedosto

@@ -96,6 +96,7 @@ func (centralKitchenForSchoolPackageOrdForReserveDb *CentralKitchenForSchoolPack
type CentralKitchenForSchoolPackageOrdForReserveWithUserIdentity struct {
model.CentralKitchenForSchoolPackageOrdForReserve `xorm:"extends"`
model.CentralKitchenForSchoolPackageOrd `xorm:"extends"`
model.CentralKitchenForSchoolUserWithDay `xorm:"extends"`
model.UserIdentity `xorm:"extends"`
model.Enterprise `xorm:"extends"`
model.User `xorm:"extends"`


Ladataan…
Peruuta
Tallenna