main
Jing Li 2024-04-24 23:08:44 +08:00
parent 70d8392a0b
commit 8c76ad1395
1 changed files with 1 additions and 16 deletions

View File

@ -83,22 +83,7 @@ class WorkflowController extends Controller
TaskLedger::class => ['store'], TaskLedger::class => ['store'],
]); ]);
}, },
])->whereHasMorph( ])->findOrFail($id);
'taskable',
[TaskHygiene::class, TaskLedger::class],
function (Builder $query, string $type) use ($user) {
switch ($type) {
case TaskLedger::class:
case TaskHygiene::class:
if ($user->isStoreMaster()) {
$query->where('store_id', $user->store_id);
} else {
$query->whereRaw('1!=1');
}
break;
}
}
)->findOrFail($id);
$info->taskable->setRelation('task', $info->withoutRelations()); $info->taskable->setRelation('task', $info->withoutRelations());
break; break;