|
|
@@ -741,7 +741,7 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis |
|
|
|
var centralKitchenForSchoolUserWithDayIds []string |
|
|
|
if req.StartDate != "" && req.EndDate != "" { |
|
|
|
var m []model.CentralKitchenForSchoolUserWithDay |
|
|
|
if err1 := db.Db.In("state", []int{enum2.CentralKitchenForSchoolUserWithDayStateForWait, enum2.CentralKitchenForSchoolUserWithDayStateForAlready}). |
|
|
|
if err1 := db.Db.Where("state != ?", enum2.CentralKitchenForSchoolUserWithDayStateForCancel). |
|
|
|
And("date >= ? And date <= ?", req.StartDate, req.EndDate).Asc("date").Find(&m); err != nil { |
|
|
|
return nil, 0, err1 |
|
|
|
} |
|
|
@@ -811,22 +811,22 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis |
|
|
|
return nil, 0, err |
|
|
|
} |
|
|
|
|
|
|
|
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{} |
|
|
|
centralKitchenForSchoolUserWithDayDb.Set(0) |
|
|
|
//centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{} |
|
|
|
//centralKitchenForSchoolUserWithDayDb.Set(0) |
|
|
|
for _, v := range m { |
|
|
|
var kindList []int |
|
|
|
if req.Kind != 0 { |
|
|
|
kindList = append(kindList, req.Kind) |
|
|
|
} |
|
|
|
count1, err1 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2( |
|
|
|
v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForCancel, |
|
|
|
req.StartDate, req.EndDate, kindList) |
|
|
|
if err1 != nil { |
|
|
|
return nil, 0, err1 |
|
|
|
} |
|
|
|
if count1 == 0 { |
|
|
|
continue |
|
|
|
} |
|
|
|
//var kindList []int |
|
|
|
//if req.Kind != 0 { |
|
|
|
// kindList = append(kindList, req.Kind) |
|
|
|
//} |
|
|
|
//count1, err1 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNoV2( |
|
|
|
// v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForCancel, |
|
|
|
// req.StartDate, req.EndDate, kindList) |
|
|
|
//if err1 != nil { |
|
|
|
// return nil, 0, err1 |
|
|
|
//} |
|
|
|
//if count1 == 0 { |
|
|
|
// continue |
|
|
|
//} |
|
|
|
|
|
|
|
resp = append(resp, md.CentralKitchenForSchoolReserveListResp{ |
|
|
|
Id: v.CentralKitchenForSchoolPackageOrdForReserve.Id, |
|
|
|