Переглянути джерело

Merge branch 'master' into tmp

tmp
dengbiao 4 місяці тому
джерело
коміт
51f1a50ebc
1 змінених файлів з 23 додано та 19 видалено
  1. +23
    -19
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go

+ 23
- 19
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go Переглянути файл

@@ -1189,22 +1189,22 @@ func CentralKitchenForSchoolReserveList(c *gin.Context, req md.CentralKitchenFor
// }
//}

var months []time.Month
if req.StartDate != "" {
sDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local)
eDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local)
_, sMonth, _ := sDate.Date()
_, eMonth, _ := eDate.Date()
diffMonth := sMonth - eMonth
if diffMonth == 0 {
//TODO::查询一个月
months = append(months, sMonth)
} else {
for i := sMonth; i <= eMonth; i++ {
months = append(months, i)
}
}
}
//var months []time.Month
//if req.StartDate != "" {
// sDate, _ := time.ParseInLocation("2006-01-02", req.StartDate, time.Local)
// eDate, _ := time.ParseInLocation("2006-01-02", req.EndDate, time.Local)
// _, sMonth, _ := sDate.Date()
// _, eMonth, _ := eDate.Date()
// diffMonth := sMonth - eMonth
// if diffMonth == 0 {
// //TODO::查询一个月
// months = append(months, sMonth)
// } else {
// for i := sMonth; i <= eMonth; i++ {
// months = append(months, i)
// }
// }
//}

sess := db.Db.Desc("central_kitchen_for_school_package_ord_for_reserve.id")
admin := svc.GetUser(c)
@@ -1237,6 +1237,10 @@ func CentralKitchenForSchoolReserveList(c *gin.Context, req md.CentralKitchenFor
if req.Name != "" {
sess.And("user_identity.name like ?", "%"+req.Name+"%")
}
if req.StartDate != "" {
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ?", req.StartDate).
And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.StartDate)
}
if req.Phone != "" {
if req.Phone != "" {
userDb := db.UserDb{}
@@ -1262,9 +1266,9 @@ func CentralKitchenForSchoolReserveList(c *gin.Context, req md.CentralKitchenFor
//if len(centralKitchenForSchoolUserWithDayIds) > 0 {
// sess.In("central_kitchen_for_school_package_ord.out_trade_no", centralKitchenForSchoolUserWithDayIds)
//}
if len(months) > 0 {
sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months)
}
//if len(months) > 0 {
// sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months)
//}
if req.EnterPriseKind != 0 {
sess.And("enterprise.kind = ?", req.EnterPriseKind)
}


Завантаження…
Відмінити
Зберегти