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 24c7fb4..dab3e02 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 @@ -947,9 +947,9 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIds, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1020,9 +1020,9 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIds, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1096,9 +1096,9 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIds, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1216,9 +1216,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1288,9 +1288,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1360,9 +1360,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByGrade(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1470,9 +1470,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForBreakfast, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1542,9 +1542,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForLunch, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil { @@ -1614,9 +1614,9 @@ func CentralKitchenForSchoolBatchAskForLeaveByClass(req md.CentralKitchenForScho } //2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 - sql := "update central_kitchen_for_school_user_with_day set state = %d where identity_id In (%s) and date = '%s' and kind = %d" + 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" idsStr := strings.Join(identityIdsV2, ",") - sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner) + sql = fmt.Sprintf(sql, enum2.CentralKitchenForSchoolUserWithDayStateForCanceling, idsStr, date, enum2.CentralKitchenForSchoolUserWithDayKindForDinner, enum2.CentralKitchenForSchoolUserWithDayStateForWait) fmt.Println(sql) _, err = db.ExecuteOriginalSql(db.Db, sql) if err != nil {