|
|
@@ -29,9 +29,8 @@ class DischargeTaskController extends Controller
|
|
|
if (!Gate::allows('人事管理-卸货-查询')) {
|
|
|
return redirect(url('/'));
|
|
|
}
|
|
|
-
|
|
|
- $dischargeTasks = DischargeTask::query()->with(['facilitator', 'owner', 'warehouse'])->filter($filters)->orderByDesc('income_at')->paginate($request['paginate'] ?? 50);
|
|
|
$owners = app(OwnerService::class)->getAuthorizedOwners();
|
|
|
+ $dischargeTasks = DischargeTask::query()->with(['facilitator', 'owner', 'warehouse'])->filter($filters)->whereIn('owner_id',data_get($owners,'*.id'))->orderByDesc('income_at')->paginate($request['paginate'] ?? 50);
|
|
|
$warehouses = Warehouse::query()->select('id', 'name')->get();
|
|
|
$facilitators = Facilitator::query()->select('name', 'id')->get();
|
|
|
|
|
|
@@ -118,8 +117,8 @@ class DischargeTaskController extends Controller
|
|
|
public function export(Request $request, DischargeTaskFilters $filters)
|
|
|
{
|
|
|
$this->gate('人事管理-卸货-查询');
|
|
|
-
|
|
|
- $dischargeTasks = DischargeTask::query()->with(['Facilitator', 'owner'])->filter($filters)->orderByDesc('id')->get();
|
|
|
+ $owners = app(OwnerService::class)->getAuthorizedOwners();
|
|
|
+ $dischargeTasks = DischargeTask::query()->with(['Facilitator', 'owner'])->filter($filters)->whereIn('owner_id',data_get($owners,'*.id'))->orderByDesc('id')->get();
|
|
|
|
|
|
$row = ['日期', '客户名称', '作业名称', '入库单号', '数量', '单位', '单价', '收费', '状态', '备注'];
|
|
|
$json = app('DischargeTaskService')->getJson($dischargeTasks);
|