<?php
require('path.inc.php');

$sql ="select count(*) as login_times,loginNum as username,CONVERT(varchar(10), Add_Time  ,120) as add_date from FK_User_LoginLog group by  CONVERT(varchar(10), Add_Time  ,120), loginNum order by add_date";
$query_mssql->open($sql);

while ($rs = $query_mssql->next()) {
	
	$created = $rs['add_date']?MyDate::transform('timestamp',$rs['add_date']):"";
	//$rs['member_id'] = $query_mysql->getValue("select id from fke_member where username ='".$rs['username']."'");
	
	$fieldArray = array(
		'username'=>$rs['username'],
		'login_times'=>$rs['login_times'],
		'add_time'=>$created,
	);

	$query->insert('fke_member_loginlog',$fieldArray);
	
}
print_r("用户登陆数据导入完成");
exit;
?>