Removed cat_status from controller and model as I believe its not used anymore if it breaks just have to rollback
这个提交包含在:
父节点
bdc9a86426
当前提交
1b3d496aaa
共有 2 个文件被更改,包括 6 次插入 和 66 次删除
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
class API extends CI_Controller {
|
class API extends CI_Controller {
|
||||||
|
|
||||||
|
// Do absolutely nothing
|
||||||
|
function index()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TODOs
|
TODOs
|
||||||
- Search Callsign (Return Json)
|
- Search Callsign (Return Json)
|
||||||
|
|
@ -34,22 +40,6 @@ class API extends CI_Controller {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do absolutely nothing
|
|
||||||
function index()
|
|
||||||
{
|
|
||||||
header("Location: ".$this->config->item('base_url'));
|
|
||||||
//load the model and get results
|
|
||||||
/*
|
|
||||||
$this->load->model('logbook_model');
|
|
||||||
$data['data'] = array();
|
|
||||||
|
|
||||||
// load the view
|
|
||||||
//$this->load->view('layout/header');
|
|
||||||
$this->load->view('api/index', $data);
|
|
||||||
//$this->load->view('layout/footer');
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
function help()
|
function help()
|
||||||
{
|
{
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
|
|
@ -377,22 +367,4 @@ class API extends CI_Controller {
|
||||||
echo json_encode($arr);
|
echo json_encode($arr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cat_status () {
|
|
||||||
header('Content-type: application/json');
|
|
||||||
|
|
||||||
$this->load->model('cat');
|
|
||||||
|
|
||||||
// Decode JSON and store
|
|
||||||
$obj = json_decode(file_get_contents("php://input"), true);
|
|
||||||
|
|
||||||
// Store Result to Database
|
|
||||||
$this->cat->cat_status($obj);
|
|
||||||
|
|
||||||
// Return Message
|
|
||||||
|
|
||||||
$arr = array('status' => 'success');
|
|
||||||
|
|
||||||
echo json_encode($arr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,38 +75,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function cat_status($result) {
|
|
||||||
|
|
||||||
$this->db->where('profile_name', $result['profile_name']);
|
|
||||||
$query = $this->db->get('cat');
|
|
||||||
|
|
||||||
if ($query->num_rows() > 0)
|
|
||||||
{
|
|
||||||
// Update the record
|
|
||||||
foreach ($query->result() as $row)
|
|
||||||
{
|
|
||||||
$radio_id = $row->id;
|
|
||||||
|
|
||||||
$data = array(
|
|
||||||
'profile_name' => $result['profile_name'],
|
|
||||||
'profile_url' => $result['profile_url']
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->db->where('id', $radio_id);
|
|
||||||
$this->db->update('cat', $data);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Add a new record
|
|
||||||
$data = array(
|
|
||||||
'profile_name' => $result['profile_name'],
|
|
||||||
'profile_url' => $result['profile_url']
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->db->insert('cat', $data);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function status() {
|
function status() {
|
||||||
//$this->db->where('radio', $result['radio']);
|
//$this->db->where('radio', $result['radio']);
|
||||||
$query = $this->db->get('cat');
|
$query = $this->db->get('cat');
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用