Kaynağa Gözat

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

Mike 4 yıl önce
ebeveyn
işleme
1bc07459b4

+ 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('开通成功')->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;
     }

+ 7 - 8
app/Models/Doctertimes.php

xqd
@@ -1,15 +1,14 @@
 <?php
+/**
+ * Created by PhpStorm.
+ * User: zilongs
+ * Date: 20-9-29
+ * Time: 上午11:12
+ */
 
 namespace App\Models;
 
-use Illuminate\Database\Eloquent\Model;
-
-class Doctertimes extends Model
+class DocterTimes extends BaseModel
 {
-    //
-    protected $table = 'docter_times';
 
-    public function docter(){
-        return $this->hasOne(Docter::class);
-    }
 }