Browse Source

fix: ETA商家行业筛选

hsun 1 year ago
parent
commit
5f15c3f428
2 changed files with 11 additions and 0 deletions
  1. 10 0
      controllers/eta_business/eta_business.go
  2. 1 0
      models/eta_business/eta_business.go

+ 10 - 0
controllers/eta_business/eta_business.go

@@ -27,6 +27,7 @@ type EtaBusinessController struct {
 // @Param   SigningStatus	query	string	false	"签约状态: 1-首次签约; 2-续约中; 3-已终止"
 // @Param   Province		query	string	false	"省份筛选"
 // @Param   City			query	string	false	"城市筛选"
+// @Param   IndustryId		query	int	false	"行业ID"
 // @Param   SortParam		query	int	false	"排序字段: 1-签约时间; 2-到期时间; 3-创建时间; 4-用户上限"
 // @Param   SortType		query	int	false	"排序类型: 1-正序; 2-倒序"
 // @Success 200 Ret=200 获取成功
@@ -153,6 +154,13 @@ func (this *EtaBusinessController) PageList() {
 			cond += fmt.Sprintf(` AND %s IN (%s)`, eta_business.EtaBusinessColumns.City, utils.GetOrmInReplace(len(cityArr)))
 			pars = append(pars, cityArr)
 		}
+
+		// 行业
+		industryId, _ := this.GetInt("IndustryId", 0)
+		if industryId > 0 {
+			cond += fmt.Sprintf(` AND %s = ?`, eta_business.EtaBusinessColumns.IndustryId)
+			pars = append(pars, industryId)
+		}
 	}
 
 	order := ``
@@ -212,6 +220,7 @@ func (this *EtaBusinessController) PageList() {
 		b.UserMax = v.UserMax
 		b.SigningStatus = v.SigningStatus
 		b.Enable = v.Enable
+		b.ContractId = v.ContractId
 		b.SigningTime = v.SigningTime.Format(utils.FormatDate)
 		b.ExpiredTime = v.ExpiredTime.Format(utils.FormatDate)
 		b.CreateTime = v.CreateTime.Format(utils.FormatDateTime)
@@ -1010,6 +1019,7 @@ func (this *EtaBusinessController) Detail() {
 	resp.UserMax = item.UserMax
 	resp.SigningStatus = item.SigningStatus
 	resp.Enable = item.Enable
+	resp.ContractId = item.ContractId
 	resp.SigningTime = item.SigningTime.Format(utils.FormatDate)
 	resp.ExpiredTime = item.ExpiredTime.Format(utils.FormatDate)
 	resp.CreateTime = item.CreateTime.Format(utils.FormatDateTime)

+ 1 - 0
models/eta_business/eta_business.go

@@ -314,6 +314,7 @@ type EtaBusinessItem struct {
 	UserMax          int    `description:"用户上限"`
 	SigningStatus    int    `description:"签约状态:1-首次签约;2-续约中;3-已终止"`
 	Enable           int    `description:"状态:0-禁用;1-启用"`
+	ContractId       int    `description:"当前合约ID"`
 	SigningTime      string `description:"当前合约的签约时间"`
 	ExpiredTime      string `description:"当前合约的到期时间"`
 	CreateTime       string `description:"创建时间"`