فهرست منبع

fix bug: 查询履约合同报错

zou.yingbin 4 سال پیش
والد
کامیت
e2fa9be767
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 2 2
      controllers/ermcp/qryErmcp.go
  2. 3 3
      models/ermcp.go

+ 2 - 2
controllers/ermcp/qryErmcp.go

@@ -88,8 +88,8 @@ func QueryContract(c *gin.Context) {
 		return
 	}
 
-	if req.QueryType != 0 && req.QueryType != 1 && req.QueryType != 2 {
-		logger.GetLogger().Errorf("QueryType should in(0, 1, 2)")
+	if req.QueryType != 1 && req.QueryType != 2 && req.QueryType != 3 {
+		logger.GetLogger().Errorf("QueryType should in(1, 2, 3)")
 		appG.Response(http.StatusBadRequest, e.INVALID_PARAMS, nil)
 		return
 	}

+ 3 - 3
models/ermcp.go

@@ -73,7 +73,7 @@ func (r *ErmcpSpotContractModel) buildSql(nQueryType int32) string {
 		"       g.deliverygoodscode," +
 		"       g.deliverygoodsname," +
 		"       g2.goodscode," +
-		"       e.Enumdicname"+
+		"       e.Enumdicname" +
 		"  FROM ERMCP_SPOTCONTRACT t" +
 		"  left join useraccount u1" +
 		"    on t.buyuserid = u1.userid" +
@@ -201,11 +201,11 @@ func (r *ErmcpModel) buildSql(nContractType, nQueryType int32) string {
 		"   and t.contracttype in (%v) and t.userid=%v"
 
 	var status string
-	if 0 == nQueryType {
+	if 1 == nQueryType {
 		// 全部
 		status = "0,1,2,3,4,5,6"
 		str = str + " order by t.audittime desc"
-	} else if 1 == nQueryType {
+	} else if 2 == nQueryType {
 		// 待点价
 		status = "2"
 		str = str + "  and t.qty - t.pricedqty > 0 " +