Selaa lähdekoodia

我的询价接口增加询价消息功能

zhou.xiaoning 3 vuotta sitten
vanhempi
commit
320388750e
5 muutettua tiedostoa jossa 46 lisäystä ja 2 poistoa
  1. 2 0
      controllers/guangzuan/wrposition.go
  2. 12 0
      docs/docs.go
  3. 12 0
      docs/swagger.json
  4. 8 0
      docs/swagger.yaml
  5. 12 2
      models/guangzuan.go

+ 2 - 0
controllers/guangzuan/wrposition.go

@@ -120,6 +120,7 @@ func QueryMyDeListing(c *gin.Context) {
 // @Param    page            query    int    false "页码"
 // @Param    pagesize        query    int    false "每页条数"
 // @Param    applystatus query    int false "申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中"
+// @Param    type        query    int false "查询类型 - 0:我的询价 1:我订单的询价"
 // @Success  200         {array}  models.MyBargainApply
 // @Failure  500             {object} app.Response
 // @Router   /Guangzuan/QueryMyBargainApply [get]
@@ -141,6 +142,7 @@ func QueryMyBargainApply(c *gin.Context) {
 // @Param    page            query    int    false "页码"
 // @Param    pagesize        query    int    false "每页条数"
 // @Param    applystatus query    int false "申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中"
+// @Param    type        query    int false "查询类型 - 0:我的询价 1:我订单的询价"
 // @Success  200         {array}  models.MyDelistingApply
 // @Failure  500             {object} app.Response
 // @Router   /Guangzuan/QueryMyDelistingApply [get]

+ 12 - 0
docs/docs.go

@@ -7766,6 +7766,12 @@ const docTemplate = `{
                         "description": "申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中",
                         "name": "applystatus",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "查询类型 - 0:我的询价 1:我订单的询价",
+                        "name": "type",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -8030,6 +8036,12 @@ const docTemplate = `{
                         "description": "申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中",
                         "name": "applystatus",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "查询类型 - 0:我的询价 1:我订单的询价",
+                        "name": "type",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 12 - 0
docs/swagger.json

@@ -7757,6 +7757,12 @@
                         "description": "申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中",
                         "name": "applystatus",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "查询类型 - 0:我的询价 1:我订单的询价",
+                        "name": "type",
+                        "in": "query"
                     }
                 ],
                 "responses": {
@@ -8021,6 +8027,12 @@
                         "description": "申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中",
                         "name": "applystatus",
                         "in": "query"
+                    },
+                    {
+                        "type": "integer",
+                        "description": "查询类型 - 0:我的询价 1:我订单的询价",
+                        "name": "type",
+                        "in": "query"
                     }
                 ],
                 "responses": {

+ 8 - 0
docs/swagger.yaml

@@ -27208,6 +27208,10 @@ paths:
         in: query
         name: applystatus
         type: integer
+      - description: 查询类型 - 0:我的询价 1:我订单的询价
+        in: query
+        name: type
+        type: integer
       produces:
       - application/json
       responses:
@@ -27372,6 +27376,10 @@ paths:
         in: query
         name: applystatus
         type: integer
+      - description: 查询类型 - 0:我的询价 1:我订单的询价
+        in: query
+        name: type
+        type: integer
       produces:
       - application/json
       responses:

+ 12 - 2
models/guangzuan.go

@@ -1503,6 +1503,7 @@ type MyBargainApply struct {
 
 	QTY float64 `json:"qty" xorm:"QTY"` // 申请数量
 
+	TYPE   int              `json:"-" form:"type"` // 查询类型 - 0:我的询价 1:我订单的询价
 	PageEx `xorm:"extends"` // 页码信息
 }
 
@@ -1553,7 +1554,11 @@ func (r *MyBargainApply) buildSql() string {
 	WHERE t.marketid=67201
 	`
 
-	sqlId.And("t.USERID", r.USERID)
+	if r.TYPE == 0 {
+		sqlId.And("t.USERID", r.USERID)
+	} else {
+		sqlId.And("t.MatchUserID", r.USERID)
+	}
 	sqlId.AndEx("t.APPLYSTATUS", r.APPLYSTATUS, r.APPLYSTATUS > 0)
 	sqlId.OrderByDesc("t.WRBARGAINID")
 
@@ -1619,6 +1624,7 @@ type MyDelistingApply struct {
 	SUBNUM               int32     `json:"subnum" xorm:"SUBNUM"`                                          // 卖方提单子单号
 	MARKETID             int32     `json:"marketid" xorm:"MARKETID"`                                      // 市场ID
 
+	TYPE   int              `json:"-" form:"type"` // 查询类型 - 0:我的询价 1:我订单的询价
 	PageEx `xorm:"extends"` // 页码信息
 }
 
@@ -1676,7 +1682,11 @@ func (r *MyDelistingApply) buildSql() string {
 	WHERE t.marketid=67201
 	`
 
-	sqlId.And("t.SELLUSERID", r.SELLUSERID)
+	if r.TYPE == 0 {
+		sqlId.And("t.SELLUSERID", r.SELLUSERID)
+	} else {
+		sqlId.And("t.BuyUserID", r.SELLUSERID)
+	}
 	sqlId.AndEx("t.APPLYSTATUS", r.APPLYSTATUS, r.APPLYSTATUS > 0)
 	sqlId.OrderByDesc("t.SELLDELISTINGAPPLYID")