浏览代码

后:供方信息查询-高级查询-准入范围可多个关键字查询

MAC 5 年之前
父节点
当前提交
e32a948d01

+ 20 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -221,9 +221,26 @@ func (this *SelectController) GetTList() {
 	//}
 
 	having := ""
+	CerSubName := strings.Split(model.CerSubName, ",")
+	comma := strings.Contains(model.CerSubName, ",")
+
+	if comma {
+		CerSubName = strings.Split(model.CerSubName, ",")
+	} else {
+		CerSubName = strings.Split(model.CerSubName, ",")
+	}
+
 	//准入范围
 	if model.CerSubName != "" {
-		having = " having CerSubName like '%" + model.CerSubName + "%' "
+		for key, value := range CerSubName {
+			if key == 0 {
+				where += " and (d.Name like '%" + value + "%' "
+			} else {
+				where += "or d.Name like '%" + value + "%' "
+			}
+		}
+		where += ") "
+		//having = " having CerSubName like '%" + model.CerSubName + "%' "
 		leftjoin = "left join " + OilSupplierCertSubName + " d  on d.SupplierCertId = b.Id "
 	}
 	//资质
@@ -231,7 +248,8 @@ func (this *SelectController) GetTList() {
 		having = " having NeedFileType like '%" + model.NeedFileType + "%' "
 	}
 	if model.CerSubName != "" && model.NeedFileType != "" {
-		having = " having CerSubName like '%" + model.CerSubName + "%' and  NeedFileType like '%" + model.NeedFileType + "%' "
+		//having = " having CerSubName like '%" + model.CerSubName + "%' and  NeedFileType like '%" + model.NeedFileType + "%' "
+		having = " having NeedFileType like '%" + model.NeedFileType + "%' "
 		leftjoin = "left join " + OilSupplierCertSubName + " d  on d.SupplierCertId = b.Id "
 	}
 	svc := selectbusiness.GetSelectService(utils.DBE)

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/select/companyselect/index.vue

@@ -732,7 +732,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="准入范围">
-              <el-input size="mini" v-model="searchForm.CerSubName" placeholder="请输入内容"></el-input>
+              <el-input size="mini" v-model="searchForm.CerSubName" placeholder="请输入内容,多个用逗号隔开"></el-input>
             </el-form-item>
           </el-col>
         </el-row>