当前位置: 首页>>代码示例>>PHP>>正文


PHP Task::orderBy方法代码示例

本文整理汇总了PHP中app\Task::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::orderBy方法的具体用法?PHP Task::orderBy怎么用?PHP Task::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Task的用法示例。


在下文中一共展示了Task::orderBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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***************
     $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($tasksToday->toArray());
     //**************Fails***************
     $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($failsToday->toArray());
     //**************Repairs***************
     $repairsToday = Repair::today();
     $repairsWeek = Repair::thisweek();
     $repairsMonth = Repair::thisMonth();
     $repairs_count = count($repairsToday->toArray());
     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,项目名称:maintainit,代码行数:26,代码来源:PagesController.php

示例2: index

 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('created_at', 'asc')->get();
     //echo "hallo in todoconstructor";
     //print_r($tasks);
     return view('tasks', ['tasks' => $tasks]);
 }
开发者ID:Anton-Patokin,项目名称:web-backend-oplossingen,代码行数:12,代码来源:TodoController.php

示例3: index

 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     $status = statu::orderBy('status', 'asc')->get();
     $owners = owner::orderBy('owner_name', 'asc')->get();
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('home', compact('tasks'), compact('owners'));
 }
开发者ID:ks-hernandez,项目名称:irtask,代码行数:12,代码来源:HomeController.php

示例4: getTasks

 public function getTasks()
 {
     if (Auth::check()) {
         return view('tasks', ['tasks' => Task::orderBy('created_at', 'asc')->get()]);
     } else {
         return redirect('/login');
     }
 }
开发者ID:jknust,项目名称:Project_CodeMonkeys,代码行数:8,代码来源:TaskController.php

示例5: index

 public function index()
 {
     /*$data = DB::table('tasks')->orderBy('priority', 'DESC')->get();*/
     $priority = DB::table('issues')->join('companies', 'companies.id', '=', 'issues.company_id')->select(DB::raw('sum(companies.score * issues.level) AS total_priority'))->where('order_lines.product_id', $product->id)->where('orders.order_status_id', 4)->first();
     Task::create(['issue_id' => '9', 'person_id' => '9', 'priority' => '9']);
     $data = Task::orderBy('priority', 'DESC')->get();
     return view('welcome', compact('data'));
 }
开发者ID:LakyLak,项目名称:Projects,代码行数:8,代码来源:IndexController.php

示例6: getGroupedDateAndLineId

 public static function getGroupedDateAndLineId()
 {
     $tasks = Task::orderBy('date')->get(['date', 'line_id', 'type', 'content']);
     $tasksGrouped = [];
     foreach ($tasks as $task) {
         $tasksGrouped[$task->date][$task->line_id][$task->type] = $task->content;
     }
     return $tasksGrouped;
 }
开发者ID:shatee,项目名称:nichirei-benri,代码行数:9,代码来源:Task.php

示例7: show

 public function show()
 {
     $users = DB::table('user')->count();
     $tasks = DB::table('task')->count();
     $count = DB::table('UserTask')->join('task', 'UserTask.id_task', '=', 'task.id')->where('UserTask.status', 'done')->select(DB::raw('sum(point) as point'))->get();
     if (count($count) > 0) {
         $sum = $count[0]->point;
     } else {
         $sum = 0;
     }
     $querydone = DB::table('UserTask')->select(DB::raw('count(id_task) as done'))->where('status', 'done')->get();
     if (count($querydone) > 0) {
         $countDone = (int) $querydone[0]->done;
     } else {
         $countDone = 0;
     }
     $users_list = \App\Users::orderBy('created_at', 'desc')->take(5)->get();
     $rowsUsers = "";
     foreach ($users_list as $user) {
         $rowsUsers .= '<tr class="gradeC userRow" id="' . $user->id . '">
                                             <td class="userEmail">
                                                 ' . $user->email . '
                                             </td>
                                             <td class="userLastName">
                                                ' . $user->last_name . '
                                             </td>
                                             <td class="center userFirstName">
                                                 ' . $user->first_name . '
                                             </td>
                                             <td class="center userCity">
                                                 ' . $user->city . '
                                             </td>';
     }
     $tasks_list = \App\Task::orderBy('created_at', 'desc')->take(5)->get();
     $rowsTask = "";
     foreach ($tasks_list as $task) {
         $rowsTask .= '<tr class="gradeC taskRow" id="' . $task->id . '">
                                             <td class="taskName">
                                                 ' . $task->name . '
                                             </td>
                                             <td class="center userFirstName">
                                                 ' . $task->point . '
                                             </td>
                                             <td class="center userStreet">
                                                 ' . $task->timer . '
                                             </td></tr>';
     }
     return View::make($this->_view, ['taskCount' => $tasks, 'userCount' => $users, 'usersScoreCount' => $count[0]->point, 'usersDoneCount' => $countDone, 'rowsUsers' => $rowsUsers, 'rowsTask' => $rowsTask, 'classMain' => 'active', 'classUsers' => '', 'classTasks' => '']);
 }
