浏览代码

更新认证管理

ChenWuJie 4 年之前
父节点
当前提交
3ba6aa43ab

+ 1 - 1
app/Admin/Actions/backstage/Pass.php

xqd
@@ -17,7 +17,7 @@ class Pass extends RowAction
 //        dd($model);
         $end_time = strtotime('+1year');
         $authentication_end_time = date('Y-m-d H:i:s',$end_time);
-        DocterOrganization::where('id',$model->id)->update(['state'=>2,
+        DocterOrganization::where('id',$model->id)->update(['state'=>1,
                                                             'authentication_time'=>date('Y-m-d H:i:s'),
                                                             'authentication_end_time'=>$authentication_end_time]
                                                             );

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

xqd
@@ -12,7 +12,7 @@ class Refuse extends RowAction
     public function handle(Model $model)
     {
         // $model ...
-        DocterOrganization::where('id',$model->id)->update(['state'=>0,'authentication_time'=>0,'authentication_end_time'=>0]);
+        DocterOrganization::where('id',$model->id)->update(['state'=>2,'authentication_time'=>0,'authentication_end_time'=>0]);
 
         return $this->response()->success('审核驳回')->refresh();
     }

+ 3 - 5
app/Admin/Actions/backstage/Revoke.php

xqd xqd
@@ -19,7 +19,7 @@ class Revoke extends RowAction
         $docter_approve_num_array = $docter_approve_num->toarray();
         foreach ($docter_approve_num_array as $value)
         {
-            if ($value['state'] == 2)
+            if ($value['state'] == 1)
             {
                 $is_pass_num=$is_pass_num+1;
             }
@@ -28,16 +28,14 @@ class Revoke extends RowAction
         if($is_pass_num > 1)
         {
             //撤销到社区端
-            DocterOrganization::where('id',$model->id)->update(['state'=>0,'authentication_time'=>'']);
+            DocterOrganization::where('id',$model->id)->update(['state'=>0,'authentication_time'=>'','authentication_end_time'=>0]);
         }
         if ($is_pass_num ==1)
         {
             DocterOrganization::where('id',$model->id)->update(['state'=>0,'authentication_time'=>0,'authentication_end_time'=>0]);
             Docter::where('id',$model->docter_id)->update(['is_then'=>0]);
         }
-        //修改记录
-//        DocterOrganization::where('id',$model->id)->update(['state'=>0]);
-        return $this->response()->success('审核撤销')->refresh();
+        return $this->response()->success('审核撤销成功')->refresh();
     }
 
 }

+ 5 - 5
app/Admin/Controllers/UserManagement/DocterManagement/ApproveController.php

xqd xqd xqd
@@ -30,7 +30,7 @@ class ApproveController extends AdminController
     protected function grid()
     {
         $grid = new Grid(new DocterOrganization());
-        $grid ->model()->where('state','>=',0);
+        $grid ->model()->where('state','>',0);
         $grid->column('id', __('Id'));
         $grid->column('docter.id', __('医生ID'));
         $grid->column('docter.name', __('医生姓名'));
@@ -40,7 +40,7 @@ class ApproveController extends AdminController
         $grid->column('office.name', __('科室'));
         $grid->column('qualification.name', __('医生资质'));
         $grid->column('remarks', __('备注'));
-        $grid->column('state', __('认证状态'))->using([1=>'待审核',2=>'已认证',3=>'已驳回']);
+        $grid->column('state', __('认证状态'))->using([1=>'审核成功',2=>'审核驳回',3=>'待审核']);
         $grid->column('authentication_time', __('签约时间'))->display(function ($time){
             if ($time == 0){
                 return '';
@@ -67,18 +67,18 @@ class ApproveController extends AdminController
             // 去掉查看
             $actions->disableView();
             //待审核状态下 给通过和驳回
-            if ($actions->row->state == 1){
+            if ($actions->row->state == 3){
                 //通过申请
                 $actions->add(new Pass());
                 //驳回申请
                 $actions->add(new Refuse());
             }
             //已认证状态下 给撤销
-            if ($actions->row->state == 2){
+            if ($actions->row->state == 1){
                 $actions->add(new Revoke());
             }
             //驳回状态下 不给任何操作
-            if ($actions->row->state == 3){
+            if ($actions->row->state == 2){
 
             }
 

+ 2 - 2
app/Admin/Controllers/UserManagement/DocterManagement/SignUpController.php

xqd xqd
@@ -36,7 +36,7 @@ class SignUpController extends AdminController
             $actions->disableView();
 
             // 如果审核成功才能修改认证到期时间
-            if($actions->row->state != 2){
+            if($actions->row->state != 1){
                 //去掉编辑
                 $actions->disableEdit();
             }
@@ -46,7 +46,7 @@ class SignUpController extends AdminController
         $grid->column('docter.name', __('医生姓名'));
         $grid->column('organization_id', __('机构id'));
         $grid->column('organization.name', __('机构名字'));
-        $grid->column('state', __('审核状态'))->using([1=>'待审核',2=>'审核通过',3=>'审核拒绝']);
+        $grid->column('state', __('审核状态'))->using([0=>'社区端待审核',1=>'审核成功',2=>'审核驳回',3=>'待审核']);
         $grid->column('authentication_time', __('签约时间'))->display(function ($time){
             if ($time == 0){
                 return '';