| xqd
@@ -26,9 +26,13 @@ class WorkPointController extends BaseController
|
|
|
if($request->input('project_id')) {
|
|
|
$items = $items->where('project_id', $request->input('project_id'));
|
|
|
}
|
|
|
+
|
|
|
if($request->input('type') == 'drop_menu') {
|
|
|
+ $user = Auth::guard('mini')->user();
|
|
|
+
|
|
|
+ $project_ids = ProjectUser::where('user_id', $user->id)->pluck('project_id')->toArray();
|
|
|
|
|
|
- $items = $items->select('name as text', 'id as value')->get();
|
|
|
+ $items = $items->select('name as text', 'id as value')->whereIn('project_id',$project_ids)->get();
|
|
|
$items = $items->prepend(collect(['text' => '所需工点', 'value' => '']));
|
|
|
return $this->success(['data' => $items]);
|
|
|
}
|