aa
This commit is contained in:
@@ -1607,3 +1607,40 @@ func GetUserCoupons(db *DaoDB, couponIDs []int, userIDs, mobiles []string, userS
|
||||
err = GetRows(db, &userCoupons, sql, sqlParams)
|
||||
return userCoupons, err
|
||||
}
|
||||
|
||||
type QueryOrdersForManageStateResult struct {
|
||||
VendorOrderID string `orm:"column(vendor_order_id)"`
|
||||
BindID int `orm:"column(bind_id)"`
|
||||
}
|
||||
|
||||
func QueryOrdersForManageState(db *DaoDB, storeID, vendorID, status int, fromTime, toTime time.Time) (userCoupons []*QueryOrdersForManageStateResult, err error) {
|
||||
sql := `
|
||||
SELECT a.vendor_order_id ,b.id bind_id
|
||||
FROM goods_order a
|
||||
LEFT JOIN waybill b ON a.vendor_order_id = b.vendor_order_id
|
||||
WHERE 1 = 1
|
||||
`
|
||||
sqlParams := []interface{}{}
|
||||
if storeID != 0 {
|
||||
sql += " AND (a.storeID = ? OR a.jx_store_id = ?)"
|
||||
sqlParams = append(sqlParams, storeID, storeID)
|
||||
}
|
||||
if vendorID != -1 {
|
||||
sql += " AND a.vendor_id = ?"
|
||||
sqlParams = append(sqlParams, vendorID)
|
||||
}
|
||||
if status != 0 {
|
||||
sql += " AND a.status = ?"
|
||||
sqlParams = append(sqlParams, status)
|
||||
}
|
||||
if !utils.IsTimeZero(fromTime) {
|
||||
sql += " AND a.order_created_at > ?"
|
||||
sqlParams = append(sqlParams, fromTime)
|
||||
}
|
||||
if !utils.IsTimeZero(toTime) {
|
||||
sql += " AND a.order_created_at < ?"
|
||||
sqlParams = append(sqlParams, toTime)
|
||||
}
|
||||
err = GetRows(db, &userCoupons, sql, sqlParams)
|
||||
return userCoupons, err
|
||||
}
|
||||
|
||||
@@ -769,7 +769,7 @@ func GetDataResFieldName(vendorID int) (fieldName string) {
|
||||
// return fieldName
|
||||
// }
|
||||
|
||||
func GetStoresSkusInfo(db *DaoDB, storeIDs, skuIDs []int, status int) (storeSkuList []*model.StoreSkuBind, err error) {
|
||||
func GetStoresSkusInfo(db *DaoDB, storeIDs, skuIDs []int) (storeSkuList []*model.StoreSkuBind, err error) {
|
||||
sql := `
|
||||
SELECT *
|
||||
FROM store_sku_bind t1
|
||||
|
||||
Reference in New Issue
Block a user