Browse Source

Merge branch 'master' of ssh://git.9026.com:2212/swdz-WangHaijun/BaoMa

Swdz-WangHaiJun 4 năm trước cách đây
mục cha
commit
0406cd0b6a

+ 1 - 1
app/Admin/Actions/backstage/Docters/SignUp.php

xqd
@@ -12,7 +12,7 @@ class SignUp extends RowAction
     public function handle(Model $model)
     {
         // $model ...
-        return $this->response()->success('跳转档案库成功')->redirect('/admin/sign_up?docter_id='.$this->row->id.'');
+        return $this->response()->success('跳转签约管理成功')->redirect('/admin/sign_up?docter_id='.$this->row->id.'');
     }
 
 }

+ 19 - 0
app/Admin/Actions/backstage/Docters/Team.php

xqd
@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Admin\Actions\backstage\Docters;
+
+use Encore\Admin\Actions\RowAction;
+use Illuminate\Database\Eloquent\Model;
+
+class Team extends RowAction
+{
+    public $name = '团队管理';
+
+    public function handle(Model $model)
+    {
+        // $model ...
+
+        return $this->response()->success('跳转团队管理成功')->redirect('/admin/docter_team?docter_id='.$this->row->id.'');
+    }
+
+}

+ 2 - 0
app/Admin/Actions/backstage/Pass.php

xqd xqd
@@ -2,6 +2,7 @@
 
 namespace App\Admin\Actions\backstage;
 
+use App\Models\Docter;
 use App\Models\DocterOrganization;
 use Encore\Admin\Actions\RowAction;
 use Illuminate\Database\Eloquent\Model;
@@ -15,6 +16,7 @@ class Pass extends RowAction
 //         $model ...
 //        dd($model);
         DocterOrganization::where('id',$model->id)->update(['state'=>2]);
+        Docter::where('id',$model->docter_id)->update(['is_then'=>1]);
         return $this->response()->success('审核通过')->refresh();
     }
 

+ 1 - 0
app/Admin/Actions/backstage/Refuse.php

xqd
@@ -13,6 +13,7 @@ class Refuse extends RowAction
     {
         // $model ...
         DocterOrganization::where('id',$model->id)->update(['state'=>3]);
+        
         return $this->response()->success('审核拒绝')->refresh();
     }
 

+ 5 - 2
app/Admin/Controllers/ApproveController.php

xqd
@@ -33,17 +33,20 @@ class ApproveController extends AdminController
         $grid ->model()->where('state','>=','1');
         $grid->column('id', __('Id'));
         $grid->column('docter.id', __('医生ID'));
-        $grid->column('docter.name', __('名字'));
+        $grid->column('docter.name', __('医生姓名'));
+        $grid->column('docter.avatar', __('医生头像'))->image(50,50);
         $grid->column('docter.sex', __('性别'))->using([0=>'未知',1=>'男',2=>'女']);
-        $grid->column('docter.card_id', __('身份证'));
         $grid->column('organization.name', __('机构'));
         $grid->column('office.name', __('科室'));
         $grid->column('qualification.name', __('医生资质'));
         $grid->column('state', __('状态'))->using([1=>'待审核',2=>'已认证',3=>'已驳回']);
 
         $grid->actions(function ($actions) {
+            //通过申请
             $actions->add(new Pass());
+            //驳回申请
             $actions->add(new Refuse());
+            //撤销申请
             $actions->add(new Revoke());
         });
         return $grid;

+ 80 - 0
app/Admin/Controllers/DocterTeamController.php

xqd
@@ -0,0 +1,80 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\TeamDocter;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class DocterTeamController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '团队管理';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new TeamDocter());
+
+        $docter_id = \request('docter_id');
+        $grid->filter(function ($filter){
+            $filter->disableIdFilter();
+            $filter->equal('docter_id','医生');
+        });
+        //关闭操作栏
+        $grid->disableActions();
+
+        $grid->column('id', __('Id'));
+        $grid->column('docter_id', __('医生id'));
+        $grid->column('docter.name', __('医生姓名'));
+        $grid->column('team_id', __('团队id'));
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(TeamDocter::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('docter_id', __('Docter id'));
+        $show->field('team_id', __('Team 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 TeamDocter());
+
+        $form->number('docter_id', __('Docter id'));
+        $form->number('team_id', __('Team id'));
+
+        return $form;
+    }
+}

+ 4 - 0
app/Admin/Controllers/DoctorManagementController.php

xqd xqd
@@ -3,6 +3,7 @@
 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;
@@ -45,7 +46,10 @@ class DoctorManagementController extends AdminController
             $actions->disableEdit();
             // 去掉查看
             $actions->disableView();
+            //签约管理
             $actions->add(new SignUp());
+            //团队管理
+            $actions->add(new Team());
         });
 
         $grid->column('id', __('Id'))->sortable();

+ 2 - 0
app/Admin/routes.php

xqd
@@ -52,5 +52,7 @@ Route::group([
     $router->resource('qualifications', QualificationsController::class);
     //医生管理->签约管理
     $router->resource('sign_up', SignUpController::class);
+    //医生管理->团队管理
+    $router->resource('docter_team', DocterTeamController::class);
 });