<?php
/**
 * 每天更新需要
 */
require('path.inc.php');

$sql ="select * from fke_member where user_type=1 ";
$query->open($sql);
while ($rs = $query->next()) {
	$housesell_num = $query_mysql->getValue("select count(*) as num from fke_housesell where status =1 and broker_id = ".$rs['id']);

	$houserent_num = $query_mysql->getValue("select count(*) as num from fke_houserent where status =1 and broker_id = ".$rs['id']);
	
	$query_mysql->execute('update fke_member set sell_num='.$housesell_num.',rent_num='.$houserent_num.' where id='.$rs['id']);
}

print_r("经纪人房源数量数据导入完成");
exit;
?>