colly_wyx
2018-04-17 bf600de624ac26b99cecdec37c1f1aef63b09634
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']);
        }