Переглянути джерело

#6616【Go查询】接口:/Mine/QueryMineTradeGoodsDeliveryOfflines,/sbyj/QueryTradeHolderDetailEx添加查询参数trademodes, 逗号分隔(如10,53)

deng.yinping 10 місяців тому
батько
коміт
62e3c6ff81
6 змінених файлів з 38 додано та 5 видалено
  1. 1 0
      controllers/sbyj/order.go
  2. 10 0
      docs/docs.go
  3. 10 0
      docs/swagger.json
  4. 7 0
      docs/swagger.yaml
  5. 3 3
      models/mine.go
  6. 7 2
      models/sbyj.go

+ 1 - 0
controllers/sbyj/order.go

@@ -113,6 +113,7 @@ func QueryMyDeliveryofflineoperatelog(c *gin.Context) {
 // @Param    goodsid   query    int    false "商品ID"
 // @Param    holderqty query    int    false "持仓数量"
 // @Param    marketids query    string false "目标市场ID列表,格式 1,2,3"
+// @Param    trademodes query    string false "交易模式列表,格式 10,53,52"
 // @Param    page            query    int    false "页码"
 // @Param    pagesize        query    int    false "每页条数"
 // @Success  200       {array}  models.Tradeholderdetailex

+ 10 - 0
docs/docs.go

@@ -23951,6 +23951,12 @@ const docTemplate = `{
                         "in": "query"
                     },
                     {
+                        "type": "string",
+                        "description": "交易模式列表,格式 10,53,52",
+                        "name": "trademodes",
+                        "in": "query"
+                    },
+                    {
                         "type": "integer",
                         "description": "页码",
                         "name": "page",
@@ -58634,6 +58640,10 @@ const docTemplate = `{
                     "description": "缩略图片(1:1)(逗号分隔)",
                     "type": "string"
                 },
+                "tradeModes": {
+                    "description": "过滤交易模式列表,格式 10,53",
+                    "type": "string"
+                },
                 "tradeamount": {
                     "description": "成交金额",
                     "type": "number"

+ 10 - 0
docs/swagger.json

@@ -23942,6 +23942,12 @@
                         "in": "query"
                     },
                     {
+                        "type": "string",
+                        "description": "交易模式列表,格式 10,53,52",
+                        "name": "trademodes",
+                        "in": "query"
+                    },
+                    {
                         "type": "integer",
                         "description": "页码",
                         "name": "page",
@@ -58625,6 +58631,10 @@
                     "description": "缩略图片(1:1)(逗号分隔)",
                     "type": "string"
                 },
+                "tradeModes": {
+                    "description": "过滤交易模式列表,格式 10,53",
+                    "type": "string"
+                },
                 "tradeamount": {
                     "description": "成交金额",
                     "type": "number"

+ 7 - 0
docs/swagger.yaml

@@ -25593,6 +25593,9 @@ definitions:
       thumurls:
         description: 缩略图片(1:1)(逗号分隔)
         type: string
+      tradeModes:
+        description: 过滤交易模式列表,格式 10,53
+        type: string
       tradeamount:
         description: 成交金额
         type: number
@@ -47300,6 +47303,10 @@ paths:
         in: query
         name: marketids
         type: string
+      - description: 交易模式列表,格式 10,53,52
+        in: query
+        name: trademodes
+        type: string
       - description: 页码
         in: query
         name: page

+ 3 - 3
models/mine.go

@@ -622,7 +622,7 @@ func (r *MineTradeOrder) buildSql() string {
 	sqlId.And("ta.userid", r.Userid)
 	// sqlId.AndEx("t.orderstatus", r.ORDERSTATUS, r.ORDERSTATUS > 0)
 	if r.Status != "" {
-		sqlId.JoinFormat("and t.orderstatus in (%s)", r.Status)
+		sqlId.JoinFormat(" and t.orderstatus in (%s)", r.Status)
 	}
 	sqlId.OrderByDesc("t.ordertime")
 
@@ -1079,10 +1079,10 @@ func (r *MineTradeGoodsDeliveryOffline) buildSql() string {
 		sqlId.And("t.buyorsell", *r.BUYORSELL)
 	}
 	if r.MarketIds != "" {
-		sqlId.JoinFormat("and t.marketid in (%s)", r.MarketIds)
+		sqlId.JoinFormat(" and t.marketid in (%s)", r.MarketIds)
 	}
 	if r.TradeModes != "" {
-		sqlId.JoinFormat("and m.trademode in (%s)", r.TradeModes)
+		sqlId.JoinFormat(" and m.trademode in (%s)", r.TradeModes)
 	}
 	sqlId.OrderByDesc("t.reqtime")
 

+ 7 - 2
models/sbyj.go

@@ -568,7 +568,8 @@ type Tradeholderdetailex struct {
 	GOODSNAMEEN  string  `json:"goodsnameen" xorm:"GOODSNAMEEN"`   // 期货合约名称(英文)
 	GOODSNAMETW  string  `json:"goodsnametw" xorm:"GOODSNAMETW"`   // 期货合约名称(繁体)
 
-	MarketIds string `form:"marketids"` // 过滤市场ID列表,格式 1,2,3
+	MarketIds  string `form:"marketids"`  // 过滤市场ID列表,格式 1,2,3
+	TradeModes string `form:"trademodes"` // 过滤交易模式列表,格式 10,53
 
 	PageEx `xorm:"extends"` // 页码信息
 }
@@ -646,6 +647,7 @@ func (r *Tradeholderdetailex) buildSql() string {
 	from trade_holderdetailex t
 	left join goods g on g.goodsid = t.goodsid 
 	left join goodsex ge on t.goodsid = ge.goodsid
+	left join market m on t.marketid = m.marketid
 	where 1=1 
 	`
 
@@ -654,7 +656,10 @@ func (r *Tradeholderdetailex) buildSql() string {
 	sqlId.AndEx("t.goodsid", r.GOODSID, r.GOODSID > 0)
 	sqlId.AndEx("t.holderqty", r.HOLDERQTY, r.HOLDERQTY > 0)
 	if r.MarketIds != "" {
-		sqlId.JoinFormat("and t.marketid in (%s)", r.MarketIds)
+		sqlId.JoinFormat(" and t.marketid in (%s)", r.MarketIds)
+	}
+	if r.TradeModes != "" {
+		sqlId.JoinFormat(" and m.trademode in (%s)", r.TradeModes)
 	}
 	sqlId.OrderByDesc("t.tradetime")