Commit ba86941a by 杨树贤

账号判断问题

parent 07f7612e
...@@ -43,6 +43,7 @@ class SupplierAccountValidator ...@@ -43,6 +43,7 @@ class SupplierAccountValidator
//return '该供应商没有绑定SKU采购,请完善相关信息'; //return '该供应商没有绑定SKU采购,请完善相关信息';
} }
$supplierCount = $model->where('supplier_code', $account['supplier_code']) $supplierCount = $model->where('supplier_code', $account['supplier_code'])
->where('parent_id',0)
->count(); ->count();
if ($supplierCount > 0) { if ($supplierCount > 0) {
return '该供应商已经存在账号'; return '该供应商已经存在账号';
...@@ -55,6 +56,7 @@ class SupplierAccountValidator ...@@ -55,6 +56,7 @@ class SupplierAccountValidator
} else { } else {
$supplierCount = $model->where('id', '!=', $account['id']) $supplierCount = $model->where('id', '!=', $account['id'])
->where('supplier_code', $account['supplier_code']) ->where('supplier_code', $account['supplier_code'])
->where('parent_id',0)
->count(); ->count();
if ($supplierCount > 0) { if ($supplierCount > 0) {
return '该供应商已经存在账号'; return '该供应商已经存在账号';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment