|
|
@@ -2045,28 +2045,29 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
if req.EnterpriseId != 0 { |
|
|
|
sess.And("central_kitchen_for_school_package_ord_for_reserve.enterprise_id =?", req.EnterpriseId) |
|
|
|
} |
|
|
|
var months []time.Month |
|
|
|
//var months []time.Month |
|
|
|
//if req.StartDate != "" { |
|
|
|
// sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) |
|
|
|
// eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", 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) |
|
|
|
// } |
|
|
|
// } |
|
|
|
//} |
|
|
|
//if len(months) > 0 { |
|
|
|
// sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months) |
|
|
|
//} |
|
|
|
if req.StartDate != "" { |
|
|
|
sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", req.StartDate, time.Local) |
|
|
|
eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", 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.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_end >= ?", req.StartDate) |
|
|
|
} |
|
|
|
if len(months) > 0 { |
|
|
|
sess.In("central_kitchen_for_school_package_ord_for_reserve.reserve_month", months) |
|
|
|
} |
|
|
|
//if req.EndDate != "" { |
|
|
|
// sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.EndDate) |
|
|
|
//} |
|
|
|
if len(req.MealKindList) > 0 { |
|
|
|
sess.In("central_kitchen_for_school_package_ord_for_reserve.kind", req.MealKindList) |
|
|
|
} |
|
|
|