From 2b95381e881a556a9be9a9a21a53366a25864cd1 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 10 Jul 2024 16:38:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/model/ord_list.go | 1 + app/md/order.go | 1 + app/svc/svc_order_track_save_create.go | 1 + app/svc/svc_order_track_save_create_update.go | 1 + app/svc/svc_order_track_save_update.go | 5 +++++ 5 files changed, 9 insertions(+) diff --git a/app/db/model/ord_list.go b/app/db/model/ord_list.go index 27a22e8..1f7f645 100644 --- a/app/db/model/ord_list.go +++ b/app/db/model/ord_list.go @@ -33,6 +33,7 @@ type OrdList struct { CreateAt int `xorm:"not null default 0 INT(10)" json:"create_at"` UpdateAt int `xorm:"not null default 0 INT(11)" json:"update_at"` ConfirmAt int `xorm:"not null default 0 INT(10)" json:"confirm_at"` + WaitSettleAt int `xorm:"not null default 0 INT(10)" json:"wait_settle_at"` CheckSuccessAt int `xorm:"not null default 0 INT(10)" json:"check_success_at"` PvdSettleAt int `xorm:"not null default 0 INT(10)" json:"pvd_settle_at"` SettleAt int `xorm:"not null default 0 INT(10)" json:"settle_at"` diff --git a/app/md/order.go b/app/md/order.go index c303d7f..d7a0b75 100644 --- a/app/md/order.go +++ b/app/md/order.go @@ -141,6 +141,7 @@ type UserPid struct { } type OrderInfo struct { + WaitSettleAt int64 // 结束时间 TaskType string UnionId string Oid int64 diff --git a/app/svc/svc_order_track_save_create.go b/app/svc/svc_order_track_save_create.go index 18e445f..87bbfea 100644 --- a/app/svc/svc_order_track_save_create.go +++ b/app/svc/svc_order_track_save_create.go @@ -590,6 +590,7 @@ func OrderSaveCreate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts ConfirmAt: 0, PvdSettleAt: 0, SettleAt: 0, + WaitSettleAt: int(v.WaitSettleAt), BenefitList: SerializeLvUser(CalcLvUserFee(lvUser)), BenefitAll: allCommission, Data: "", diff --git a/app/svc/svc_order_track_save_create_update.go b/app/svc/svc_order_track_save_create_update.go index 6e13e43..564d539 100644 --- a/app/svc/svc_order_track_save_create_update.go +++ b/app/svc/svc_order_track_save_create_update.go @@ -878,6 +878,7 @@ func OrderSaveCreateUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, } // 插入新订单 newOrd := &model.OrdList{ + WaitSettleAt: int(v.WaitSettleAt), NumItemId: v.SkuId, TaskType: v.TaskType, OrderFormType: orderFormType, diff --git a/app/svc/svc_order_track_save_update.go b/app/svc/svc_order_track_save_update.go index bea67fd..bf03407 100644 --- a/app/svc/svc_order_track_save_update.go +++ b/app/svc/svc_order_track_save_update.go @@ -160,6 +160,7 @@ func OrderSaveUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts _ = db.DbsOrderUpdate(eg, v.OrdId, &v) } } + if int(ords[v.PvdOid].ConfirmAt) > 0 && v.ConfirmAt != int(ords[v.PvdOid].ConfirmAt) { v.ConfirmAt = int(ords[v.PvdOid].ConfirmAt) _ = db.DbsOrderUpdate(eg, v.OrdId, &v) @@ -389,6 +390,10 @@ func OrderSaveUpdate(eg *xorm.Engine, pvd string, ordData *[]md.OrderInfo, opts } if v.State != 4 && ords[v.PvdOid].State != 4 { AcquisitionHookFirstOrder(eg, dbName, &v) + if v.WaitSettleAt == 0 && v.State != 4 { + v.WaitSettleAt = int(ords[v.PvdOid].WaitSettleAt) + _ = db.DbsOrderUpdate(eg, v.OrdId, &v) + } } if v.State == 4 && (v.Pvd == md.PVD_JD || v.Pvd == md.PVD_JDOwn) && ords[v.PvdOid].State != 4 { v.State = ords[v.PvdOid].State