瀏覽代碼

update

add_mode
DengBiao 1 年之前
父節點
當前提交
836006b725
共有 2 個文件被更改,包括 21 次插入9 次删除
  1. +9
    -9
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  2. +12
    -0
      app/db/db_central_kitchen_for_school_user_with_day.go

+ 9
- 9
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go 查看文件

@@ -814,15 +814,15 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
for _, v := range m {
//count1, err1 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNo(
// v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForCancel,
// req.StartDate, req.EndDate, []int{req.Kind})
//if err1 != nil {
// return nil, 0, err1
//}
//if count1 == 0 {
// continue
//}
count1, err1 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNo(
v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum2.CentralKitchenForSchoolUserWithDayStateForCancel,
req.StartDate, req.EndDate, []int{req.Kind})
if err1 != nil {
return nil, 0, err1
}
if count1 == 0 {
continue
}

resp = append(resp, md.CentralKitchenForSchoolReserveListResp{
Id: v.CentralKitchenForSchoolPackageOrdForReserve.Id,


+ 12
- 0
app/db/db_central_kitchen_for_school_user_with_day.go 查看文件

@@ -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)


Loading…
取消
儲存