差评补款
This commit is contained in:
@@ -746,3 +746,39 @@ 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, offset, pageSize int) (pageInfo *model.PagedInfo, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
fromTimeP time.Time
|
||||
toTimeP time.Time
|
||||
)
|
||||
if fromTime != "" {
|
||||
fromTimeP = utils.Str2Time(fromTime)
|
||||
}
|
||||
if toTime != "" {
|
||||
toTimeP = utils.Str2Time(toTime)
|
||||
}
|
||||
result, totalCount, err := dao.GetOrdersSupplement(db, storIDs, vendorIDs, vendorOrderID, fromTimeP, toTimeP, status, stype, offset, pageSize)
|
||||
pageInfo = &model.PagedInfo{
|
||||
Data: result,
|
||||
TotalCount: totalCount,
|
||||
}
|
||||
return pageInfo, err
|
||||
}
|
||||
|
||||
func AddUpdateOrdersSupplement(ctx *jxcontext.Context, ordersSupplement *model.OrderSupplementFee) (num int, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
id = ordersSupplement.ID
|
||||
)
|
||||
if id > 0 {
|
||||
if ordersSupplement.Status == 1 {
|
||||
return 0,fmt.Errorf("已结账的扣款信息不允许修改", a)
|
||||
}
|
||||
dao.UpdateEntity(db, ordersSupplement)
|
||||
} else {
|
||||
|
||||
}
|
||||
return num, err
|
||||
}
|
||||
|
||||
@@ -345,7 +345,22 @@ type OrderPayRefund struct {
|
||||
|
||||
type OrderSupplementFee struct {
|
||||
ModelIDCULD
|
||||
VendorOrderID string `orm:"column(vendor_order_id);index;size(48)" json:"vendorOrderID"`
|
||||
StoreID int `orm:"column(store_id)" json:"storeID"`
|
||||
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
Status int `json:"status"` //账单状态,若已结账则不允许再修改 ,暂时 0为未结账,1为已结账
|
||||
LinkID int `orm:"column(link_id)" json:"linkID"` //作为冲账标志关联某条扣款记录
|
||||
SupplementTime *time.Time `orm:"type(datetime);null" json:"supplementTime"`
|
||||
Type int `json:"type"` //扣款类型,1为差评订单补贴,2为优惠券
|
||||
SupplementFee int `json:"supplementFee"` //扣款金额
|
||||
BillID string `orm:"column(bill_id);size(48)" json:"billID"` //账单ID
|
||||
Comment string `orm:"size(255)" json:"comment"`
|
||||
}
|
||||
|
||||
func (v *OrderSupplementFee) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"StoreID", "VendorOrderID", "SupplementTime", "VendorID", "BillID"},
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否是购买平台自有物流
|
||||
|
||||
Reference in New Issue
Block a user