#391 添加了数据可视化中的排序规则

This commit is contained in:
Li Jianxuan 2012-07-13 08:41:46 +00:00
parent 501eabeeb6
commit f73cf609c6
1 changed files with 5 additions and 1 deletions

View File

@ -163,24 +163,28 @@ class VisualController extends Zend_Controller_Action
{
$field = array(); //查询字段
$order = array();
if(is_array($t['time']))
{
foreach ($t['time'] as $v)
{
$field[] = $v;
$order[] = $v.' ASC';
}
}else{
$field[] = $t['time'];
$order[] = $t['time'].' ASC';
}
$t['field'] .= " as v";
$field[] = $t['field'];
$field[] = $t['sf'];
$field = join(",",$field); //拼接
$order = join(',',$order);
$sql = "select $field from {$t['table']} where {$t['sf']}='$sid'";
$sql = "select $field from {$t['table']} where {$t['sf']}='$sid' ORDER BY $order";
$sth = $this->dbh->prepare($sql);
$sth->execute();