Commit 1b3d7409 by 杨树贤

临时处理数据

parent 60ff9016
......@@ -295,8 +295,12 @@ class SupplierApiController extends Controller
//如果是编辑操作,则要忽略非当前
if ($supplierId) {
if (in_array($supplierId, [195, 12263])) {
$this->response(0, '供应商名称合理');
}
$originSupplierName = $model->where('supplier_id', $supplierId)->value('supplier_name');
$existedSupplierName = $model->where('supplier_name', $supplierName)->where('supplier_name','!=',$originSupplierName)
$existedSupplierName = $model->where('supplier_name', $supplierName)->where('supplier_name', '!=',
$originSupplierName)
->value('supplier_name');
if ($supplierName !== $existedSupplierName) {
$supplierName = $model->where('supplier_name', 'like',
......@@ -304,8 +308,8 @@ class SupplierApiController extends Controller
if (!empty($supplierName)) {
$this->response(-2, '存在类似的供应商名称', $supplierName);
}
}else{
$this->response(-1,'该供应商名称已经存在');
} else {
$this->response(-1, '该供应商名称已经存在');
}
} else {
$existedSupplierName = $model->where('supplier_name', $supplierName)
......
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