<?php 
class TestAction extends Action{
	

	
	//更新@数据
	function update(){
		$weibo_id = intval($_GET['weibo_id']);
		if( $weibo_id ){
			$map['weibo_id'] = array('gt',$weibo_id);
		}
		$list = D('weibo')->limit(50)->where($map)->order('weibo_id ASC')->findall();
		if( $list ){
			foreach ($list as $key=>$value){
				$arruid = array();
				if($value['transpond_id']){
					$transpondInfo = D('weibo')->where('weibo_id='.$value['transpond_id'])->field('uid')->find();
					array_push($arruid, $transpondInfo['uid']);
				}
				$arruid = array_merge($arruid,getUids($value['content']));
				$arruid = array_unique($arruid);
				D('Atme')->addAtme($arruid,$value['weibo_id']);
				unset($arruid);
				$weibo_id = $value['weibo_id'];
			}
			echo $weibo_id.' success';
			redirect( U('weibo/test/update',array('weibo_id'=>$value['weibo_id'])) );
		}else{
			echo 'All completed.';
		}
	}
	
	
	//更新回复数据
	function updatecomment(){
		$list = D('Comment')->where('reply_uid=0')->findall();
		foreach ($list as $key=>$value){
			$info = D('Weibo')->where('weibo_id='.$value['weibo_id'])->find();
			D('Comment')->setField('reply_uid',$info['uid'],'comment_id='.$value['comment_id']);
			unset($info);
			unset($value);
		}
	}
}
?>