Parcourir la source

update

add_mode
DengBiao il y a 1 an
Parent
révision
0b7fd0de86
2 fichiers modifiés avec 5 ajouts et 3 suppressions
  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 Voir le fichier

@@ -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 Voir le fichier

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



Chargement…
Annuler
Enregistrer