Browse Source

no message

xingzai 2 years ago
parent
commit
3826dcf47e
1 changed files with 15 additions and 1 deletions
  1. 15 1
      controllers/report.go

+ 15 - 1
controllers/report.go

@@ -95,7 +95,21 @@ func (this *MobileReportController) TradeList() {
 		}
 		var condition string
 		var pars []interface{}
-		condition = " AND  a.category_id_two =  " + strconv.Itoa(v.CategoryId)
+
+		categoryIdSet, errCategory := models.GetdetailByCategoryIdSet(v.CategoryId)
+		if errCategory != nil {
+			br.Msg = "获取信息失败"
+			br.ErrMsg = "获取信息失败,Err:" + errCategory.Error() + "categoryID 不存在:" + strconv.Itoa(v.CategoryId)
+			return
+		}
+		if categoryIdSet != "" {
+			condition = ` AND a.category_id IN(` + categoryIdSet + `)`
+		} else {
+			condition = ` AND a.category_id IN(` + strconv.Itoa(v.CategoryId) + `)`
+		}
+		//condition = " AND  a.category_id_two =  " + strconv.Itoa(v.CategoryId)
+		//condition += " OR  a.category_id =  " + strconv.Itoa(v.CategoryId)
+
 		if ChartPermissionId != utils.CE_LUE_ID {
 			var pageSize int
 			if ChartPermissionId == utils.KE_JI_ID {