|
|
@@ -1293,12 +1293,12 @@ func (r *Thjpurchasetransfer) GetDataByPage() (interface{}, error, int, int, int
|
|
|
}
|
|
|
|
|
|
type PromotionIncome struct {
|
|
|
- PROFITMONTH string `json:"profitmonth" xorm:"PROFITMONTH"` // 时间
|
|
|
- WRSTANDARDID int32 `json:"wrstandardid" xorm:"WRSTANDARDID"` // 现货商品ID
|
|
|
- WRSTANDARDCODE string `json:"wrstandardcode" xorm:"WRSTANDARDCODE"` // 现货商品代码
|
|
|
- WRSTANDARDNAME string `json:"wrstandardname" xorm:"WRSTANDARDNAME"` // 现货商品名称
|
|
|
- SUMAMOUNT float64 `json:"sumamount" xorm:"SUMAMOUNT"` // 金额
|
|
|
- PROFITSTATUS int32 `json:"profitstatus" xorm:"PROFITSTATUS"` // 状态 - 1:已支付 2:未支付
|
|
|
+ PROFITMONTH string `json:"profitmonth" xorm:"PROFITMONTH"` // 时间
|
|
|
+ WRSTANDARDID int32 `json:"wrstandardid" xorm:"WRSTANDARDID"` // 现货商品ID
|
|
|
+ WRSTANDARDCODE string `json:"wrstandardcode" xorm:"WRSTANDARDCODE"` // 现货商品代码
|
|
|
+ WRSTANDARDNAME string `json:"wrstandardname" xorm:"WRSTANDARDNAME"` // 现货商品名称
|
|
|
+ SUMAMOUNT float64 `json:"sumamount" xorm:"SUMAMOUNT"` // 金额
|
|
|
+ PROFITSTATUS int32 `json:"profitstatus" xorm:"PROFITSTATUS" form:"profitstatus"` // 状态 - 0:全部 1:已支付 2:未支付
|
|
|
|
|
|
USERID int64 `json:"-" xorm:"-" form:"userid" binding:"required"` // 用户ID
|
|
|
|
|
|
@@ -1319,11 +1319,15 @@ func (r *PromotionIncome) buildSql() string {
|
|
|
sum(t.profitamount) SUMAMOUNT
|
|
|
from THJ_Reckon_ProfitSum t
|
|
|
left join wrstandard wr on t.wrstandardid = wr.wrstandardid
|
|
|
- where t.userid = %v and t.profitstatus = 1
|
|
|
+ where t.userid = %v and %v
|
|
|
group by substr(t.reckondate, 0, 6), t.wrstandardid, wr.wrstandardname
|
|
|
order by substr(t.reckondate, 0, 6) desc, t.wrstandardid, wr.wrstandardname
|
|
|
`
|
|
|
- sqlId.FormatParam(r.USERID)
|
|
|
+ param := "1=1"
|
|
|
+ if r.PROFITSTATUS > 0 {
|
|
|
+ param = fmt.Sprintf("t.profitstatus = %v", r.PROFITSTATUS)
|
|
|
+ }
|
|
|
+ sqlId.FormatParam(r.USERID, param)
|
|
|
|
|
|
sqlId.Page(r.Page, r.PageSize)
|
|
|
return sqlId.String()
|