#391 添加了数据可视化中的排序规则
This commit is contained in:
parent
501eabeeb6
commit
f73cf609c6
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue