<?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';
//$brokers = array();
$sql = SqlCombinHelper::select_sql("broker", "uid as broker_id,broker_exp as exp");
$dbback = Container::getInstance()->get('dbback');
$dbback->fetchMode = MYSQL_ASSOC;
$brokers = $dbback->getAll($sql);

$growthExp = new GrowthExp();

if($brokers) {
    $sql = "TRUNCATE TABLE ".$growthExp->getTable();
    $db = Container::getInstance()->get('db');
    $db->Execute($sql);
    $number = $growthExp->insertMutl($brokers);
    echo "初始化".$number."个经纪人";
}
?>
