From b7b5252da5653f1cf381c2d4652d64ec94c99121 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 16 May 2024 12:11:13 +0800 Subject: [PATCH] update --- .../svc_central_kitchen_for_school.go | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go index 1d735fa..1adb72e 100644 --- a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go +++ b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go @@ -1622,7 +1622,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIds = append(identityIds, utils.IntToStr(m.IdentityId)) + identityIds = append(identityIds, utils.IntToStr(m.Id)) } if len(identityIds) <= 0 { //无请假学生 @@ -1631,10 +1631,10 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIds, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1705,7 +1705,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIds = append(identityIds, utils.IntToStr(m.IdentityId)) + identityIds = append(identityIds, utils.IntToStr(m.Id)) } if len(identityIds) <= 0 { //无请假学生 @@ -1714,10 +1714,10 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIds, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1788,7 +1788,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIds = append(identityIds, utils.IntToStr(m.IdentityId)) + identityIds = append(identityIds, utils.IntToStr(m.Id)) } if len(identityIds) <= 0 { //无请假学生 @@ -1797,10 +1797,10 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIds, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1915,7 +1915,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.IdentityId)) + identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.Id)) } if len(identityIdsV2) <= 0 { //无请假学生 @@ -1924,10 +1924,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIdsV2, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1998,7 +1998,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.IdentityId)) + identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.Id)) } if len(identityIdsV2) <= 0 { //无请假学生 @@ -2007,10 +2007,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIdsV2, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -2081,7 +2081,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.IdentityId)) + identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.Id)) } if len(identityIdsV2) <= 0 { //无请假学生 @@ -2090,10 +2090,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIdsV2, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -2197,7 +2197,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.IdentityId)) + identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.Id)) } if len(identityIdsV2) <= 0 { //无请假学生 @@ -2206,10 +2206,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIdsV2, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -2280,7 +2280,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.IdentityId)) + identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.Id)) } if len(identityIdsV2) <= 0 { //无请假学生 @@ -2289,10 +2289,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIdsV2, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state = %d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -2363,7 +2363,7 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho if m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCanceling || m.State == enum2.CentralKitchenForSchoolUserWithDayStateForCancel { continue } - identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.IdentityId)) + identityIdsV2 = append(identityIdsV2, utils.IntToStr(m.Id)) } if len(identityIdsV2) <= 0 { //无请假学生 @@ -2372,10 +2372,10 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 idsStr := strings.Join(identityIdsV2, ",") - //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d and state =%d" - //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + //sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + //sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + sql := "update central_kitchen_for_school_user_with_day set state = %d where id In (%s)" + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil {