|
|
@@ -1231,7 +1231,8 @@ type Thjpurchasetransfer struct {
|
|
|
TRANSFERSTATUS int32 `json:"transferstatus" xorm:"TRANSFERSTATUS"` // 转让状态 - 1:挂牌中 2:已撤销 3:处理中 4:已转让
|
|
|
HANDLESTATUS int32 `json:"handlestatus" xorm:"HANDLESTATUS"` // 处理状态
|
|
|
|
|
|
- USERID int64 `json:"-" xorm:"-" form:"userid" binding:"required"` // 用户ID
|
|
|
+ USERID int64 `json:"-" xorm:"-" form:"userid" binding:"required"` // 用户ID
|
|
|
+ ORDERTYPE int `json:"-" xorm:"-" form:"ordertype" binding:"required"` // 类型 - 1:转让 2:受让
|
|
|
|
|
|
PageEx `xorm:"extends"` // 页码信息
|
|
|
}
|
|
|
@@ -1273,9 +1274,13 @@ func (r *Thjpurchasetransfer) buildSql() string {
|
|
|
from THJ_PurchaseTransfer t
|
|
|
inner join THJ_PurchaseTradeDetail p on t.wrtradedetailid = p.wrtradedetailid
|
|
|
inner join wrstandard wr on t.wrstandardid = wr.wrstandardid
|
|
|
- where t.selluserid = %v and t.transferstatus = 1
|
|
|
+ where %v and t.transferstatus = 1
|
|
|
`
|
|
|
- sqlId.FormatParam(r.USERID)
|
|
|
+ param := fmt.Sprintf("t.selluserid = %v", r.USERID)
|
|
|
+ if r.ORDERTYPE == 2 {
|
|
|
+ param = fmt.Sprintf("t.buyuserid = %v", r.USERID)
|
|
|
+ }
|
|
|
+ sqlId.FormatParam(param)
|
|
|
|
|
|
sqlId.Page(r.Page, r.PageSize)
|
|
|
return sqlId.String()
|
|
|
@@ -1314,13 +1319,13 @@ func (r *PromotionIncome) buildSql() string {
|
|
|
select
|
|
|
substr(t.reckondate, 0, 6) PROFITMONTH,
|
|
|
t.WRSTANDARDID,
|
|
|
- wr.WRSTANDARDCODE
|
|
|
+ wr.WRSTANDARDCODE,
|
|
|
wr.WRSTANDARDNAME,
|
|
|
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.wrstandardname
|
|
|
+ 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
|
|
|
`
|
|
|
param := "1=1"
|
|
|
@@ -1367,7 +1372,7 @@ func (r *PromotionIncomeDetail) calc() {
|
|
|
func (r *PromotionIncomeDetail) buildSql() string {
|
|
|
var sqlId utils.SQLVal = `
|
|
|
select
|
|
|
- to_char(t.TRADETIME,'yyyy-mm-dd hh24:mi:ss) TRADETIME',
|
|
|
+ to_char(t.TRADETIME,'yyyy-mm-dd hh24:mi:ss') TRADETIME,
|
|
|
wr.WRSTANDARDID,
|
|
|
wr.WRSTANDARDCODE,
|
|
|
wr.WRSTANDARDNAME,
|