Ver código fonte

update

add_mode
DengBiao 1 ano atrás
pai
commit
b837ff85f3
1 arquivos alterados com 27 adições e 9 exclusões
  1. +27
    -9
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go

+ 27
- 9
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go Ver arquivo

@@ -978,10 +978,10 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch

for _, date := range req.Dates {
//2、查询出所有 `central_kitchen_for_school_user_with_day` 记录
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
if req.IsBreakfast == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.Where("enterprise_id =?", v).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast).Find(&mm)
if err != nil {
@@ -1054,6 +1054,9 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch
}

if req.IsLunch == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.Where("enterprise_id =?", v).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForLunch).Find(&mm)
if err != nil {
@@ -1130,6 +1133,9 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch
}

if req.IsDinner == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.Where("enterprise_id =?", v).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForDinner).Find(&mm)
if err != nil {
@@ -1246,10 +1252,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho
}
for _, date := range req.Dates {
//2、查询出所有 `central_kitchen_for_school_user_with_day` 记录
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
if req.IsBreakfast == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.In("identity_id", identityIds).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast).Find(&mm)
if err != nil {
@@ -1323,6 +1329,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho
}

if req.IsLunch == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.In("identity_id", identityIds).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForLunch).Find(&mm)
if err != nil {
@@ -1395,6 +1404,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho
}

if req.IsDinner == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.In("identity_id", identityIds).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForDinner).Find(&mm)
if err != nil {
@@ -1501,10 +1513,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho

for _, date := range req.Dates {
//2、查询出所有 `central_kitchen_for_school_user_with_day` 记录
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
if req.IsBreakfast == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.In("identity_id", identityIds).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast).Find(&mm)
if err != nil {
@@ -1577,6 +1589,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho
}

if req.IsLunch == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.In("identity_id", identityIds).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForLunch).Find(&mm)
if err != nil {
@@ -1649,6 +1664,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho
}

if req.IsDinner == 1 {
var mm []model.CentralKitchenForSchoolUserWithDay
centralKitchenForSchoolUserWithDayDb := db.CentralKitchenForSchoolUserWithDayDb{}
centralKitchenForSchoolUserWithDayDb.Set(0)
err = centralKitchenForSchoolUserWithDayDb.Db.In("identity_id", identityIds).And("date =?", date).
And("kind =?", enum2.CentralKitchenForSchoolUserWithDayKindForDinner).Find(&mm)
if err != nil {


Carregando…
Cancelar
Salvar