Yfs/Domain/Data.php | ●●●●● patch | view | raw | blame | history | |
Yfs/Model/DataThreeHourly.php | ●●●●● patch | view | raw | blame | history | |
Yfs/Model/DataWarn.php | ●●●●● patch | view | raw | blame | history |
Yfs/Domain/Data.php
@@ -7,6 +7,8 @@ public function __construct(){ //DI()->redis = new Redis_Lite(DI()->config->get('app.redis.servers')); $this->model = new Model_Data(); $this->hourly_model = new Model_DataHourly(); $this->warn_model = new Model_DataWarn(); } /** @@ -23,7 +25,15 @@ $arr['value'] = $value['value']; $arr['create_time'] = $value['time']; $arr['date'] = date('Y-m-d', strtotime($value['time'])); if($data['type'] == 0){ $this->model->add($arr); if($arr['is_warn'] == 1){ $this->warn_model->add($arr); } } elseif($data['type'] == 1){ $this->hourly_model->add($arr); } if(isset($arr['_id'])) unset($arr['_id']); } Yfs/Model/DataThreeHourly.php
New file @@ -0,0 +1,8 @@ <?php class Model_DataThreeHourly extends Model_Base{ public $table = 'data_three_hourly'; } Yfs/Model/DataWarn.php
New file @@ -0,0 +1,8 @@ <?php class Model_DataWarn extends Model_Base{ public $table = 'data_warn'; }