|
...
|
...
|
@@ -30,6 +30,7 @@ class MonthReportController extends BaseController |
|
|
|
public function getMonth(){
|
|
|
|
$monthCountModel = new MonthCount();
|
|
|
|
$this->map['project_id'] = $this->user['project_id'];
|
|
|
|
$this->map['month'] = ['>=',date('Y-m',strtotime($this->user['uptime']))];
|
|
|
|
$month = $monthCountModel->formatQuery($this->map)->pluck('month')->unique()->toArray();
|
|
|
|
$this->response('success',Code::SUCCESS,$month);
|
|
|
|
}
|
|
...
|
...
|
@@ -79,7 +80,7 @@ class MonthReportController extends BaseController |
|
|
|
$newsModel = new News();
|
|
|
|
$info['news_num'] = $newsModel->formatQuery(['status'=>0])->count();
|
|
|
|
$info['news_num_last_7'] = $newsModel->formatQuery(
|
|
|
|
['status'=>1,'created_at'=>['between',[now()->subDays(7)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]]
|
|
|
|
['status'=>0,'created_at'=>['between',[now()->subDays(7)->startOfDay()->toDateString(),now()->startOfDay()->toDateString()]]
|
|
|
|
])->count();
|
|
|
|
$info['speed'] = round((0.3 + mt_rand()/mt_getrandmax() * (1-0.3)),2);
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
...
|
...
|
|