Bladeren bron

更新

master
huangjiajun 1 jaar geleden
bovenliggende
commit
2ab1434719
3 gewijzigde bestanden met toevoegingen van 11 en 11 verwijderingen
  1. +1
    -1
      db/db_order.go
  2. +5
    -5
      db/db_order_count.go
  3. +5
    -5
      db/db_order_sum.go

+ 1
- 1
db/db_order.go Bestand weergeven

@@ -102,7 +102,7 @@ func OrderListPaidPriceByUIDByOrderTypeByTime(Db *xorm.Engine, uid, buyType, sta
if strings.Contains(serializeStr, "0") {
types = "create_at"
}
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", types, stime, types, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", types, stime, types, etime)
total, _ = Db.Where("uid = ? AND ? and settle_at=0", uid, sqlStr).In("state", state).Sum(&model.OrdList{}, "paid_price")
total1, _ := Db.Where("uid = ? AND ? and settle_at>0", uid, sqlStr).Sum(&model.OrdList{}, "paid_price")
total2, _ := Db.Where("uid = ? AND created_at > ? AND created_at < ? and state=?", uid, stime, etime, 1).Sum(&model.PrivilegeCardOrd{}, "paid_price")


+ 5
- 5
db/db_order_count.go Bestand weergeven

@@ -38,7 +38,7 @@ func OrderListCountByUIDByOrderTypeByTimeNew(Db *xorm.Engine, uid interface{}, t
sess1 = sess1.And(sqlStr)
sqlStr2 := fmt.Sprintf(" %s > %d AND %s < %d", timeType2, stime.Unix(), timeType2, etime.Unix())
sess2 = sess2.And(sqlStr2)
sqlStr4 := fmt.Sprintf(" %s > %s AND %s < %s", timeType4, stime.Format("2006-01-02 15:04:05"), timeType4, etime.Format("2006-01-02 15:04:05"))
sqlStr4 := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType4, stime.Format("2006-01-02 15:04:05"), timeType4, etime.Format("2006-01-02 15:04:05"))
sess4 = sess4.And(sqlStr4)
}
if task.OrdState == 3 {
@@ -78,7 +78,7 @@ func MallOrdWithCountNew(Db *xorm.Engine, uid interface{}, task *model.UserLevel
etime := t.Format("2006-01-02 15:04:05")
sess := Db.Where("uid = ? ", uid)
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType, stime, timeType, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType, stime, timeType, etime)
sess.And(sqlStr)
}
if task.OrdState == 3 {
@@ -114,7 +114,7 @@ func O2oOrdWithCountNew(Db *xorm.Engine, uid interface{}, task *model.UserLevelU
etime := t.Format("2006-01-02 15:04:05")
sess := Db.Where("uid = ? ", uid)
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType, stime, timeType, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType, stime, timeType, etime)
sess.And(sqlStr)
}
if task.OrdState == 3 {
@@ -131,7 +131,7 @@ func O2oOrdWithCountNew(Db *xorm.Engine, uid interface{}, task *model.UserLevelU
}
sess1 := Db.Where("uid = ? ", uid)
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType1, stime, timeType1, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType1, stime, timeType1, etime)
sess1.And(sqlStr)
}
if task.OrdState == 3 {
@@ -161,7 +161,7 @@ func B2cOrdWithCountNew(Db *xorm.Engine, uid interface{}, task *model.UserLevelU
etime := t.Format("2006-01-02 15:04:05")
sess := Db.Where("uid = ? ", uid)
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType, stime, timeType, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType, stime, timeType, etime)
sess.And(sqlStr)
}
if task.OrdState == 3 {


+ 5
- 5
db/db_order_sum.go Bestand weergeven

@@ -35,7 +35,7 @@ func OrderListSumByUIDByOrderTypeByTimeNew(Db *xorm.Engine, uid interface{}, tas
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %d AND %s < %d", timeType, stime.Unix(), timeType, etime.Unix())
sqlStr2 := fmt.Sprintf(" %s > %d AND %s < %d", timeType2, stime.Unix(), timeType2, etime.Unix())
sqlStr4 := fmt.Sprintf(" %s > %s AND %s < %s", timeType4, stime.Format("2006-01-02 15:04:05"), timeType4, etime.Format("2006-01-02 15:04:05"))
sqlStr4 := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType4, stime.Format("2006-01-02 15:04:05"), timeType4, etime.Format("2006-01-02 15:04:05"))
sess.And(sqlStr)
sess1.And(sqlStr)
sess2.And(sqlStr2)
@@ -77,7 +77,7 @@ func MallOrdWithSumNew(Db *xorm.Engine, uid interface{}, orderType int, task *mo
sess.And("order_type=?", orderType)
}
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType, stime, timeType, etime)
sqlStr := fmt.Sprintf(" %s > '%s' AND %s < '%s'", timeType, stime, timeType, etime)
sess.And(sqlStr)
}
if task.OrdState == 3 {
@@ -113,7 +113,7 @@ func O2oOrdWithSumNew(Db *xorm.Engine, uid interface{}, task *model.UserLevelUpg
etime := t.Format("2006-01-02 15:04:05")
sess := Db.Where("uid = ? ", uid)
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType, stime, timeType, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType, stime, timeType, etime)
sess.And(sqlStr)
}
if task.OrdState == 3 {
@@ -130,7 +130,7 @@ func O2oOrdWithSumNew(Db *xorm.Engine, uid interface{}, task *model.UserLevelUpg
}
sess1 := Db.Where("uid = ? ", uid)
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType1, stime, timeType1, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType1, stime, timeType1, etime)
sess.And(sqlStr)
}
if task.OrdState == 3 {
@@ -160,7 +160,7 @@ func B2cOrdWithSumNew(Db *xorm.Engine, uid interface{}, task *model.UserLevelUpg
etime := t.Format("2006-01-02 15:04:05")
sess := Db.Where("uid = ? ", uid)
if task.WithinDays > 0 {
sqlStr := fmt.Sprintf(" %s > %s AND %s < %s", timeType, stime, timeType, etime)
sqlStr := fmt.Sprintf(" %s >'%s' AND %s < '%s'", timeType, stime, timeType, etime)
sess.And(sqlStr)
}
if task.OrdState == 3 {


Laden…
Annuleren
Opslaan