修复 无法获取工单的问题
This commit is contained in:
parent
30aa199a61
commit
373ca437b9
@ -12,7 +12,7 @@ class WorkOrderController extends Controller
|
|||||||
//
|
//
|
||||||
public function index(Request $request, WorkOrder $workOrder) {
|
public function index(Request $request, WorkOrder $workOrder) {
|
||||||
|
|
||||||
$workOrder = $workOrder->user()->simplePaginate(10);
|
$workOrder = $workOrder->thisUser()->with('user')->simplePaginate(10);
|
||||||
|
|
||||||
return $this->success($workOrder);
|
return $this->success($workOrder);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public function scopeThisModule($query)
|
|||||||
return $query->where('module_id', auth('remote')->id());
|
return $query->where('module_id', auth('remote')->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeUser($query)
|
public function scopeThisUser($query)
|
||||||
{
|
{
|
||||||
return $query->where('user_id', auth()->id());
|
return $query->where('user_id', auth()->id());
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public function scopeThisModule($query)
|
|||||||
return $query->where('module_id', auth('remote')->id());
|
return $query->where('module_id', auth('remote')->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeUser($query)
|
public function scopeThisUser($query)
|
||||||
{
|
{
|
||||||
return $query->where('user_id', auth()->id());
|
return $query->where('user_id', auth()->id());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user