创建版本

This commit is contained in:
2021-02-22 12:17:00 +08:00
commit af555f49c3
2332 changed files with 369202 additions and 0 deletions
@@ -0,0 +1,45 @@
<?php namespace Gdoo\Project\Controllers;
use DB;
use Auth;
use Request;
use Gdoo\Index\Controllers\DefaultController;
use Gdoo\Index\Services\InfoService;
class WidgetController extends DefaultController
{
public $permission = ['info'];
/**
* 项目任务信息
*/
public function infoAction()
{
$config = InfoService::getInfo('project_task');
$count = DB::table('project_task')
->where('user_id', Auth::id())
->whereRaw('isnull(progress, 0) < 1')
->whereRaw('('.$config['sql'].')')
->count();
$count2 = DB::table('project_task')
->where('user_id', Auth::id())
->whereRaw('isnull(progress, 0) < 1')
->whereRaw('('.$config['sql2'].')')
->count();
$rate = 0;
if ($count2 > 0) {
$rate = $count / $count2 * 100;
}
$res = [
'count' => $count,
'count2' => $count2,
'rate' => $rate,
];
return $this->render([
'dates' => $config['dates'],
'info' => $config['info'],
'res' => $res,
]);
}
}