修改注释错误

This commit is contained in:
Li Jianxuan 2014-05-25 02:18:41 +00:00
parent 12b8b26338
commit b9a9e44746
1 changed files with 80 additions and 81 deletions

View File

@ -1,82 +1,81 @@
<?php <?php
//含沙量 //土壤水分
//Sediment Concentration namespace Westdc\Visual\Reader;
namespace Westdc\Visual\Reader;
use Westdc\Visual\Record;
use Westdc\Visual\Record; use Westdc\Visual\RecordInterface;
use Westdc\Visual\RecordInterface;
class SoilMoisture extends Record implements RecordInterface
class SoilMoisture extends Record implements RecordInterface {
{ function __construct()
function __construct() {
{ parent::__construct(__CLASS__);
parent::__construct(__CLASS__); }
}
public $subset;
public $subset;
public function switchDataset()
public function switchDataset() {
{ if(empty($this->subset))
if(empty($this->subset)) {
{ $this->subset = "20cm";
$this->subset = "20cm"; return;
return; }
}
switch($this->subset){
switch($this->subset){ case "10cm":
case "10cm": $this->subset = "vwc_avg10";
$this->subset = "vwc_avg10"; break;
break; case "20cm" :
case "20cm" : $this->subset = "vwc_avg20";
$this->subset = "vwc_avg20"; break;
break; case "30cm" :
case "30cm" : $this->subset = "vwc_avg30";
$this->subset = "vwc_avg30"; break;
break; case "40cm" :
case "40cm" : $this->subset = "vwc_avg40";
$this->subset = "vwc_avg40"; break;
break; case "50cm" :
case "50cm" : $this->subset = "vwc_avg50";
$this->subset = "vwc_avg50"; break;
break; }
}
return;
return; }
}
public function getData()
public function getData() {
{ $this->switchDataset();
$this->switchDataset();
$sql = "SELECT * FROM data_watercontent
$sql = "SELECT * FROM data_watercontent WHERE
WHERE $this->subset > 0
$this->subset > 0 ORDER BY
ORDER BY extract(year from \"timestamp\") ASC,
extract(year from \"timestamp\") ASC, extract(month from \"timestamp\") ASC,
extract(month from \"timestamp\") ASC, extract(day from \"timestamp\") ASC,
extract(day from \"timestamp\") ASC, extract(hour from \"timestamp\") ASC
extract(hour from \"timestamp\") ASC ";
"; //exit($sql);
//exit($sql); $rs = $this->db->query($sql);
$rs = $this->db->query($sql); return $rs;
return $rs;
}
}
public function outPut()
public function outPut() {
{
$rs = $this->getData();
$rs = $this->getData();
$data = array();
$data = array();
while($row = $rs->fetch())
while($row = $rs->fetch()) {
{ $row['utctime'] = $this->utcMsTime(strtotime($row['timestamp']));
$row['utctime'] = $this->utcMsTime(strtotime($row['timestamp'])); $data[] = array($row['utctime'],$row[$this->subset]);
$data[] = array($row['utctime'],$row[$this->subset]); }
}
return $data;
return $data; }
}
} }