Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
ef27202f6d
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      app/customer/svc/order/svc_central_kitchen_for_school_order.go
  2. +2
    -2
      app/db/db_central_kitchen_for_school_user_with_day.go

+ 2
- 1
app/customer/svc/order/svc_central_kitchen_for_school_order.go View File

@@ -166,7 +166,8 @@ func CentralKitchenForSchoolMyReserve(userIdentityId int, date, startDate, endDa
//1、查询出对应时间段,所有 "待就餐"、 "已就餐" 记录
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(userIdentityId)
list, err := centralKitchenForSchoolUserWithDayDb.FindCentralKitchenForSchoolUserWithDayByDate(startDate, endDate)
var states = []int{enum.CentralKitchenForSchoolUserWithDayStateForWait, enum.CentralKitchenForSchoolUserWithDayStateForAlready}
list, err := centralKitchenForSchoolUserWithDayDb.FindCentralKitchenForSchoolUserWithDayByDate(startDate, endDate, states)
if err != nil {
return
}


+ 2
- 2
app/db/db_central_kitchen_for_school_user_with_day.go View File

@@ -29,9 +29,9 @@ func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb
return m, nil
}

func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) FindCentralKitchenForSchoolUserWithDayByDate(sDate, eDate string) (*[]model.CentralKitchenForSchoolUserWithDay, error) {
func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) FindCentralKitchenForSchoolUserWithDayByDate(sDate, eDate string, states []int) (*[]model.CentralKitchenForSchoolUserWithDay, error) {
var m []model.CentralKitchenForSchoolUserWithDay
if err := centralKitchenForSchoolUserWithDayDb.Db.Where("identity_id =?", centralKitchenForSchoolUserWithDayDb.IdentityId).
if err := centralKitchenForSchoolUserWithDayDb.Db.Where("identity_id =?", centralKitchenForSchoolUserWithDayDb.IdentityId).In("state", states).
And("date >= ? And date <= ?", sDate, eDate).Asc("date").Find(&m); err != nil {
return nil, logx.Error(err)
}


Loading…
Cancel
Save