|
@@ -77,7 +77,8 @@ class CustomFieldController extends Controller
|
|
|
$nameRuleGroup = NamingRule::query()->where('id',$nameGroupId)->get();
|
|
|
$allGroups=config("custom-field.groups");
|
|
|
if(!empty($nameRuleGroup)){
|
|
|
- if(!in_array($allGroups,$nameRuleGroup->pluck('id')->toArray())){
|
|
|
+ //array_intersect 函数,它返回两个数组的交集
|
|
|
+ if(empty(array_intersect($allGroups,$nameRuleGroup->pluck('id')->toArray()))){
|
|
|
throw new \Exception("Please contact the administrator to add the namerule configuration.");
|
|
|
}
|
|
|
}
|