<p><br></p>
if($_POST['shebei']!=""){
$ysj=$dao->field('flags=0'.' and '."send_mac='".$_POST['shebei']."'")->select();
$equ=$shebei->where("mac='".$_POST['shebei']."'")->limit(1)->find();
$this->assign('equ',$equ);
}
$sjz=array();
$sJSs=array();
$num=0;
for($i=0;$i<count($ysj);$i++){
$ysj[$i]['time']=strtotime($ysj[$i]['time']);
}
$ymd=$_POST['ktime'];
$ymd1=$_POST['jtime'];
$arrz=strtotime($ymd);//这里是第一个时间戳
$arrz1=strtotime($ymd1);//这里是第二个时间戳
$ss=($arrz1-$arrz)/3600;
$nums=array();
for($k=0;$k<$ss;$k++){
for($j=0;$j<count($ysj);$j++){
if($ysj[$j]['time']>($arrz+$k*3600)&&$ysj[$j]['time']<($arrz+($k+1)*3600)){
$sjz[$j]['mac']=$ysj[$j]['mac'];
$sjz[$j]['time']=date('Y-m-d H:i:s',$ysj[$j]['time']);
$sjz[$j]['sb']=$equ['address'];
$css[$j]['mac']=$ysj[$j]['mac'];
$sj=formatArray($css);
}
}
}
$i=0;
$sjztime=array();
$accs=array();
$sb=array();
foreach($sjz as $v) {
if(! isset($sjztime[$v['mac']])){
$sjztime[$v['mac']] = $v;
$accs[$i]=$v;
$i++;
}
}