Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
34ae9c99b5
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go

+ 11
- 5
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go View File

@@ -6,6 +6,7 @@ import (
"applet/app/db/model" "applet/app/db/model"
enum2 "applet/app/enum" enum2 "applet/app/enum"
"applet/app/utils" "applet/app/utils"
"applet/app/utils/logx"
"errors" "errors"
"fmt" "fmt"
"strings" "strings"
@@ -920,6 +921,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch
if enterprise == nil { if enterprise == nil {
return errors.New("未查询到id:【" + utils.IntToStr(v) + "】公司对应记录") return errors.New("未查询到id:【" + utils.IntToStr(v) + "】公司对应记录")
} }

for _, date := range req.Dates { for _, date := range req.Dates {
//2、查询出所有 `central_kitchen_for_school_user_with_day` 记录 //2、查询出所有 `central_kitchen_for_school_user_with_day` 记录
var mm []model.CentralKitchenForSchoolUserWithDay var mm []model.CentralKitchenForSchoolUserWithDay
@@ -1002,6 +1004,7 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch
for _, m := range mm { for _, m := range mm {
identityIds = append(identityIds, utils.IntToStr(m.Id)) identityIds = append(identityIds, utils.IntToStr(m.Id))
} }

//2、更改 `central_kitchen_for_school_user_with_day` 的 state 为 退款中 //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"
idsStr := strings.Join(identityIds, ",") idsStr := strings.Join(identityIds, ",")
@@ -1035,12 +1038,15 @@ func CentralKitchenForSchoolBatchAskForLeaveBySchool(req md.CentralKitchenForSch
} }


//4、处理 `central_kitchen_for_school_package_ord` 的 订单状态 (ord_state) //4、处理 `central_kitchen_for_school_package_ord` 的 订单状态 (ord_state)
for _, vv := range dealOutTradeNo {
err1 := JudgePackageOrdOrdState(vv)
if err1 != nil {
return err1
go func() {
for _, vv := range dealOutTradeNo {
err2 := JudgePackageOrdOrdState(vv)
if err2 != nil {
logx.Error(err2)
println("<<<<JudgePackageOrdOrdState>>>>>Error:::", err2.Error())
}
} }
}
}()


//5、新增 `central_kitchen_for_school_user_refund_day` 数据 //5、新增 `central_kitchen_for_school_user_refund_day` 数据
centralKitchenForSchoolUserRefundDayDb := db.CentralKitchenForSchoolUserRefundDayDb{} centralKitchenForSchoolUserRefundDayDb := db.CentralKitchenForSchoolUserRefundDayDb{}


Loading…
Cancel
Save