瀏覽代碼

修改BUG

zhouxnsz 1 年之前
父節點
當前提交
925c884457
共有 7 個文件被更改,包括 17 次插入15 次删除
  1. 5 5
      controllers/mine/myposition.go
  2. 1 1
      controllers/sbyj/order.go
  3. 2 2
      docs/docs.go
  4. 2 2
      docs/swagger.json
  5. 2 2
      docs/swagger.yaml
  6. 4 2
      models/mine.go
  7. 1 1
      models/sbyj.go

+ 5 - 5
controllers/mine/myposition.go

@@ -11,9 +11,9 @@ import (
 // @Summary  我的持仓-预售持仓
 // @Produce  json
 // @Security ApiKeyAuth
-// @Param    userid    query    int true  "用户ID"
-// @Param    page      query    int false "页码"
-// @Param    pagesize  query    int false "每页条数"
+// @Param    userid    query    int    true  "用户ID"
+// @Param    page      query    int    false "页码"
+// @Param    pagesize  query    int    false "每页条数"
 // @Success  200      {array}  models.MineCpTradePreSaleResult
 // @Failure  500       {object} app.Response
 // @Router   /Mine/QueryMineCpTradePreSaleResults [get]
@@ -113,8 +113,8 @@ func QueryMineTradeTradeDetails(c *gin.Context) {
 // @Produce  json
 // @Security ApiKeyAuth
 // @Param    userid    query    int    true  "用户ID"
-// @Param    buyorsell query    int false "交收方向 - 0:买 1:卖,不过滤方法不要传此参数"
-// @Param    marketids query    int false "目标市场ID列表,格式 1,2,3"
+// @Param    buyorsell query    int    false "交收方向 - 0:买 1:卖,不过滤方法不要传此参数"
+// @Param    marketids query    string false "目标市场ID列表,格式 1,2,3"
 // @Param    page      query    int    false "页码"
 // @Param    pagesize  query    int    false "每页条数"
 // @Success  200       {array}  models.MineTradeGoodsDeliveryOffline

+ 1 - 1
controllers/sbyj/order.go

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

+ 2 - 2
docs/docs.go

@@ -14416,7 +14416,7 @@ const docTemplate = `{
                         "in": "query"
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "目标市场ID列表,格式 1,2,3",
                         "name": "marketids",
                         "in": "query"
@@ -23656,7 +23656,7 @@ const docTemplate = `{
                         "in": "query"
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "目标市场ID列表,格式 1,2,3",
                         "name": "marketids",
                         "in": "query"

+ 2 - 2
docs/swagger.json

@@ -14407,7 +14407,7 @@
                         "in": "query"
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "目标市场ID列表,格式 1,2,3",
                         "name": "marketids",
                         "in": "query"
@@ -23647,7 +23647,7 @@
                         "in": "query"
                     },
                     {
-                        "type": "integer",
+                        "type": "string",
                         "description": "目标市场ID列表,格式 1,2,3",
                         "name": "marketids",
                         "in": "query"

+ 2 - 2
docs/swagger.yaml

@@ -40712,7 +40712,7 @@ paths:
       - description: 目标市场ID列表,格式 1,2,3
         in: query
         name: marketids
-        type: integer
+        type: string
       - description: 页码
         in: query
         name: page
@@ -46565,7 +46565,7 @@ paths:
       - description: 目标市场ID列表,格式 1,2,3
         in: query
         name: marketids
-        type: integer
+        type: string
       - description: 页码
         in: query
         name: page

+ 4 - 2
models/mine.go

@@ -1053,9 +1053,11 @@ func (r *MineTradeGoodsDeliveryOffline) buildSql() string {
  where 1 = 1 
 	`
 	sqlId.And("t.userid", r.USERID)
-	sqlId.AndEx("t.buyorsell", r.BUYORSELL, r.BUYORSELL != nil)
+	if r.BUYORSELL != nil {
+		sqlId.And("t.buyorsell", *r.BUYORSELL)
+	}
 	if r.MarketIds != "" {
-		sqlId.JoinFormat("t.marketid in (%s)", r.MarketIds)
+		sqlId.JoinFormat("and t.marketid in (%s)", r.MarketIds)
 	}
 	sqlId.OrderByDesc("t.reqtime")
 

+ 1 - 1
models/sbyj.go

@@ -628,7 +628,7 @@ 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("t.marketid in (%s)", r.MarketIds)
+		sqlId.JoinFormat("and t.marketid in (%s)", r.MarketIds)
 	}
 	sqlId.OrderByDesc("t.tradetime")