京西商城订单序号

This commit is contained in:
gazebo
2020-02-01 12:23:15 +08:00
parent c2519be865
commit 0c5d62e55f
4 changed files with 38 additions and 1 deletions

View File

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