|
|
@@ -275,3 +275,45 @@ func (r *MyRefer) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
}
|
|
|
return sData, err, r.Page, r.PageSize, total
|
|
|
}
|
|
|
+
|
|
|
+type GThjuserscorelog struct {
|
|
|
+ USERID int64 `json:"-" xorm:"USERID" form:"userid" binding:"required"` // 用户ID
|
|
|
+ SCORECONFIGTYPE int32 `json:"scoreconfigtype" xorm:"SCORECONFIGTYPE"` // 配置类型 - 1:注册红包 2:签到积分 3:推广积分 4:下级用户下单积分 5:自己采购下单积分 6:自己供求下单积分 7:抽奖配置
|
|
|
+ SCORE float64 `json:"score" xorm:"SCORE"` // 变动积分
|
|
|
+ ORISCORE float64 `json:"-" xorm:"ORISCORE"` // 期初积分(变动前积)
|
|
|
+ CURSCORE float64 `json:"-" xorm:"CURSCORE"` // 期末积分(变动后积)
|
|
|
+ CREATETIME string `json:"createtime" xorm:"CREATETIME"` // 记账时间
|
|
|
+ REMARK string `json:"-" xorm:"REMARK"` // 备注
|
|
|
+ RELATEDORDERID int64 `json:"-" xorm:"RELATEDORDERID"` // 关联单号
|
|
|
+
|
|
|
+ PageEx `xorm:"extends"` // 页码信息
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GThjuserscorelog) calc() {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GThjuserscorelog) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = `
|
|
|
+ select
|
|
|
+ t.SCORECONFIGTYPE,
|
|
|
+ t.SCORE,
|
|
|
+ to_char(t.CREATETIME, 'yyyy-mm-dd hh24:mi:ss') CREATETIME
|
|
|
+ from THJ_USERSCORELOG t
|
|
|
+ where t.USERID = %v
|
|
|
+ order by t.CREATETIME desc
|
|
|
+`
|
|
|
+ sqlId.FormatParam(r.USERID)
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+func (r *GThjuserscorelog) GetDataByPage() (interface{}, error, int, int, int) {
|
|
|
+ sData := make([]GThjuserscorelog, 0)
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
+ total := 0
|
|
|
+ for i := range sData {
|
|
|
+ sData[i].calc()
|
|
|
+ total = sData[i].Total
|
|
|
+ }
|
|
|
+ return sData, err, r.Page, r.PageSize, total
|
|
|
+}
|