|
@@ -6,7 +6,6 @@ import ( |
|
|
"applet/app/utils/logx" |
|
|
"applet/app/utils/logx" |
|
|
"errors" |
|
|
"errors" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"time" |
|
|
|
|
|
"xorm.io/xorm" |
|
|
"xorm.io/xorm" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
@@ -449,7 +448,8 @@ func OrderListCountByPvdByUidByTimeByValid(Db *xorm.Engine, provider, startTime, |
|
|
func OrderListCountByPriceType(sess *xorm.Session, uid string, priceType, day int) (int64, error) { |
|
|
func OrderListCountByPriceType(sess *xorm.Session, uid string, priceType, day int) (int64, error) { |
|
|
sess = sess.Where(" uid = ? AND state != 4 AND price_type= ?", uid, priceType) |
|
|
sess = sess.Where(" uid = ? AND state != 4 AND price_type= ?", uid, priceType) |
|
|
if day > 0 { |
|
|
if day > 0 { |
|
|
sess = sess.And("create_at>=?", time.Now().Unix()-int64(day*86400)) |
|
|
|
|
|
|
|
|
today := utils.GetTimeRange("today") |
|
|
|
|
|
sess = sess.And("create_at>=?", today["end"]-int64(day*86400)) |
|
|
} |
|
|
} |
|
|
return sess.Count(&model.OrdList{}) |
|
|
return sess.Count(&model.OrdList{}) |
|
|
} |
|
|
} |
|
@@ -458,7 +458,8 @@ func OrderListCountByPriceType(sess *xorm.Session, uid string, priceType, day in |
|
|
func OrderListCountByItemId(sess *xorm.Session, uid string, itemId string, day int) (int64, error) { |
|
|
func OrderListCountByItemId(sess *xorm.Session, uid string, itemId string, day int) (int64, error) { |
|
|
sess = sess.Where(" uid = ? AND state != 4 AND item_id = ? and price_type>0", uid, itemId) |
|
|
sess = sess.Where(" uid = ? AND state != 4 AND item_id = ? and price_type>0", uid, itemId) |
|
|
if day > 0 { |
|
|
if day > 0 { |
|
|
sess = sess.And("create_at>=?", time.Now().Unix()-int64(day*86400)) |
|
|
|
|
|
|
|
|
today := utils.GetTimeRange("today") |
|
|
|
|
|
sess = sess.And("create_at>=?", today["end"]-int64(day*86400)) |
|
|
} |
|
|
} |
|
|
return sess.Count(&model.OrdList{}) |
|
|
return sess.Count(&model.OrdList{}) |
|
|
} |
|
|
} |
|
|