This commit is contained in:
邹宗楠
2021-12-30 14:50:30 +08:00
parent 909494c44a
commit 0367c61d05
4 changed files with 8 additions and 7 deletions

View File

@@ -580,14 +580,11 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) {
storeOrder := &model.StoreAcctOrder{
VendorOrderID: orderPay.VendorOrderID,
}
Storebrand := &model.BrandOrder{
VendorOrderID: orderPay.VendorOrderID,
}
if err = dao.GetEntity(dao.GetDB(), storeOrder, "VendorOrderID"); err == nil && storeOrder.ID != 0 {
storeOrder.OrderFinishedAt = time.Now()
storeOrder.Status = model.OrderStatusFinished
if _, err = dao.UpdateEntity(dao.GetDB(), storeOrder, "OrderFinishedAt", "Status"); err == nil {
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, Storebrand.BrandID, storeOrder.ActualPayPrice, 1, 1, "")
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, storeOrder.BrandID, storeOrder.ActualPayPrice, 1, 1, "")
}
}
case model.PayTypeTL_BrandBillCharge:
@@ -2488,11 +2485,12 @@ func RefreshCouponsStatus(ctx *jxcontext.Context) (err error) {
return err
}
func CreateStoreAcctOrder(ctx *jxcontext.Context, orderType, storeID, price int, goodsVendorOrderID string) (vendorOrderID string, err error) {
func CreateStoreAcctOrder(ctx *jxcontext.Context, orderType, storeID, price int, goodsVendorOrderID string, brandID int) (vendorOrderID string, err error) {
var (
db = dao.GetDB()
storeAcct = &model.StoreAcct{
StoreID: storeID,
BrandID: brandID,
}
)
if err = dao.GetEntity(db, storeAcct, "StoreID"); err != nil && dao.IsNoRowsError(err) {
@@ -2505,6 +2503,7 @@ func CreateStoreAcctOrder(ctx *jxcontext.Context, orderType, storeID, price int,
VendorOrderID: utils.Int64ToStr(jxutils.GenOrderNo()),
UserID: ctx.GetUserID(),
StoreID: storeID,
BrandID: brandID,
OrderType: orderType,
Status: model.OrderStatusWait4Pay,
ActualPayPrice: price,