diff --git a/application/module/Westdc/Visual/Reader/Sc.php b/application/module/Westdc/Visual/Reader/Sc.php index 2136968c..c78309fd 100644 --- a/application/module/Westdc/Visual/Reader/Sc.php +++ b/application/module/Westdc/Visual/Reader/Sc.php @@ -15,19 +15,6 @@ class Sc extends Record implements RecordInterface public $subset; - public function getData() - { - $sql = "SELECT * FROM datasands - ORDER BY - year ASC, - month ASC - "; - - $rs = $this->db->query($sql); - return $rs; - - } - public function switchDataset() { if(empty($this->subset)) @@ -51,6 +38,19 @@ class Sc extends Record implements RecordInterface return; } + public function getData() + { + $sql = "SELECT * FROM datasands + ORDER BY + year ASC, + month ASC + "; + + $rs = $this->db->query($sql); + return $rs; + + } + public function outPut() { $this->switchDataset(); diff --git a/application/module/Westdc/Visual/Reader/SoilMoisture.php b/application/module/Westdc/Visual/Reader/SoilMoisture.php index cba4bf79..1b68b0e3 100644 --- a/application/module/Westdc/Visual/Reader/SoilMoisture.php +++ b/application/module/Westdc/Visual/Reader/SoilMoisture.php @@ -15,24 +15,6 @@ class SoilMoisture extends Record implements RecordInterface public $subset; - public function getData() - { - $this->switchDataset(); - - $sql = "SELECT * FROM data_watercontent - WHERE - $this->subset > 0 - ORDER BY - extract(day from \"timestamp\"), - extract(month from \"timestamp\"), - extract(year from \"timestamp\") - "; - - $rs = $this->db->query($sql); - return $rs; - - } - public function switchDataset() { if(empty($this->subset)) @@ -62,6 +44,24 @@ class SoilMoisture extends Record implements RecordInterface return; } + public function getData() + { + $this->switchDataset(); + + $sql = "SELECT * FROM data_watercontent + WHERE + $this->subset > 0 + ORDER BY + extract(year from \"timestamp\"), + extract(month from \"timestamp\"), + extract(day from \"timestamp\") + "; + //exit($sql); + $rs = $this->db->query($sql); + return $rs; + + } + public function outPut() { diff --git a/application/module/Westdc/Visual/Record.php b/application/module/Westdc/Visual/Record.php index 9077b612..14f02205 100644 --- a/application/module/Westdc/Visual/Record.php +++ b/application/module/Westdc/Visual/Record.php @@ -18,7 +18,6 @@ class Record extract(year from \"$fieldTime\") ASC, extract(month from \"$fieldTime\") ASC, extract(day from \"$fieldTime\") ASC, - extract(hour from \"$fieldTime\") ASC "; $rs = $this->db->query($sql); diff --git a/application/module/Westdc/Visual/RecordInterface.php b/application/module/Westdc/Visual/RecordInterface.php index 870b34cf..d2351c3a 100644 --- a/application/module/Westdc/Visual/RecordInterface.php +++ b/application/module/Westdc/Visual/RecordInterface.php @@ -4,4 +4,5 @@ namespace Westdc\Visual; interface RecordInterface { public function outPut(); + public function getData(); } \ No newline at end of file