123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace App\Community\Controllers;
- use App\Models\Docter;
- use App\Models\DocterOrganization;
- use Encore\Admin\Controllers\AdminController;
- use Encore\Admin\Form;
- use Encore\Admin\Grid;
- use Encore\Admin\Show;
- class DocterOrgController extends AdminController
- {
- /**
- * Title for current resource.
- *
- * @var string
- */
- protected $title = '用户管理';
- /**
- * Make a grid builder.
- *
- * @return Grid
- */
- protected function grid()
- {
- $grid = new Grid(new DocterOrganization());
- $grid->disableCreateButton(false);
- $grid->column('id', __('Id'));
- $grid->column('docter.name', __('成员名称'));
- $grid->column('docter.sex', __('性别'))->display(function ($w){
- return $w==1?'男':'女';
- });;
- $grid->column('docter.phone', __('联系方式'));
- $grid->column('docter.email', __('邮箱'));
- $grid->column('docter.name', __('身份证号'));
- $grid->column('docter.name', __('成员身份'));
- $grid->column('docter.office_id', __('所属部门'));
- $grid->column('docter.qualification_id', __('认证资质'));
- $grid->column('updated_at', __('权限设置'));
- return $grid;
- }
- /**
- * Make a show builder.
- *
- * @param mixed $id
- * @return Show
- */
- protected function detail($id)
- {
- $show = new Show(DocterOrganization::findOrFail($id));
- $show->field('id', __('Id'));
- $show->field('docter_id', __('Docter id'));
- $show->field('organization_id', __('Organization id'));
- $show->field('created_at', __('Created at'));
- $show->field('updated_at', __('Updated at'));
- return $show;
- }
- /**
- * Make a form builder.
- *
- * @return Form
- */
- protected function form()
- {
- $form = new Form(new DocterOrganization());
- $form->select('docter_id', __('姓名'))->options(function (){
- return Docter::pluck('name','id');
- });
- return $form;
- }
- }
|