<?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,credit");
$dbback = Container::getInstance()->get('dbback');
$dbback->fetchMode = MYSQL_ASSOC;
$brokers = $dbback->getAll($sql);
$growthCredit = new GrowthCredit();

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