Ver código fonte

fix_服务商搜索

Ethan 1 semana atrás
pai
commit
19d51a359b

+ 2 - 2
app/dao/supplier_dao.go

@@ -22,12 +22,12 @@ func (d SupplierDao) GetSuppliersByMsg(fieldName string) ([]*entity.Supplier, er
 	var suppliers []*entity.Supplier
 	supplierId, err := strconv.ParseInt(fieldName, 10, 64)
 	if err == nil {
-		err1 := Db.Debug().Model(&entity.Supplier{}).Where("supplier_id = ? AND supplier_type != 0", supplierId).First(&suppliers).Error
+		err1 := Db.Debug().Model(&entity.Supplier{}).Where("supplier_name = ? OR company_name = ? OR name = ? or supplier_id = ?", fieldName, fieldName, fieldName, supplierId).Find(&suppliers).Error
 		if err1 != nil && err1 != gorm.ErrRecordNotFound {
 			return nil, err1
 		}
 	} else {
-		err1 := Db.Debug().Model(&entity.Supplier{}).Where("supplier_name = ? OR company_name = ? OR name = ? AND supplier_type != 0", fieldName, fieldName, fieldName).Find(&suppliers).Error
+		err1 := Db.Debug().Model(&entity.Supplier{}).Where("supplier_name = ? OR company_name = ? OR name = ?", fieldName, fieldName, fieldName).Find(&suppliers).Error
 		if err1 != nil {
 			return nil, err
 		}

+ 1 - 0
app/service/cooperation_service.go

@@ -30,6 +30,7 @@ func (s CooperationService) SearchSupplier(param *vo.SupplierSearchParam) ([]*vo
 			SupplierType: supplier.SupplierType,
 			CompanyName:  supplier.CompanyName,
 			Name:         supplier.Name,
+			ReviewStatus: supplier.ReviewStatus,
 			Existence:    exist,
 		}
 		reSupplierPreviews = append(reSupplierPreviews, reSupplierPreview)

+ 2 - 2
app/vo/re_supplier_preview.go

@@ -7,6 +7,6 @@ type ReSupplierPreview struct {
 	SupplierType int64  `json:"supplierType"` // 服务商类型,1为个人PR,2为机构
 	CompanyName  string `json:"companyName"`  // 公司名称
 	Name         string `json:"name"`         // 个人姓名
-
-	Existence bool `json:"existence"` // 已在库
+	ReviewStatus int64  `json:"reviewStatus"` // 1未认证,2已认证
+	Existence    bool   `json:"existence"`    // 已在库
 }

+ 1 - 1
app/vo/supplier_search_param.go

@@ -1,7 +1,7 @@
 package vo
 
 type SupplierSearchParam struct {
-	FieldName    string `json:"field_name"`
+	FieldName    string `json:"field_name"` // 服务商名称/认证名/ID
 	EnterpriseId string `json:"enterprise_id"`
 	SubAccountId int64  `json:"sub_account_id"`
 }