[welcome] SQL statements being totally wrong

这个提交包含在:
Peter Goodhall 2022-10-11 17:10:44 +01:00
父节点 75952cec2a
当前提交 eecd2bf71d
共有 6 个文件被更改,包括 7 次插入8 次删除

查看文件

@ -11,7 +11,6 @@ class Welcome extends CI_Controller {
public function index() public function index()
{ {
if($this->optionslib->get_option('version2_trigger') == "false") { if($this->optionslib->get_option('version2_trigger') == "false") {
$data['page_title'] = "Welcome to Cloudlog Version 2.0"; $data['page_title'] = "Welcome to Cloudlog Version 2.0";
@ -31,7 +30,7 @@ class Welcome extends CI_Controller {
$this->load->model('note'); $this->load->model('note');
$data['NumberOfNotes'] = $this->note->CountAllNotes(); $data['NumberOfNotes'] = $this->note->CountAllNotes();
if($data['CountAllStationLocations'] == 0 || $data['NumberOfStationLogbooks'] == 0 || $data['NumberOfAPIKeys'] > 0 || $data['NumberOfNotes'] > 0) { if($data['CountAllStationLocations'] > 0 || $data['NumberOfStationLogbooks'] > 0 || $data['NumberOfAPIKeys'] > 0 || $data['NumberOfNotes'] > 0) {
// load views // load views
$this->load->view('interface_assets/mini_header', $data); $this->load->view('interface_assets/mini_header', $data);
$this->load->view('welcome/index'); $this->load->view('welcome/index');

查看文件

@ -15,7 +15,7 @@ class API_Model extends CI_Model {
} }
function CountKeysWithNoUserID() { function CountKeysWithNoUserID() {
$this->db->where('user_id !=', NULL); $this->db->where('user_id =', NULL);
$query = $this->db->get('api'); $query = $this->db->get('api');
return $query->num_rows(); return $query->num_rows();
} }

查看文件

@ -9,7 +9,7 @@ class Logbooks_model extends CI_Model {
function CountAllStationLogbooks() { function CountAllStationLogbooks() {
// count all logbooks // count all logbooks
$this->db->where('user_id !=', NULL); $this->db->where('user_id =', NULL);
$query = $this->db->get('station_logbooks'); $query = $this->db->get('station_logbooks');
return $query->num_rows(); return $query->num_rows();
} }

查看文件

@ -57,7 +57,7 @@ class Note extends CI_Model {
function CountAllNotes() { function CountAllNotes() {
// count all notes // count all notes
$this->db->where('user_id', NULL); $this->db->where('user_id =', NULL);
$query = $this->db->get('notes'); $query = $this->db->get('notes');
return $query->num_rows(); return $query->num_rows();
} }

查看文件

@ -157,7 +157,7 @@ class Stations extends CI_Model {
} }
function CountAllStationLocations() { function CountAllStationLocations() {
$this->db->where('user_id !=', NULL); $this->db->where('user_id =', NULL);
$query = $this->db->get('station_profile'); $query = $this->db->get('station_profile');
return $query->num_rows(); return $query->num_rows();
} }

查看文件

@ -92,7 +92,7 @@
<br> <br>
<?php if(!$CountAllStationLocations) { ?> <?php if($CountAllStationLocations > 0) { ?>
<div class="card"> <div class="card">
<div class="card-header">Assign ALL Station Locations to this username</div> <div class="card-header">Assign ALL Station Locations to this username</div>
<div class="card-body"> <div class="card-body">
@ -104,7 +104,7 @@
<br> <br>
<?php } ?> <?php } ?>
<?php if(!$NumberOfStationLogbooks) { ?> <?php if($NumberOfStationLogbooks > 0) { ?>
<div class="card"> <div class="card">
<div class="card-header">Create Station Logbooks</div> <div class="card-header">Create Station Logbooks</div>
<div class="card-body"> <div class="card-body">