本文整理汇总了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]);
}
示例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]);
}
示例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]);
}