From dc233b38db0d5a5ef6cfd10984cf000ff10621c3 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 11 Mar 2024 18:58:53 +0800 Subject: [PATCH] update --- .../hdl_central_kitchen_for_school.go | 10 ++++++ app/admin/hdl/hdl_demo.go | 36 +++++++++++++++++++ app/admin/md/md_enterprise_manage.go | 2 ++ .../svc_central_kitchen_for_school.go | 4 +++ 4 files changed, 52 insertions(+) diff --git a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go index b29a685..d9db8f2 100644 --- a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go +++ b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go @@ -860,6 +860,16 @@ func CentralKitchenForSchoolOrdList(c *gin.Context) { "value": "4", }, }, + "pay_way_list": []map[string]interface{}{ + { + "name": "支付宝", + "value": 1, + }, + { + "name": "微信", + "value": 2, + }, + }, "state_list": []map[string]interface{}{ { "name": enum.CentralKitchenForSchoolPackageOrdState.String(enum.CentralKitchenForSchoolPackageOrdStateForWait), diff --git a/app/admin/hdl/hdl_demo.go b/app/admin/hdl/hdl_demo.go index 7e655b1..0e5367f 100644 --- a/app/admin/hdl/hdl_demo.go +++ b/app/admin/hdl/hdl_demo.go @@ -22,6 +22,42 @@ import ( // Demo 测试 func Demo(c *gin.Context) { + var m []model.CentralKitchenForSchoolUserWithDay + eg := db.Db + if err1 := eg.Where("state = 3").Asc("id").Find(&m); err1 != nil { + e.OutErr(c, e.ERR, err1.Error()) + return + } + now := time.Now() + var records []int + for _, v := range m { + mm := new(model.CentralKitchenForSchoolUserRefundDay) + has, err := db.Db.Where("records_id =? and state = 1", v.Id).Get(mm) + if err != nil { + fmt.Println(err) + return + } + if has == false { + centralKitchenForSchoolUserRefundDayDb := db.CentralKitchenForSchoolUserRefundDayDb{} + centralKitchenForSchoolUserRefundDayDb.Set(0) + _, err = centralKitchenForSchoolUserRefundDayDb.CentralKitchenForSchoolUserRefundDayInsert(&model.CentralKitchenForSchoolUserRefundDay{ + OutTradeNo: v.OrdNo, + OutRequestNo: "", + Uid: v.Uid, + IdentityId: v.IdentityId, + RecordsId: v.Id, + State: enum.CentralKitchenForSchoolUserRefundDayStateForAuditing, + Amount: v.Amount, + Memo: "fill", + CreateAt: now.Format("2006-01-02 15:04:05"), + UpdateAt: now.Format("2006-01-02 15:04:05"), + }) + records = append(records, v.Id) + } + } + e.OutSuc(c, records, nil) + return + var req md.CentralKitchenForSchoolOrderRefundAuditReq err := c.ShouldBindJSON(&req) if err != nil { diff --git a/app/admin/md/md_enterprise_manage.go b/app/admin/md/md_enterprise_manage.go index ec883cf..dd0103c 100644 --- a/app/admin/md/md_enterprise_manage.go +++ b/app/admin/md/md_enterprise_manage.go @@ -231,6 +231,7 @@ type CentralKitchenForSchoolOrdListResp struct { TradeNo string `json:"trade_no"` State int `json:"state"` OrdState int `json:"ord_state"` + PayWay int `json:"pay_way"` CreateAt string `json:"create_at"` Phone string `json:"phone" label:"家长联系电话"` Name string `json:"name" label:"姓名"` @@ -251,6 +252,7 @@ type CentralKitchenForSchoolOrdListReq struct { EnterPriseKind int `json:"enterprise_kind" label:"校企类型"` Sate int `json:"state" label:"支付状态"` OrdSate int `json:"ord_state" label:"订单状态"` + PayWay int `json:"pay_way" label:"支付方式(1:支付宝 2:微信)"` GradeId int `json:"grade_id" label:"年级id"` ClassId int `json:"class_id" label:"班级id"` Phone string `json:"phone" label:"家长联系电话"` 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 ff0c4e7..f6a3f8d 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 @@ -656,6 +656,9 @@ func CentralKitchenForSchoolOrdList(req md.CentralKitchenForSchoolOrdListReq) (r if req.OrdSate != -1 { sess.And("central_kitchen_for_school_package_ord.ord_state = ?", req.OrdSate) } + if req.PayWay != 0 { + sess.And("central_kitchen_for_school_package_ord.pay_way = ?", req.PayWay) + } if req.OutTradeNo != "" { sess.And("central_kitchen_for_school_package_ord.out_trade_no like ?", "%"+req.OutTradeNo+"%") } @@ -715,6 +718,7 @@ func CentralKitchenForSchoolOrdList(req md.CentralKitchenForSchoolOrdListReq) (r TradeNo: v.CentralKitchenForSchoolPackageOrd.TradeNo, State: v.CentralKitchenForSchoolPackageOrd.State, OrdState: v.CentralKitchenForSchoolPackageOrd.OrdState, + PayWay: v.CentralKitchenForSchoolPackageOrd.PayWay, CreateAt: v.CentralKitchenForSchoolPackageOrd.CreateAt, Phone: v.User.Phone, Name: v.UserIdentity.Name,