xingzai před 3 roky
rodič
revize
4b2c69eed3
2 změnil soubory, kde provedl 22 přidání a 0 odebrání
  1. 15 0
      controllers/report.go
  2. 7 0
      models/industrial_management.go

+ 15 - 0
controllers/report.go

@@ -1901,6 +1901,21 @@ func (this *ReportController) IndustryListByDepartmentPc() {
 		} else if articleIdSub == "" && articleIdInd == "" {
 			articleIdGroup = articleIdInd
 		}
+		slice := strings.Split(keyWord, "/")
+		if len(slice) > 1 {
+			for _, v := range slice {
+				subjectId, err := models.GetcygxIndustrialSubjectByName(v)
+				if err != nil {
+					br.Msg = "获取信息失败"
+					br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
+					return
+				}
+				if subjectId != "" {
+
+				}
+				fmt.Println(v)
+			}
+		}
 	}
 
 	if articleIdGroup != "" {

+ 7 - 0
models/industrial_management.go

@@ -262,6 +262,13 @@ func GetcygxIndustrialSubject(industrialManagementId int) (items []*IndustrialSu
 	return
 }
 
+func GetcygxIndustrialSubjectByName(name string) (industrial_management_id string, err error) {
+	o := orm.NewOrm()
+	sql := `	SELECT industrial_subject_id FROM cygx_industrial_subject  WHERE subject_name = ?`
+	err = o.Raw(sql, name).QueryRow(&industrial_management_id)
+	return
+}
+
 func UpdateIndustrialManagementSubjectNames(nameStr string, industrialManagementId int) (err error) {
 	o := orm.NewOrm()
 	sql := `UPDATE cygx_industrial_management SET subject_names = ? WHERE industrial_management_id = ?`