|
|
|
@ -22,26 +22,6 @@ class AdminFollowShowController extends AdminController
@@ -22,26 +22,6 @@ class AdminFollowShowController extends AdminController
|
|
|
|
|
$grid->column('username'); |
|
|
|
|
$grid->column('name'); |
|
|
|
|
$grid->column('roles')->pluck('name')->label('primary', 3); |
|
|
|
|
$grid->column('展示的数据')->display(function () { |
|
|
|
|
$info = AdminFollowShow::query()->where(['user_id' => $this['id']])->first(); |
|
|
|
|
if (!$info) { |
|
|
|
|
return ""; |
|
|
|
|
} else if ($info['type'] == '1') { |
|
|
|
|
return SecondaryCollege::query()->whereIn('id', $info['secondary_college_id'])->pluck("name", "id")->toArray(); |
|
|
|
|
} else if ($info['type'] == '2') { |
|
|
|
|
$list = Speciality::query()->whereIn('id', $info['speciality_id'])->get()->toArray(); |
|
|
|
|
if (empty($list)) { |
|
|
|
|
return []; |
|
|
|
|
} |
|
|
|
|
$select = []; |
|
|
|
|
foreach ($list as $item) { |
|
|
|
|
$college = SecondaryCollege::query()->where("id", $item["secondary_college_id"])->first(); |
|
|
|
|
$select[$item["id"]] = $item["speciality_name"] . "({$college->name})"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $select; |
|
|
|
|
} |
|
|
|
|
})->label('primary'); |
|
|
|
|
|
|
|
|
|
$grid->filter(function (Grid\Filter $filter) { |
|
|
|
|
$filter->panel(); |
|
|
|
|