@@ -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") | |||
@@ -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 { | |||
@@ -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 { | |||