京西商城订单序号
This commit is contained in:
@@ -1162,3 +1162,28 @@ func GetOrdersSupplementNoPage(db *DaoDB, ID int, storIDs, vendorIDs, statuss []
|
||||
err = GetRows(db, &orderSupplementFee, sql, sqlParams...)
|
||||
return orderSupplementFee, err
|
||||
}
|
||||
|
||||
func GetJxOrderCount(db *DaoDB, storeID int, orderID string, date time.Time) (count int, err error) {
|
||||
if utils.IsTimeZero(date) {
|
||||
date = time.Now()
|
||||
}
|
||||
sql := `
|
||||
SELECT COUNT(*) ct
|
||||
FROM goods_order t1
|
||||
WHERE t1.vendor_id = ? AND t1.jx_store_id = ? AND (t1.status >= ? OR t1.order_seq > 0) AND t1.order_created_at >= ? AND t1.order_created_at < ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
model.VendorIDJX,
|
||||
storeID,
|
||||
model.OrderStatusNew,
|
||||
utils.Time2Date(date),
|
||||
utils.Time2Date(date).Add(24 * time.Hour),
|
||||
}
|
||||
|
||||
if orderID != "" {
|
||||
sql += " AND t1.vendor_order_id = ?"
|
||||
sqlParams = append(sqlParams, orderID)
|
||||
}
|
||||
err = GetRow(db, &count, sql, sqlParams...)
|
||||
return count, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user