Browse Source

namerule和custom fields分组

kely 11 tháng trước cách đây
mục cha
commit
3a79599fe1

+ 0 - 21
app/Http/Controllers/API/CustomFieldController.php

@@ -51,21 +51,7 @@ class CustomFieldController extends Controller
 
     public function groups()
     {
-        $nameRuleGroups=NamingRule::query()->get()->pluck('id')->toArray();
         $allGroups=config("custom-field.groups");
-
-        if(!empty($nameRuleGroups)){
-            $notNameRule = [];
-            foreach ($allGroups as $group) {
-                if (!in_array($group, $nameRuleGroups)) {
-                    $notNameRule[] = $group;
-                }
-            }
-            return $this->success([
-                'data' => $notNameRule
-            ]);
-        }
-
         return $this->success([
             'data'=> $allGroups
         ]);
@@ -75,13 +61,6 @@ class CustomFieldController extends Controller
     {
         $nameGroupId=$request->get('nameGroupId');
         $nameRuleGroup = NamingRule::query()->where('id',$nameGroupId)->get();
-        $allGroups=config("custom-field.groups");
-        if(!empty($nameRuleGroup)){
-            //array_intersect 函数,它返回两个数组的交集
-            if(empty(array_intersect($allGroups,$nameRuleGroup->pluck('id')->toArray()))){
-                throw new \Exception("Please contact the administrator to add the namerule configuration.");
-            }
-        }
 
         return NamingRuleSimpleResource::collection($nameRuleGroup);
     }

+ 0 - 1
config/custom-field.php

@@ -7,6 +7,5 @@ return [
     'groups' => [
         'task',
         'project',
-        '1',
     ]
 ];