perf: 仪表盘

This commit is contained in:
kuaifan
2021-12-23 12:21:23 +08:00
parent b208634e40
commit 1801ea7873
6 changed files with 105 additions and 126 deletions

View File

@@ -24,33 +24,6 @@ use Request;
*/
class ProjectController extends AbstractController
{
/**
* 任务统计
*/
public function statistics()
{
User::auth();
$data = [];
// 今日待完成
$data['today'] = ProjectTask::authData(null, true)->whereParentId(0)
->whereNull('archived_at')
->whereNull('complete_at')
->betweenTime(Carbon::today()->startOfDay(), Carbon::today()->endOfDay())
->count();
// 超期未完成
$data['overdue'] = ProjectTask::authData(null, true)->whereParentId(0)
->whereNull('archived_at')
->whereNull('complete_at')
->whereNotNull('end_at')
->where('end_at', '<', Carbon::now())
->count();
return Base::retSuccess('success', $data);
}
/**
* 获取项目列表
*