ソースを参照

货主停用功能完善

haozi 5 年 前
コミット
895d93492c

+ 1 - 1
app/Http/Controllers/OwnerController.php

@@ -141,7 +141,7 @@ class OwnerController extends Controller
     {
         if(!Gate::allows('货主-删除')){ return ['success'=>'false','fail_info'=>"没有权限"];  }
         $id=$request->input('id');
-        $owner=Owner::withTrashed()->where('id',$id);
+        $owner=Owner::withTrashed()->where('id',$id)->first();
         $owner->restore();
         $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
         return ['success'=>'true','owner'=>$owner];

+ 2 - 1
resources/views/maintenance/owner/recycle.blade.php

@@ -1,5 +1,5 @@
 @extends('layouts.app')
-@section('title')货主@endsection
+@section('title')停运货主@endsection
 
 @section('content')
     <span id="nav2">
@@ -57,6 +57,7 @@
                         if(response.data.success){
                             tempTip.setDuration(1000);
                             tempTip.showSuccess('恢复货主'+owner.name+'成功');
+                            window.location.reload();
                         }else{
                             tempTip.setDuration(2500);
                             tempTip.show('恢复货主失败,错误:'+response.data.fail_info);