Parcourir la source

更新条件

master
huangjiajun il y a 1 an
Parent
révision
98609157d3
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. +2
    -2
      db/db_order.go

+ 2
- 2
db/db_order.go Voir le fichier

@@ -24,7 +24,7 @@ func OrderListCountByUIDByOrderTypeByTime(Db *xorm.Engine, uid, buyType, state,
total, _ := Db.Where("uid = ? AND confirm_at > ? AND confirm_at < ? and settle_at=0", uid, stime, etime).In("state", state).Count(&model.OrdList{})
total1, _ := Db.Where("uid = ? AND confirm_at > ? AND confirm_at < ? and settle_at>0", uid, stime, etime).Count(&model.OrdList{})
total3, _ := Db.Where("uid = ? AND settle_at > ? AND settle_at < ? and confirm_at=0", uid, stime, etime).Count(&model.OrdList{})
total2, _ := Db.Where("uid = ? AND confirm_at > ? AND confirm_at < ? and state=?", uid, stime, etime, 1).Count(&model.PrivilegeCardOrd{})
total2, _ := Db.Where("uid = ? AND created_at > ? AND created_at < ? and state=?", uid, stime, etime, 1).Count(&model.PrivilegeCardOrd{})

fmt.Println(total)

@@ -83,7 +83,7 @@ func OrderListPaidPriceByUIDByOrderTypeByTime(Db *xorm.Engine, uid, buyType, sta
fmt.Println(str)
total, _ := Db.Where("uid = ? AND confirm_at > ? AND confirm_at < ? and settle_at=0", uid, stime, etime).In("state", state).Sum(&model.OrdList{}, "paid_price")
total1, _ := Db.Where("uid = ? AND confirm_at > ? AND confirm_at < ? and settle_at>0", uid, stime, etime).Sum(&model.OrdList{}, "paid_price")
total2, _ := Db.Where("uid = ? AND confirm_at > ? AND confirm_at < ? and state=?", uid, stime, etime, 1).Sum(&model.PrivilegeCardOrd{}, "paid_price")
total2, _ := Db.Where("uid = ? AND created_at > ? AND created_at < ? and state=?", uid, stime, etime, 1).Sum(&model.PrivilegeCardOrd{}, "paid_price")
fmt.Println(total)

return total + total1 + total2, nil


Chargement…
Annuler
Enregistrer