up
This commit is contained in:
@@ -923,15 +923,22 @@ func GetMyOrderCountInfo(db *DaoDB, userID string, fromDate, toDate time.Time, s
|
||||
if utils.IsTimeZero(fromDate) {
|
||||
return nil, fmt.Errorf("必须指定开始日期")
|
||||
}
|
||||
if utils.IsTimeZero(toDate) {
|
||||
toDate = fromDate
|
||||
if !utils.IsTimeZero(fromDate) {
|
||||
fromDate = utils.Time2Date(fromDate)
|
||||
if utils.IsTimeZero(toDate) {
|
||||
toDate = fromDate
|
||||
}
|
||||
}
|
||||
if !utils.IsTimeZero(toDate) {
|
||||
toDate = utils.Time2Date(toDate)
|
||||
toDate = toDate.Add(24 * time.Hour)
|
||||
}
|
||||
|
||||
sql := `
|
||||
SELECT t1.lock_status, t1.status, COUNT(*) count
|
||||
FROM goods_order t1
|
||||
WHERE t1.user_id = ? AND t1.vendor_id = ?
|
||||
AND t1.order_created_at >= ? AND t1.order_created_at <= ?
|
||||
AND t1.order_created_at >= ? AND t1.order_created_at < ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
userID,
|
||||
|
||||
Reference in New Issue
Block a user