+GetOrderPay
GetOrders添加参数isPurchase
This commit is contained in:
@@ -229,7 +229,16 @@ func (c *OrderManager) ExportMTWaybills(ctx *jxcontext.Context, fromDateStr, toD
|
||||
|
||||
func (c *OrderManager) getOrders(ctx *jxcontext.Context, isIncludeSku, isIncludeFake bool, fromDateStr, toDateStr string, isDateFinish bool, skuIDs []int, isJxFirst bool, params map[string]interface{}, offset, pageSize int) (orders []*model.GoodsOrderExt, totalCount int, err error) {
|
||||
globals.SugarLogger.Debugf("getOrders from:%s to:%s", fromDateStr, toDateStr)
|
||||
|
||||
isPurchase, _ := params["isPurchase"].(bool)
|
||||
userID := ""
|
||||
if !isPurchase {
|
||||
if user := ctx.GetFullUser(); user != nil {
|
||||
userID = user.GetID()
|
||||
if user.Type&model.UserTypeNonConsumer == 0 {
|
||||
isPurchase = true
|
||||
}
|
||||
}
|
||||
}
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
if offset < 0 {
|
||||
offset = 0
|
||||
@@ -393,6 +402,10 @@ func (c *OrderManager) getOrders(ctx *jxcontext.Context, isIncludeSku, isInclude
|
||||
sqlParams = append(sqlParams, vendorIDs)
|
||||
}
|
||||
}
|
||||
if isPurchase {
|
||||
sqlWhere += " AND t1.user_id = ?"
|
||||
sqlParams = append(sqlParams, userID)
|
||||
}
|
||||
db := dao.GetDB()
|
||||
sql += sqlWhere
|
||||
if isIncludeSku {
|
||||
|
||||
Reference in New Issue
Block a user