Revert "Merge pull request #1144 from CHTJonas/master"

This reverts commit c67e0a92e6, reversing
changes made to 23ccd119b9.
这个提交包含在:
Peter Goodhall 2021-09-01 11:50:50 +01:00
父节点 c67e0a92e6
当前提交 1ca1ab8513
共有 3 个文件被更改,包括 5 次插入14 次删除

查看文件

@ -455,18 +455,14 @@ class API extends CI_Controller {
}
/*
* ENDPOINT for Rig Control
*
* Note: timestamp should always be in UTC
*/
/* ENDPOINT for Rig Control */
function radio() {
header('Content-type: application/json');
$this->load->model('api_model');
//$json = '{"radio":"FT-950","frequency":14075,"mode":"SSB","timestamp":"2012/04/07 16:47:31"}';
//$json = '{"radio":"FT-950","frequency":14075,"mode":"SSB","timestamp":"2012/04/07 16:47"}';
$this->load->model('cat');
@ -480,10 +476,6 @@ class API extends CI_Controller {
die();
}
if(!isset($obj['timestamp'])) {
$obj['timestamp'] = gmdate('Y/m/d H:i:s'); // in UTC
}
// Store Result to Database
$this->cat->update($obj);

查看文件

@ -120,9 +120,8 @@
}
// Calculate how old the data is in minutes
$timezone = new DateTimeZone("UTC");
$datetime1 = new DateTime("now", $timezone);
$datetime2 = new DateTime($row->timestamp, $timezone);
$datetime1 = new DateTime(); // Today's Date/Time
$datetime2 = new DateTime($row->newtime);
$interval = $datetime1->diff($datetime2);
$minutes = $interval->days * 24 * 60;

查看文件

@ -102,7 +102,7 @@
function radio_status($id) {
return $this->db->query('SELECT * FROM `cat` WHERE id = '.$id.' ');
return $this->db->query('SELECT *, CONVERT_TZ(`timestamp`, @@session.time_zone, \'+00:00\' ) as newtime FROM `cat` WHERE id = '.$id.' ');
}