Browse Source

给查询供应商名字添加了限制

mainqaq 3 years ago
parent
commit
ee84cc1b37
1 changed files with 1 additions and 1 deletions
  1. 1 1
      service/supply_service.go

+ 1 - 1
service/supply_service.go View File

282
 //查询供应商的名字是否有重复
282
 //查询供应商的名字是否有重复
283
 func FindSupplierName(supplierName string, orgId int64) (sbool bool, err error) {
283
 func FindSupplierName(supplierName string, orgId int64) (sbool bool, err error) {
284
 	var total int
284
 	var total int
285
-	err = XTReadDB().Model(&models.SpSupplierName{}).Where("supplier_name = ? and status = 1", supplierName).Count(&total).Error
285
+	err = XTReadDB().Model(&models.SpSupplierName{}).Where("supplier_name = ? and user_org_id = ? and status = 1", supplierName, orgId).Count(&total).Error
286
 	if total != 0 {
286
 	if total != 0 {
287
 		sbool = true
287
 		sbool = true
288
 	} else {
288
 	} else {