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


PHP Task::resolveTasksDependencies方法代码示例

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


在下文中一共展示了Task::resolveTasksDependencies方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $nowDateMinusWeek = date('Y-m-d', strtotime("-1 week")) . ' 00:00:00';
     $tasks = Task::where('deleted', false)->where('created_at', '>=', $nowDateMinusWeek)->orderBy('created_at', 'desc')->paginate(15);
     Task::resolveTasksDependencies($tasks);
     $statistics = Statistic::all();
     $statistics_array = array('users' => $statistics[0]->value, 'tasks' => $statistics[1]->value, 'solutions' => $statistics[2]->value);
     return view('home/index', ['tasks' => $tasks, 'statistics' => $statistics_array]);
 }
开发者ID:mikolajszczepanski,项目名称:NuPtr,代码行数:14,代码来源:HomeController.php

示例2: search

 public function search(Request $request = null, $paginate = 15)
 {
     $string = $request->input('s');
     $tasks = Task::where('deleted', false);
     if (!empty($string)) {
         if (is_numeric($string)) {
             $tasks = $tasks->where('id', $string);
         } else {
             $tasks = $tasks->where(function ($query) use($string) {
                 $query->where('author', 'LIKE', '%' . $string . '%')->orWhere('name', 'LIKE', '%' . $string . '%')->orWhere('description', 'LIKE', '%' . $string . '%');
             });
         }
         $tasks = $tasks->orderBy('created_at', 'desc')->paginate($paginate);
         Task::resolveTasksDependencies($tasks);
     } else {
         $tasks = null;
     }
     return view('task/search', ['tasks' => $tasks, 'search' => $string, 'alias' => null]);
 }
开发者ID:mikolajszczepanski,项目名称:NuPtr,代码行数:19,代码来源:TaskController.php

示例3: tasks

 public function tasks()
 {
     $user_id = Auth::user()->id;
     $tasks = Task::where('user_id', $user_id)->where('deleted', false)->orderBy('created_at', 'desc')->paginate(15);
     Task::resolveTasksDependencies($tasks);
     return view('user/tasks', ['tasks' => $tasks]);
 }
开发者ID:mikolajszczepanski,项目名称:NuPtr,代码行数:7,代码来源:UserController.php


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