소스 검색

服务资格认证

jingyuzhi 4 년 전
부모
커밋
7d74123bb7

+ 26 - 0
app/Admin/Actions/Service/ApplysAction.php

xqd
@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Admin\Actions\Service;
+
+use App\Models\Docter;
+use Encore\Admin\Actions\RowAction;
+use App\Models\Serviceapplys;
+use Illuminate\Database\Eloquent\Model;
+use PHPUnit\Util\Filter;
+
+class ApplysAction extends RowAction
+{
+    public $name = '通过';
+
+    public function handle(Model $model)
+    {
+        // $model ...
+        Serviceapplys::where('id',$model->id)->update(['status'=>2]);
+        $filter = [1=>'is_chat',2=>'is_phone',3=>'is_appoint'];
+
+        Docter::where('id',$model->docter_id)->upd3ate([$filter[$model->service_type]=>1]);
+
+        return $this->response()->success('审核通过')->refresh();
+    }
+
+}

+ 20 - 0
app/Admin/Actions/Service/RefuseAction.php

xqd
@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Admin\Actions\Service;
+
+use App\Models\Serviceapplys;
+use Encore\Admin\Actions\RowAction;
+use Illuminate\Database\Eloquent\Model;
+
+class RefuseAction extends RowAction
+{
+    public $name = '驳回';
+
+    public function handle(Model $model)
+    {
+        // $model ...
+        Serviceapplys::where('id',$model->id)->update(['status'=>3]);
+        return $this->response()->success('拒绝通过')->refresh();
+    }
+
+}

+ 65 - 0
app/Admin/Controllers/OutpatientServiceCCController.php

xqd
@@ -0,0 +1,65 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Admin\Actions\Service\ApplysAction;
+use App\Admin\Actions\Service\RefuseAction;
+use App\Models\Serviceapplys;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class OutpatientServiceCCController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '门诊咨询认证';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Serviceapplys());
+
+        $grid->model()->where('service_type','3');
+        $grid->column('id', __('Id'));
+        $grid->column('docter.avatar', __('头像'))->image('',50,50);
+        $grid->column('docter.id', __('医生ID'));
+        $grid->column('docter.name','医生名称');
+        $grid->column('docter.sex','性别')->using([1=>'男',2=>'女']);
+        $grid->column('docter.DocterOrganization', __('所属机构'));
+//        $grid->column('docter.label', __('标签'))->map('ucwords')->implode('-');
+        $grid->column('docter.label', __('标签'))->label('info');
+
+        //$grid->column('service_type', __('服务类型'));
+
+        $grid->column('status', __('状态'))->using([1=>'审核',2=>'已通过',3=>'已拒绝'])->label([
+            1 => 'warning',
+            2 => 'success',
+            3 => 'default'
+        ]);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+//        $grid->column('service_type','123')->hide();
+
+        $grid->actions(function ($actions) {
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+
+            $actions->add(new ApplysAction());
+            $actions->add(new RefuseAction());
+        });
+        return $grid;
+    }
+}

+ 70 - 0
app/Admin/Controllers/PhoneServiceCCController.php

xqd
@@ -0,0 +1,70 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Admin\Actions\Service\ApplysAction;
+use App\Admin\Actions\Service\RefuseAction;
+use App\Models\Serviceapplys;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class PhoneServiceCCController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '电话咨询认证';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Serviceapplys());
+
+        $grid->model()->where('service_type','2');
+        $grid->column('id', __('Id'));
+        $grid->column('docter.avatar', __('头像'))->image('',50,50);
+        $grid->column('docter.id', __('医生ID'));
+        $grid->column('docter.name','医生名称');
+        $grid->column('docter.sex','性别')->using([1=>'男',2=>'女']);
+        $grid->column('docter.DocterOrganization', __('所属机构'));
+//        $grid->column('docter.label', __('标签'))->map('ucwords')->implode('-');
+        $grid->column('docter.label', __('标签'))->label('info');
+
+        //$grid->column('service_type', __('服务类型'));
+
+        $grid->column('status', __('状态'))->using([1=>'审核',2=>'已通过',3=>'已拒绝'])->label([
+            1 => 'warning',
+            2 => 'success',
+            3 => 'default'
+        ]);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        $grid->actions(function ($actions) {
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+
+
+            $actions->add(new ApplysAction());
+            $actions->add(new RefuseAction());
+        });
+
+
+
+        return $grid;
+    }
+}
+
+

+ 68 - 0
app/Admin/Controllers/ReplySevriceCCController.php

xqd
@@ -0,0 +1,68 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Admin\Actions\Service\ApplysAction;
+use App\Admin\Actions\Service\RefuseAction;
+use App\Models\Serviceapplys;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class ReplySevriceCCController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = '图文咨询认证';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Serviceapplys());
+
+        $grid->model()->where('service_type','1');
+        $grid->column('id', __('Id'));
+        $grid->column('docter.avatar', __('头像'))->image('',50,50);
+        $grid->column('docter.id', __('医生ID'));
+        $grid->column('docter.name','医生名称');
+        $grid->column('docter.sex','性别')->using([1=>'男',2=>'女']);
+        $grid->column('docter.DocterOrganization', __('所属机构'));
+//        $grid->column('docter.label', __('标签'))->map('ucwords')->implode('-');
+        $grid->column('docter.label', __('标签'))->label('info');
+
+        //$grid->column('service_type', __('服务类型'));
+
+        $grid->column('status', __('状态'))->using([1=>'审核',2=>'已通过',3=>'已拒绝'])->label([
+            1 => 'warning',
+            2 => 'success',
+            3 => 'default'
+        ]);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        $grid->actions(function ($actions) {
+            // 去掉删除
+            $actions->disableDelete();
+            // 去掉编辑
+            $actions->disableEdit();
+            // 去掉查看
+            $actions->disableView();
+
+
+            $actions->add(new ApplysAction());
+            $actions->add(new RefuseAction());
+        });
+
+
+
+        return $grid;
+    }
+}

+ 26 - 0
app/Models/Serviceapplys.php

xqd
@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Serviceapplys extends Model
+{
+    //
+    protected $table = 'service_applys';
+
+    public function docter(){
+        return $this->belongsTo(Docter::class);
+    }
+//    private static $_post_type =[
+//        1 => '图文',
+//        2 => '电话',
+//        3 => '问诊'
+//    ];
+
+//    private static $_post_status =[
+//        1 => '审核',
+//        2 => '通过',
+//        3 => '未通过'
+//    ];
+}