|
|
@@ -1476,12 +1476,9 @@ func (r *ThjpurchasetransferDetail) GetDataEx() (interface{}, error) {
|
|
|
}
|
|
|
|
|
|
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" form:"profitstatus"` // 状态 - 0:全部 1:已支付 2:未支付
|
|
|
+ PROFITMONTH string `json:"profitmonth" xorm:"PROFITMONTH"` // 时间
|
|
|
+ SUMAMOUNT float64 `json:"sumamount" xorm:"SUMAMOUNT"` // 金额
|
|
|
+ PROFITSTATUS int32 `json:"profitstatus" xorm:"PROFITSTATUS" form:"profitstatus"` // 状态 - 1:已支付 2:未支付 3:支取中
|
|
|
|
|
|
USERID int64 `json:"-" xorm:"-" form:"userid" binding:"required"` // 用户ID
|
|
|
|
|
|
@@ -1495,16 +1492,12 @@ func (r *PromotionIncome) calc() {
|
|
|
func (r *PromotionIncome) buildSql() string {
|
|
|
var sqlId utils.SQLVal = `
|
|
|
select
|
|
|
- substr(t.reckondate, 0, 6) PROFITMONTH,
|
|
|
- t.WRSTANDARDID,
|
|
|
- wr.WRSTANDARDCODE,
|
|
|
- wr.WRSTANDARDNAME,
|
|
|
+ substr(t.reckondate, 0, 6) PROFITMONTH,
|
|
|
sum(t.profitamount) SUMAMOUNT
|
|
|
from THJ_Reckon_ProfitSum t
|
|
|
- left join wrstandard wr on t.wrstandardid = wr.wrstandardid
|
|
|
where t.userid = %v and %v
|
|
|
- group by substr(t.reckondate, 0, 6), t.wrstandardid, wr.WRSTANDARDCODE, wr.wrstandardname
|
|
|
- order by substr(t.reckondate, 0, 6) desc, t.wrstandardid, wr.wrstandardname
|
|
|
+ group by substr(t.reckondate, 0, 6)
|
|
|
+ order by substr(t.reckondate, 0, 6) desc
|
|
|
`
|
|
|
param := "1=1"
|
|
|
if r.PROFITSTATUS > 0 {
|