差评退款
This commit is contained in:
@@ -752,7 +752,7 @@ func RefreshOrdersWithoutJxStoreID(ctx *jxcontext.Context, fromDate, toDate stri
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func GetOrdersSupplement(ctx *jxcontext.Context, storIDs, vendorIDs []int, vendorOrderID, fromTime, toTime string, status, stype, IsReverse, offset, pageSize int) (pageInfo *model.PagedInfo, err error) {
|
||||
func GetOrdersSupplement(ctx *jxcontext.Context, storIDs, vendorIDs, statuss []int, vendorOrderID, fromTime, toTime string, stype, IsReverse, offset, pageSize int) (pageInfo *model.PagedInfo, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
fromTimeP time.Time
|
||||
@@ -767,7 +767,7 @@ func GetOrdersSupplement(ctx *jxcontext.Context, storIDs, vendorIDs []int, vendo
|
||||
if fromTimeP.After(toTimeP) {
|
||||
return nil, fmt.Errorf("时间范围不合法!开始时间:[%v],结束时间:[%v]", fromTimeP, toTimeP)
|
||||
}
|
||||
result, totalCount, err := dao.GetOrdersSupplement(db, storIDs, vendorIDs, vendorOrderID, fromTimeP, toTimeP, status, stype, IsReverse, offset, pageSize)
|
||||
result, totalCount, err := dao.GetOrdersSupplement(db, storIDs, vendorIDs, statuss, vendorOrderID, fromTimeP, toTimeP, stype, IsReverse, offset, pageSize)
|
||||
pageInfo = &model.PagedInfo{
|
||||
Data: result,
|
||||
TotalCount: totalCount,
|
||||
@@ -781,6 +781,9 @@ func AddUpdateOrdersSupplement(ctx *jxcontext.Context, ordersSupplement *model.O
|
||||
id = ordersSupplement.ID
|
||||
)
|
||||
now := time.Now()
|
||||
if *ordersSupplement.VendorID == -1 {
|
||||
ordersSupplement.VendorID = nil
|
||||
}
|
||||
ordersSupplement.SupplementTime = &now
|
||||
defer func() {
|
||||
if r := recover(); r != nil || err != nil {
|
||||
@@ -791,11 +794,16 @@ func AddUpdateOrdersSupplement(ctx *jxcontext.Context, ordersSupplement *model.O
|
||||
}
|
||||
}()
|
||||
if id > 0 {
|
||||
if ordersSupplement.Status == 1 {
|
||||
return 0, fmt.Errorf("已结账的扣款信息不允许修改!门店ID:[%v],订单号:[%v]", ordersSupplement.StoreID, ordersSupplement.VendorOrderID)
|
||||
orderSupplementFee, _ := dao.GetOrdersSupplementNoPage(db, id, nil, nil, nil, "", utils.ZeroTimeValue, utils.ZeroTimeValue, 0, 0)
|
||||
if len(orderSupplementFee) > 2 || len(orderSupplementFee) == 0 {
|
||||
return 0, fmt.Errorf("查询扣款记录有误,请联系技术部!")
|
||||
}
|
||||
if orderSupplementFee[0].Status == 1 {
|
||||
return 0, fmt.Errorf("已结账的扣款信息不允许修改!门店ID:[%v],订单号:[%v]", ordersSupplement.StoreID, *ordersSupplement.VendorOrderID)
|
||||
}
|
||||
ordersSupplement.UpdatedAt = time.Now()
|
||||
ordersSupplement.LastOperator = ctx.GetUserName()
|
||||
ordersSupplement.CreatedAt = orderSupplementFee[0].CreatedAt
|
||||
if ordersSupplement.Status == -1 {
|
||||
ordersSupplement.DeletedAt = time.Now()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user