NASER change task orders and make daily report and end task when emploee exit
This commit is contained in:
@@ -139,7 +139,9 @@ class TaskController extends Controller
|
||||
if ($user) {
|
||||
if ($user->is_admin == 1) {
|
||||
$tasks = Tasks::with(['duration', 'comments.user', 'appName'])
|
||||
->orderBy('target_date', 'desc')
|
||||
->orderByRaw('target_date IS NULL')
|
||||
->orderBy('target_date', 'asc')
|
||||
->orderBy('updated_at', 'desc')
|
||||
->get();
|
||||
// dd($tasks);
|
||||
foreach ($tasks as $task) {
|
||||
@@ -157,8 +159,11 @@ class TaskController extends Controller
|
||||
} else {
|
||||
$tasks = Tasks::with(['duration', 'comments.user'])->where('created_by', $user->id)
|
||||
->orWhereJsonContains('assignees', (string)$user->id)
|
||||
->orderBy('target_date', 'desc')
|
||||
->orderByRaw('target_date IS NULL') // تسکهای دارای مهلت اول بیایند (NULL آخر)
|
||||
->orderBy('target_date', 'asc') // نزدیکترین مهلت اول
|
||||
->orderBy('updated_at', 'desc') // در صورت یکسان بودن مهلت، آخرین تغییر اول
|
||||
->get();
|
||||
|
||||
// dd($tasks);
|
||||
foreach ($tasks as $task) {
|
||||
$totalSeconds = 0;
|
||||
|
||||
Reference in New Issue
Block a user