<?php
/**
 * 初始化竞投房源时小区词和热搜词的权限
 */
$conf_basedir	= "../../../";	//相对主目录的位置
$conf_where		= "admin";	//选择调用相应模块
$directory		= basename(dirname(__FILE__));	//定义当前所在的目录，引入模块公用函数
include_once($conf_basedir."base.inc.php");
include_once WEB_MODULE . '/growth_nj/base.inc.php';
$bidPeriods = new GrowthBidPeriods();
$periods = $bidPeriods->currentBidPeriods(2);
if ($periods&&$periods['status']==2) {
    $growthBidStartSetting = new GrowthBidStartSetting();
    $data_info = $growthBidStartSetting->getData();
    $bidHouseBlockLevel = '';
    $bidHouseHotSearchLevel = '';
    if ($data_info) {
        foreach($data_info as $v) {
            if ($v['way_alias'] == 'bidHouseBlockWord') {
                $bidHouseBlockLevel = $v['levelnames'];
            }
            if ($v['way_alias'] == 'bidHouseMarketWord') {
                $bidHouseHotSearchLevel = $v['levelnames'];
            }
        }
        $growthBidHouseLevel = new GrowthBidHouseLevel();
		$growthBidHouseLevel->emptyTable();
        $updateBlockStatus = $growthBidHouseLevel->updateBlockLevel($bidHouseBlockLevel);
        $updateHotSearchStatus = $growthBidHouseLevel->updateHotSearchLevel($bidHouseHotSearchLevel);
        if($growthBidHouseLevel && $updateHotSearchStatus) {
            echo '竞投房源所需要的等级成功';
        }
    }
}