浏览代码

查询我的订单-转让/受让订单 接口增加类型出参

zhou.xiaoning 3 年之前
父节点
当前提交
53eeb051f9
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      models/ferroalloy.go

+ 5 - 4
models/ferroalloy.go

@@ -1236,8 +1236,8 @@ type Thjpurchasetransfer struct {
 
 	WRSTANDARDNAME string `json:"wrstandardname" xorm:"WRSTANDARDNAME"` // 现货商品名称
 
-	USERID    int64 `json:"-" xorm:"-" form:"userid" binding:"required"`    // 用户ID
-	ORDERTYPE int   `json:"-" xorm:"-" form:"ordertype" binding:"required"` // 类型 - 1:转让 2:受让
+	USERID    int64 `json:"-" xorm:"-" form:"userid" binding:"required"`                    // 用户ID
+	ORDERTYPE int   `json:"ordertype" xorm:"ORDERTYPE" form:"ordertype" binding:"required"` // 类型 - 1:转让 2:受让
 
 	PageEx `xorm:"extends"` // 页码信息
 }
@@ -1275,7 +1275,8 @@ func (r *Thjpurchasetransfer) buildSql() string {
 		t.SELLCHARGE,
 		t.TRANSFERTRADEDATE,
 		t.TRANSFERSTATUS,
-		t.HANDLESTATUS
+		t.HANDLESTATUS,
+		%v ORDERTYPE
 	from THJ_PurchaseTransfer t
 	inner join THJ_PurchaseTradeDetail p on t.wrtradedetailid = p.wrtradedetailid
 	inner join wrstandard wr on t.wrstandardid = wr.wrstandardid
@@ -1285,7 +1286,7 @@ func (r *Thjpurchasetransfer) buildSql() string {
 	if r.ORDERTYPE == 2 {
 		param = fmt.Sprintf("t.buyuserid = %v", r.USERID)
 	}
-	sqlId.FormatParam(param)
+	sqlId.FormatParam(r.ORDERTYPE, param)
 
 	sqlId.Page(r.Page, r.PageSize)
 	return sqlId.String()