+GetOrderPay

GetOrders添加参数isPurchase
This commit is contained in:
gazebo
2019-11-27 10:05:26 +08:00
parent 4b1b011459
commit 7410da75fd
10 changed files with 121 additions and 30 deletions

View File

@@ -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 {