Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
90c866e89f
2 changed files with 12 additions and 1 deletions
  1. +6
    -1
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  2. +6
    -0
      app/db/db_central_kitchen_for_school_user_with_day.go

+ 6
- 1
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go View File

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

if count3 == count2 {
state = 4
stateZh = "已退款"
}


+ 6
- 0
app/db/db_central_kitchen_for_school_user_with_day.go View File

@@ -92,6 +92,12 @@ func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb
return count, nil
}

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

func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) FindCentralKitchenForSchoolUserWithDayByOrdNoAndState(ordNo string, state int) (*[]model.CentralKitchenForSchoolUserWithDay, error) {
var m []model.CentralKitchenForSchoolUserWithDay
if err := centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("state =?", state).Desc("id").Find(&m); err != nil {


||||||
x
 
000:0
Loading…
Cancel
Save