欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

highchars

程序员文章站 2022-03-19 13:28:25
...
用后台控制highchars曲线图





//控制器里
public function change(){
$time=date("H",time());
$findnum=intval($time-9);
$list=M('xaxis')->select();
$newlist=array();
$num=0;
foreach($list as $key =>$val){
$newlist[$num].=$val['name'];
$num++;
}
if(isset($_REQUEST['id'])){
$map['id']=$_REQUEST['id'];
}
$list1=M('congregation')->where($map)->select();
$num1=0;
$new=array();
foreach($list1 as $key =>$val){
$new[$num1]['name']=$val['name'];
$yname=M('yaxis')->where(array('pid'=>$val['id'],'xid'=>array('elt',$findnum)))->select();
$num2=0;
foreach($yname as $key =>$valy) {
$new[$num1]['data'][$num2] = floatval($valy['num']);
$num2++;
}
$num1++;
}
$new_array = array();
$new_array[] = $newlist;
$new_array[] = $new;
$new_array[] = date('Y-m-d',time());
$this->ajaxReturn($new_array);
}

AD:真正免费,域名+虚机+企业邮箱=0元