123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- <?php
- namespace App\Admin\Controllers;
- use App\Admin\Actions\backstage\Docters\SignUp;
- use App\Admin\Actions\backstage\Docters\Team;
- use App\Models\Docter;
- use App\Models\DocterOrganization;
- use App\Models\Organization;
- use App\Models\User;
- use Encore\Admin\Controllers\AdminController;
- use Encore\Admin\Form;
- use Encore\Admin\Grid;
- use Encore\Admin\Show;
- class DoctorManagementController extends AdminController
- {
- /**
- * Title for current resource.
- *
- * @var string
- */
- protected $title = '医生列表';
- /**
- * Make a grid builder.
- *
- * @return Grid
- */
- protected function grid()
- {
- $grid = new Grid(new Docter());
- $grid->filter(function ($filter){
- $filter->disableIdFilter();
- $filter->like('name','昵称');
- $filter->equal('status','工作状态')->select([
- 0 => '禁用',
- 1 => '启用',
- ]);
- });
- $grid->actions(function ($actions) {
- // 去掉编辑
- $actions->disableEdit();
- // 去掉查看
- $actions->disableView();
- //签约管理
- $actions->add(new SignUp());
- //团队管理
- $actions->add(new Team());
- });
- $grid->column('id', __('Id'))->sortable();
- $grid->column('name', __('姓名'));
- $grid->column('avatar', __('头像'))->image('',50,50);
- $grid->column('score', __('评分'));
- $grid->column('service_persons', __('服务人数'));
- $states = [
- 'on' => ['value' => 1, 'text' => '启用', 'color' => 'primary'],
- 'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
- ];
- $grid->column('status', __('工作状态'))->switch($states);
- $grid->column('is_then', __('认证状态'))->using([0=>'未认证',1=>'已认证']);
- $grid->column('label', __('标签'))->label('info');
- return $grid;
- }
- /**
- * Make a show builder.
- *
- * @param mixed $id
- * @return Show
- */
- protected function detail($id)
- {
- $show = new Show(Docter::findOrFail($id));
- $show->field('id', __('Id'));
- $show->field('type', __('Type'));
- $show->field('name', __('Name'));
- $show->field('phone', __('Phone'));
- $show->field('sex', __('Sex'));
- $show->field('birthday', __('Birthday'));
- $show->field('avatar', __('Avatar'));
- $show->field('status', __('Status'));
- $show->field('label', __('Label'));
- $show->field('sign', __('Sign'));
- $show->field('intro', __('Intro'));
- $show->field('office_id', __('Office id'));
- $show->field('qualification_id', __('Qualification id'));
- $show->field('score', __('Score'));
- $show->field('service_persons', __('Service persons'));
- $show->field('eva_num', __('Eva num'));
- $show->field('service_days', __('Service days'));
- $show->field('phone_minutes', __('Phone minutes'));
- $show->field('chat_price', __('Chat price'));
- $show->field('phone_price', __('Phone price'));
- $show->field('appoint_price', __('Appoint price'));
- $show->field('is_chat', __('Is chat'));
- $show->field('is_phone', __('Is phone'));
- $show->field('is_appoint', __('Is appoint'));
- $show->field('latitude', __('Latitude'));
- $show->field('longitude', __('Longitude'));
- $show->field('created_at', __('Created at'));
- $show->field('updated_at', __('Updated at'));
- $show->field('user_id', __('User id'));
- $show->field('password', __('Password'));
- $show->field('is_then', __('Is then'));
- $show->field('practice', __('Practice'));
- $show->field('card_photo', __('Card photo'));
- $show->field('is_quail', __('Is quail'));
- $show->field('card_id', __('Card id'));
- $show->field('receiving_time', __('Receiving time'));
- return $show;
- }
- /**
- * Make a form builder.
- *
- * @return Form
- */
- protected function form()
- {
- $form = new Form(new Docter());
- $form->switch('status', __('状态'));
- return $form;
- }
- }
|