當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Task::unfinished方法代碼示例

本文整理匯總了PHP中app\Task::unfinished方法的典型用法代碼示例。如果您正苦於以下問題:PHP Task::unfinished方法的具體用法?PHP Task::unfinished怎麽用?PHP Task::unfinished使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Task的用法示例。


在下文中一共展示了Task::unfinished方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: home

 public function home()
 {
     $page_title = "لوحة التحكم";
     $section_title = "لوحة التحكم";
     Date::setLocale('ar');
     $date = Date::now()->format('j F Y');
     $day = Date::now()->format('l');
     $month = Date::now()->format('F');
     $year = Date::now()->format('Y');
     //**************Tasks***************
     $tasksUnfinished = Task::unfinished();
     $tasksToday = Task::orderBy('task_date', 'desc')->today()->take(5);
     $tasksWeek = Task::orderBy('task_date', 'desc')->thisweek()->take(5);
     $tasksMonth = Task::orderBy('task_date', 'desc')->thisMonth()->take(5);
     $tasks_count = count($tasksUnfinished->toArray());
     //**************Fails***************
     $failsunfixed = Failure::waiting();
     $failsToday = Failure::orderBy('fail_time', 'desc')->today()->take(5);
     $failsWeek = Failure::orderBy('fail_time', 'desc')->thisweek()->take(5);
     $failsMonth = Failure::orderBy('fail_time', 'desc')->thisMonth()->take(5);
     $fails_count = count($failsunfixed->toArray());
     //**************Repairs***************
     $repairsBox = Repair::finished();
     $repairsToday = Repair::today();
     $repairsWeek = Repair::thisweek();
     $repairsMonth = Repair::thisMonth();
     $repairs_count = count($repairsBox);
     return view('dashboard.dashboard', compact('page_title', 'section_title', 'date', 'day', 'month', 'year', 'tasksToday', 'tasksMonth', 'tasksWeek', 'tasks_count', 'failsToday', 'failsMonth', 'failsWeek', 'fails_count', 'repairsToday', 'repairsMonth', 'repairsWeek', 'repairs_count'));
 }
開發者ID:ashraf2033,項目名稱:CloudManagementSystem,代碼行數:29,代碼來源:PagesController.php

示例2: filter

 public function filter($filter)
 {
     if ($filter == "Completed") {
         $tasks = Task::finished()->get();
         return view('tasks.index', compact('tasks'));
     } elseif ($filter == "Pending") {
         $tasks = Task::unfinished()->get();
         return view('tasks.index', compact('tasks'));
     } else {
         return redirect('todo');
     }
 }
開發者ID:aditya-cherukuri,項目名稱:todo_app,代碼行數:12,代碼來源:TasksController.php


注:本文中的app\Task::unfinished方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。