Bläddra i källkod

update

add_mode
DengBiao 1 år sedan
förälder
incheckning
0b7fd0de86
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. +1
    -1
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  2. +4
    -2
      app/db/db_central_kitchen_for_school_user_with_day.go

+ 1
- 1
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go Visa fil

@@ -852,7 +852,7 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis
if count2 > 0 {
state = 3
stateZh = "部分退款"
count3, err3 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDay(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, v.CentralKitchenForSchoolPackageOrdForReserve.Kind)
count3, err3 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDay(v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeStart, v.CentralKitchenForSchoolPackageOrdForReserve.MealTimeEnd, v.CentralKitchenForSchoolPackageOrdForReserve.Kind)
if err1 != nil {
return nil, 0, err3
}


+ 4
- 2
app/db/db_central_kitchen_for_school_user_with_day.go Visa fil

@@ -97,9 +97,11 @@ func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb
return count, nil
}

func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDay(ordNo string, kind int) (count int64, err error) {
func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDay(ordNo, startDate, endDate string, kind int) (count int64, err error) {
var m model.CentralKitchenForSchoolUserWithDay
count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("kind =?", kind).Count(&m)
count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).
And("date >= ?", startDate).And("date <= ?", endDate).
And("kind =?", kind).Count(&m)
return count, nil
}



Laddar…
Avbryt
Spara