소스 검색

新增服务审核的开通逻辑

ChenWuJie 4 년 전
부모
커밋
2a5f92cdc1
2개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. 19 0
      app/Admin/Actions/Service/PassAction.php
  2. 5 0
      app/Admin/Controllers/ServiceManagement/ServiceController.php

+ 19 - 0
app/Admin/Actions/Service/PassAction.php

xqd
@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Admin\Actions\Service;
+
+use App\Models\Serviceapplys;
+use Encore\Admin\Actions\RowAction;
+use Illuminate\Database\Eloquent\Model;
+
+class PassAction extends RowAction
+{
+    public $name = '开通';
+
+    public function handle(Model $model)
+    {
+        Serviceapplys::where('id',$model->id)->update(['status'=>2]);
+        return $this->response()->success('Success message.')->refresh();
+    }
+
+}

+ 5 - 0
app/Admin/Controllers/ServiceManagement/ServiceController.php

xqd xqd
@@ -3,6 +3,7 @@
 namespace App\Admin\Controllers\ServiceManagement;
 
 use App\Admin\Actions\Service\ApplysAction;
+use App\Admin\Actions\Service\PassAction;
 use App\Admin\Actions\Service\RefuseAction;
 use App\Admin\Actions\Service\RevokeAction;
 use App\Models\Docter;
@@ -88,6 +89,10 @@ class ServiceController extends AdminController
             {
                 $actions->add(new RevokeAction());
             }
+            if ($actions->row->status == 3)
+            {
+                $actions->add(new PassAction());
+            }
         });
         return $grid;
     }