kopia lustrzana https://github.com/magicbug/Cloudlog
Added Migration to delete the LoTW User List table and removed some unneeded coded
rodzic
d4a164fc94
commit
235c977040
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
|||
| be upgraded / downgraded to.
|
||||
|
|
||||
*/
|
||||
$config['migration_version'] = 50;
|
||||
$config['migration_version'] = 51;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -632,14 +632,7 @@ class API extends CI_Controller {
|
|||
* Check if callsign is active on LOTW
|
||||
*
|
||||
*/
|
||||
$this->load->model('lotw_user');
|
||||
|
||||
$lotw_member = $this->lotw_user->check($lookup_callsign);
|
||||
if($lotw_member == "not found") {
|
||||
$return['lotw_member'] = false;
|
||||
} else {
|
||||
$return['lotw_member'] = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Migration_delete_lotw_userlist_table extends CI_Migration {
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->dbforge->drop_table('lotw_userlist');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "not possible";
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
class Lotw_user extends CI_Model {
|
||||
|
||||
function __construct()
|
||||
{
|
||||
// Call the Model constructor
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
function empty_table() {
|
||||
$this->db->empty_table('lotw_userlist');
|
||||
}
|
||||
|
||||
function add_lotwuser($callsign, $date) {
|
||||
|
||||
$data = array(
|
||||
'callsign' => $callsign,
|
||||
'upload_date' => $date
|
||||
);
|
||||
|
||||
$this->db->insert('lotw_userlist', $data);
|
||||
}
|
||||
|
||||
function check($callsign) {
|
||||
$this->db->where('callsign', $callsign);
|
||||
$query = $this->db->get('lotw_userlist');
|
||||
|
||||
if ($query->num_rows() > 0) {
|
||||
return "active";
|
||||
} else {
|
||||
return "not found";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
Ładowanie…
Reference in New Issue