diff --git a/app/AdminSupplier/Controllers/IndustryProductController.php b/app/AdminSupplier/Controllers/IndustryProductController.php index 83fd64d..73460c0 100644 --- a/app/AdminSupplier/Controllers/IndustryProductController.php +++ b/app/AdminSupplier/Controllers/IndustryProductController.php @@ -281,20 +281,6 @@ class IndustryProductController extends AdminController else if (!in_array($form->model()->status, $user_status) || !in_array($form->status, $user_status)) { $form->deleteInput('status'); } - - //因extends是数组,具有一定的特殊性,不能直接用$form->saved方法中的wasChanged判断是否修改,所以只能在这里做特殊处理 - if (!is_null($form->extends)) { - $old_extends = array_filter($form->model()->extends, fn($v, $k) => str_contains($k, 'field_' . $form->model()->type) && !empty($v), ARRAY_FILTER_USE_BOTH); - $new_extends = array_filter($form->extends, fn($v, $k) => str_contains($k, 'field_' . $form->model()->type) && !empty($v), ARRAY_FILTER_USE_BOTH); - - $old = $new = []; - array_walk_recursive($old_extends, function($v) use (&$old) {if ($v !== null) $old[] = $v;}); - array_walk_recursive($new_extends, function($v) use (&$new) {if ($v !== null) $new[] = $v;}); - - if (array_diff($old, $new)) { - $form->status = ProductStatus::UNAUDITED; - } - } } $form->deleteInput('single_deposit'); //交易金单价只能是总后台设置