Simon Zhou 5 tahun lalu
induk
melakukan
f50bc12dd4
1 mengubah file dengan 9 tambahan dan 9 penghapusan
  1. 9 9
      controllers/cptrade/cpTrade.go

+ 9 - 9
controllers/cptrade/cpTrade.go

@@ -76,10 +76,10 @@ func QueryPreasleApply(c *gin.Context) {
 	engine := db.GetEngine()
 	datas := make([]Cptradepresaleapply, 0)
 	// s := engine.Where("userid=?", req.UserID)
-	// if req.AccountID != 0 {
+	// if req.AccountID > 0 {
 	// 	s = s.And("accountid=?", req.AccountID)
 	// }
-	// if req.ApplyID != 0 {
+	// if req.ApplyID > 0 {
 	// 	s = s.And("applyid=?", req.ApplyID)
 	// }
 	sql := fmt.Sprintf(`select
@@ -110,10 +110,10 @@ func QueryPreasleApply(c *gin.Context) {
 						left join market m on t.MarketID = m.marketid
 						left join enumdicitem e on g.goodunitid = e.enumitemname and e.enumdiccode = 'goodsunit' 
 						where t.UserID = %d`, req.UserID)
-	if req.AccountID != 0 {
+	if req.AccountID > 0 {
 		sql += fmt.Sprintf(` and t.AccountID = %d`, req.AccountID)
 	}
-	if req.ApplyID != 0 {
+	if req.ApplyID > 0 {
 		sql += fmt.Sprintf(` and t.ApplyID = %d`, req.ApplyID)
 	}
 	if err := engine.SQL(sql).Find(&datas); err != nil {
@@ -302,10 +302,10 @@ func QueryPositionCancel(c *gin.Context) {
 						left join enumdicitem e on g.goodunitid = e.enumitemname and e.enumdiccode = 'goodsunit' 
 						left join systemmanager u on t.creatorid = u.autoid 
 						where t.userid = %d`, req.UserID)
-	if req.AccountID != 0 {
+	if req.AccountID > 0 {
 		sql += fmt.Sprintf(` and t.AccountID= %d`, req.AccountID)
 	}
-	if req.CancelID != 0 {
+	if req.CancelID > 0 {
 		sql += fmt.Sprintf(` and t.CancelID= %d`, req.CancelID)
 	}
 	engine := db.GetEngine()
@@ -381,13 +381,13 @@ func QueryPresaleGoodsEx(c *gin.Context) {
 	engine := db.GetEngine()
 	datas := make([]Cptradepresalegoodsex, 0)
 	s := engine.Where("1=1")
-	if req.GoodsID != 0 {
+	if req.GoodsID > 0 {
 		s = s.And("GoodsID=?", req.GoodsID)
 	}
-	if req.MarketID != 0 {
+	if req.MarketID > 0 {
 		s = s.And("MarketID=?", req.MarketID)
 	}
-	if req.PresaleMode != 0 {
+	if req.PresaleMode > 0 {
 		s = s.And("PresaleMode=?", req.PresaleMode)
 	}
 	if err := s.Find(&datas); err != nil {