|
|
@@ -674,6 +674,9 @@ type Thjpurchasetradedetail struct {
|
|
|
THJDELIVERYMODEDISPLAY string `json:"thjdeliverymodedisplay" xorm:"THJDELIVERYMODEDISPLAY"` // 提货方式
|
|
|
THJORDERSTATUSDISPLAY string `json:"thjorderstatusdisplay" xorm:"THJORDERSTATUSDISPLAY"` // 状态
|
|
|
|
|
|
+ ENDDATEMONTH string `json:"enddatemonth" xorm:"ENDDATEMONTH"` // 到期月份
|
|
|
+ ENDDATE string `json:"enddate" xorm:"ENDDATE"` // 到期日期
|
|
|
+
|
|
|
TYPE int `json:"-" xorm:"-" form:"type"` // 类型 - 0:未完成 1:已完成
|
|
|
|
|
|
PageEx `xorm:"extends"` // 页码信息
|
|
|
@@ -731,8 +734,12 @@ func (r *Thjpurchasetradedetail) buildSql() string {
|
|
|
t.CONTRACTADDRSELL,
|
|
|
t.PAYEDTRADEDATE,
|
|
|
t.BUYFREEZECHARGE,
|
|
|
- t.LASTPRICEDATE
|
|
|
+ t.LASTPRICEDATE,
|
|
|
+ to_char(pi.enddate, 'yyyy-MM') ENDDATEMONTH,
|
|
|
+ to_char(pi.enddate, 'yyyy-MM-dd') ENDDATE
|
|
|
from THJ_PurchaseTradeDetail t
|
|
|
+ inner join WR_PresaleInfo pi
|
|
|
+ on t.presaleapplyid = pi.presaleapplyid
|
|
|
left join wrstandard wr
|
|
|
on t.wrstandardid = wr.wrstandardid
|
|
|
left join warehouseinfo wh
|
|
|
@@ -744,7 +751,7 @@ func (r *Thjpurchasetradedetail) buildSql() string {
|
|
|
on en2.enumdiccode = 'THJOrderStatus'
|
|
|
and t.orderstatus = en2.enumitemname
|
|
|
where t.buyuserid = %v
|
|
|
- and t.orderstatus in (4,6,7)
|
|
|
+ and t.orderstatus in (4,6,7,8)
|
|
|
order by t.tradetime desc
|
|
|
`
|
|
|
sqlId.FormatParam(r.BUYUSERID)
|
|
|
@@ -763,9 +770,10 @@ func (r *Thjpurchasetradedetail) buildSql2() string {
|
|
|
case t.orderstatus
|
|
|
when 3 then 1
|
|
|
when 5 then 2
|
|
|
- when 1 then 3
|
|
|
- when 2 then 4
|
|
|
- else 10 end OrderIndex,
|
|
|
+ when 9 then 3
|
|
|
+ when 1 then 10
|
|
|
+ when 2 then 11
|
|
|
+ else 20 end OrderIndex,
|
|
|
t.WRTRADEDETAILID,
|
|
|
t.PRESALEAPPLYID,
|
|
|
t.TRADEDATE,
|
|
|
@@ -807,8 +815,12 @@ func (r *Thjpurchasetradedetail) buildSql2() string {
|
|
|
t.CONTRACTADDRSELL,
|
|
|
t.PAYEDTRADEDATE,
|
|
|
t.BUYFREEZECHARGE,
|
|
|
- t.LASTPRICEDATE
|
|
|
+ t.LASTPRICEDATE,
|
|
|
+ to_char(pi.enddate, 'yyyy-MM') ENDDATEMONTH,
|
|
|
+ to_char(pi.enddate, 'yyyy-MM-dd') ENDDATE
|
|
|
from THJ_PurchaseTradeDetail t
|
|
|
+ inner join WR_PresaleInfo pi
|
|
|
+ on t.presaleapplyid = pi.presaleapplyid
|
|
|
left join wrstandard wr
|
|
|
on t.wrstandardid = wr.wrstandardid
|
|
|
left join warehouseinfo wh
|
|
|
@@ -820,7 +832,7 @@ func (r *Thjpurchasetradedetail) buildSql2() string {
|
|
|
on en2.enumdiccode = 'THJOrderStatus'
|
|
|
and t.orderstatus = en2.enumitemname
|
|
|
where t.buyuserid = %v
|
|
|
- and t.orderstatus in (1,2,3,5)) aa
|
|
|
+ and t.orderstatus in (1,2,3,5,9)) aa
|
|
|
order by aa.orderindex, aa.tradetime desc
|
|
|
`
|
|
|
sqlId.FormatParam(r.BUYUSERID)
|