Commit 7c037059 by 杨树贤

进入审核中判断条件新增

parent f99e3ecf
......@@ -74,24 +74,6 @@ class SupplierAttachmentApiController extends Controller
}
}
//判断是否要进入审核中状态,因为部分字段修改是不需要走审核的
private function checkNeedAudit($oldAttachment, $newAttachment)
{
$notNeedAuditField = [
'remark',
];
$diff = array_diff($oldAttachment, $newAttachment);
unset($diff['update_time']);
$changeField = array_keys($diff);
foreach ($changeField as $filed) {
//只要有一个不存在于不需要审核的字段,就返回需要审核
if (!in_array($filed, $notNeedAuditField)) {
return true;
}
}
return false;
}
//删除
public function DeleteSupplierAttachment($request)
{
......
......@@ -448,6 +448,14 @@ class SupplierAuditService
//判断是否要进入审核中状态,因为部分字段修改是不需要走审核的,这是更新之前的校验
public function checkNeedAudit($supplierId, $channel)
{
//只要不是已通过状态,修改任何字段都需要审核
$model = new SupplierChannelModel;
$status = $model->where('supplier_id', $supplierId)->value('status');
if ($status != SupplierChannelModel::STATUS_PASSED) {
return true;
}
$notNeedAuditField = [
'register_company_name',
'supplier_name_en',
......@@ -458,8 +466,6 @@ class SupplierAuditService
'system_tags',
'customer_tags',
'sku_tag',
'sku_tag',
'sku_tag',
'sku_upload_ruler',
'sku_audit_ruler',
'stockup_type'
......
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