<?php

$conf_basedir = "../../../"; //相对主目录的位置
$conf_where = "admin"; //选择调用相应模块
$directory = basename(dirname(__FILE__)); //定义当前所在的目录，引入模块公用函数
include_once($conf_basedir . "base.inc.php");
include_once WEB_MODULE . '/growth/base.inc.php';

$type = $_GET['type'];
/**
 * 初始化小区完善等级设置表
 */
if ($type == 'info_setting') {
    $blockLevelInfoFullSetting = new BlockLevelInfoFullSetting();
    $fields = array();
    $fields[] = array('level' => 1, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'pABlockContri', 'exp_way_alias' => 'pABlockContri','type'=>'1');
    $fields[] = array('level' => 2, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'pBBlockContri', 'exp_way_alias' => 'pBBlockContri','type'=>'1');
    $fields[] = array('level' => 3, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'pCBlockContri', 'exp_way_alias' => 'pCBlockContri','type'=>'1');
    $fields[] = array('level' => 4, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'pDBlockContri', 'exp_way_alias' => 'pDBlockContri','type'=>'1');
    $fields[] = array('level' => 1, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'uABlockContri', 'exp_way_alias' => 'uABlockContri','type'=>'2');
    $fields[] = array('level' => 2, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'uBBlockContri', 'exp_way_alias' => 'uBBlockContri','type'=>'2');
    $fields[] = array('level' => 3, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'uCBlockContri', 'exp_way_alias' => 'uCBlockContri','type'=>'2');
    $fields[] = array('level' => 4, 'not_filled_items_number' => '', 'image_number' => '',
        'credit_way_alias' => 'uDBlockContri', 'exp_way_alias' => 'uDBlockContri','type'=>'2');
    //两种获取方式，
    //$type = array(1,2);
    $blockLevelInfoFullSetting->emptyTable();
    foreach ($fields as $value) {
        $blockLevelInfoFullSetting->save($value);
    }

}
/**
 * 初始化小区热度等级设置表
 */
if ($type == 'heat_setting') {
    $blockLevelHeatSetting = new BlockLevelHeatSetting();
    $fields = array();
    $fields[] = array('level' => 1, 'pv' => '', 'house_number' => '', 'credit_way_alias' => '', 'exp_way_alias' => 'successBid');
    $fields[] = array('level' => 2, 'pv' => '', 'house_number' => '', 'credit_way_alias' => '', 'exp_way_alias' => 'successBid');
    $fields[] = array('level' => 3, 'pv' => '', 'house_number' => '', 'credit_way_alias' => '', 'exp_way_alias' => 'successBid');
    $fields[] = array('level' => 4, 'pv' => '', 'house_number' => '', 'credit_way_alias' => '', 'exp_way_alias' => 'successBid');
    $blockLevelHeatSetting->emptyTable();
    foreach ($fields as $value) {
        $blockLevelHeatSetting->save($value);
    }
}

/**
 * 初始化小区资料完善紧急程度等级
 */
if($type == 'info') {
    /*
     * 刷表，请勿删除注释
     */
    $x = new BlockLevelStat();
    $x->flushInfo();
}

/**
 * 初始化小区热度等级
 */
if($type == 'heat') {
    $x = new BlockLevelStat();
    $x->flushHeat();
}
?>