开发者ID:smilexx,项目名称:taskgame,代码行数:49,代码来源:ControllerIndex.php

示例8: index

 public function index()
 {
     if ($this->user->auth()->active == 1) {
         if ($this->user->auth()->hasRole('Admin')) {
             $userCount = $this->user->getUserCount();
             $query = Input::get('q');
             $tasks = Task::orderBy('completed', 'asc')->simplePaginate(10);
             $users = $query ? User::where('name', 'LIKE', "%{$query}%")->orderBy('active')->get() : User::orderBy('active')->simplePaginate(10);
             return view('sezgicraft.admin.home', compact('userCount', 'users', 'tasks'));
         } else {
             session()->flash('flash_message_important', 'You are not permitted to do that!');
             return redirect('/sezgicraft');
         }
     }
 }
开发者ID:mathewsandi,项目名称:Sezgi,代码行数:15,代码来源:AdminController.php

示例9: read

 function read()
 {
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('tasks', ['tasks' => $tasks]);
 }
开发者ID:lopesdalmo,项目名称:Study,代码行数:5,代码来源:TasksController.php

示例10: index

 public function index()
 {
     // echo "Hello from index controller";
     $tasks = Task::orderBy('created_at', 'asc')->get();
     return view('tasks', ['tasks' => $tasks]);
 }
开发者ID:kafkatamura13,项目名称:laravelquickstart-basic,代码行数:6,代码来源:TaskController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $tasks = Task::orderBy('created_at', 'DESC')->paginate(10);
     return view('tasks.index')->with('tasks', $tasks);
 }
开发者ID:rikardote,项目名称:tasks,代码行数:10,代码来源:TasksController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $task = Task::orderBy('updated_at', 'desc')->paginate(50);
     return view('admin.task.index', compact('task'));
 }
开发者ID:thibaultvanc,项目名称:organit,代码行数:10,代码来源:TaskController.php

示例13: function

|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use Illuminate\Http\Request;
use App\Task;
use Illuminate\Support\Facades\Validator;
Route::get('/', function () {
    $tasks = Task::orderBy('created_at', 'asc')->get();
    return view('tasks', ['tasks' => $tasks]);
});
Route::get('/tasks', function () {
    $tasks = Task::orderBy('name', 'asc')->get();
    return view('alltasks', ['tasks' => $tasks]);
});
/*
 * Add a new Task
**/
Route::post('/task', function (Request $request) {
    $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
    if ($validator->fails()) {
        return redirect('/')->withInput()->withErrors($validator);
    }
    $task = new Task();
    $task->name = $request->name;
    $task->save();
    return redirect('/');
});
开发者ID:schoenfinkeln,项目名称:learning-laravel5,代码行数:31,代码来源:routes.php

示例14: all

 /**
  * Return all tasks
  *
  * @return \App\Task
  */
 public function all()
 {
     return $this->task->orderBy('priority', 'asc')->get();
 }
开发者ID:MikeGeorgeff,项目名称:skills-tes,代码行数:9,代码来源:TaskRepository.php

示例15: function

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
use App\Task;
use Illuminate\Http\Request;
Route::group(['middleware' => ['web']], function () {
    /*SHOW TASK DASHBOARD*/
    Route::get("/", function () {
        $tasks = Task::orderBy("created_at", "asc")->get();
        return view("tasks", ["tasks" => $tasks]);
    });
    /*ADD NEW TASK*/
    Route::post("/task", function (Request $request) {
        $validator = Validator::make($request->all(), ['name' => 'required|max:255']);
        if ($validator->fails()) {
            return redirect('/')->withInput()->withErrors($validator);
        }
        $task = new Task();
        $task->name = $request->name;
        $task->save();
        return redirect('/');
    });
    /*DELETE TASK*/
    Route::delete("/task/{task}", function (Task $task) {
开发者ID:sepperenty,项目名称:web-backend-oplossingen,代码行数:31,代码来源:routes.php


注:本文中的app\Task::orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。