<?php

/**
 * 
 */

/**
 * 经纪人成长体系发布房源等级日志（是否加积分）
 *
 * @author 
 */
class GrowthPicCheckLog {
    //put your code here
	private $db;
    private $dbback;       
    private $table;   
    private $fields;
    private $mc;
    public function __construct() {      
       $container = Container::getInstance();
       $this->db = $container->get('db');
       $this->dbback = $container->get('dbback');	  
       $this->table = "growth_pic_check_log";
       //$this->fields = "id,sid,uid,blockid,blockname,pic_type,room,hall,pic_url,add_time,pic_status,exp_score,credit_score";
       $this->mc = $container->get('mc');
        $sqlfield = "DESC $this->table";
        $fieldsMKey = $sqlfield;
        $this->fields = $this->mc->get($fieldsMKey);
        if($this->fields === false) {
            $fields = $this->dbback->getAll($sqlfield);
            foreach ($fields as $field) {
                $this->fields[] = $field['Field'];
            }
            $this->mc->set($fieldsMKey, $this->fields, 3600);
        }
     
    }
    
     /**
     * 删除外景图记录信息
     * @param $brokerId
     * @return array 
     * @author  2014-3-28
     */     
     public function delOutPicLog($days=90){		 
        if(!$days || $days < 1) return 0;
	$date = strtotime(date('Y-m-d'))-$days*3600*24;
	$sql = SqlCombinHelper::delete_sql($this->table," add_time < '{$date}'");  
        echo $sql;
        exit;
	$this->db->Execute($sql);
        return $this->db->Affected_Rows();
     }
     

     
     
     
     
    
    
}
