|
|
@@ -77,6 +77,18 @@ func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb |
|
|
|
return count, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDayByOrdNoV2(ordNo string, state int, startDate, endDate string, kindList []int) (count int64, err error) { |
|
|
|
var m model.CentralKitchenForSchoolUserWithDay |
|
|
|
sDate, _ := time.ParseInLocation("2006-01-02", startDate, time.Local) |
|
|
|
eDate, _ := time.ParseInLocation("2006-01-02", endDate, time.Local) |
|
|
|
|
|
|
|
count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("state !=?", state). |
|
|
|
And("date >= ?", sDate.Format("2006-01-02")).And("date <= ?", eDate.Format("2006-01-02")). |
|
|
|
In("kind", kindList). |
|
|
|
Count(&m) |
|
|
|
return count, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDayByOrdNoAndKind(ordNo string, kind, state int) (count int64, err error) { |
|
|
|
var m model.CentralKitchenForSchoolUserWithDay |
|
|
|
count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("kind =?", kind).And("state !=?", state).Count(&m) |
|
|
|