kopia lustrzana https://github.com/magicbug/Cloudlog
Added statistics to /api/statistics gives todays, total, month and year totals in json output
rodzic
1f583ef6ac
commit
4b5e41fc24
|
@ -475,4 +475,24 @@ class API extends CI_Controller {
|
|||
echo json_encode($arr);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Stats API function calls
|
||||
*
|
||||
*/
|
||||
|
||||
function statistics() {
|
||||
header('Content-type: application/json');
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$data['todays_qsos'] = $this->logbook_model->todays_qsos();
|
||||
$data['total_qsos'] = $this->logbook_model->total_qsos();
|
||||
$data['month_qsos'] = $this->logbook_model->month_qsos();
|
||||
$data['year_qsos'] = $this->logbook_model->year_qsos();
|
||||
|
||||
http_response_code(201);
|
||||
echo json_encode(['Today' => $data['todays_qsos'], 'total_qsos' => $data['total_qsos'], 'month_qsos' => $data['month_qsos'], 'year_qsos' => $data['year_qsos']]);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue