添加不准确的按月在线下载统计,并动态调整CSS样式
This commit is contained in:
parent
df166ae7ed
commit
b39bd3dbfb
|
@ -115,6 +115,16 @@ class Admin_StatController extends Zend_Controller_Action
|
||||||
$rows = $rs->fetchAll();
|
$rows = $rs->fetchAll();
|
||||||
|
|
||||||
$this->view->data = $rows;
|
$this->view->data = $rows;
|
||||||
|
|
||||||
|
$sql = "select count(extract(month from ts_created)) as c,extract(month from ts_created) as m,extract(year from ts_created) as y from dataorder
|
||||||
|
where status=0";
|
||||||
|
if ($y)
|
||||||
|
$sql.=" and extract(year from ts_created)='$y' ";
|
||||||
|
$sql.=" group by extract(month from ts_created),extract(year from ts_created)
|
||||||
|
order by extract(year from ts_created),extract(month from ts_created)";
|
||||||
|
$rs = $this->db->query($sql);
|
||||||
|
$rows = $rs->fetchAll();
|
||||||
|
$this->view->online = $rows;
|
||||||
|
|
||||||
$sql = "select count(extract(month from ts_created)) as c,extract(month from ts_created) as m,extract(year from ts_created) as y from offlineapp
|
$sql = "select count(extract(month from ts_created)) as c,extract(month from ts_created) as m,extract(year from ts_created) as y from offlineapp
|
||||||
where ts_approved is not null";
|
where ts_approved is not null";
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<a href="/admin/stat/month/y/2012">2012</a>
|
<a href="/admin/stat/month/y/2012">2012</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="charts">
|
<div class="charts">
|
||||||
<div class="title" id="title_online"><?php echo $this->y.'年按月在线下载条数统计';?></div>
|
<div class="title" id="title_online"><?php echo $this->y.'年按月在线下载条数(有用途记录,且无数据重复)统计';?></div>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if($this->data!='' && count($this->data)!= 0)
|
if($this->data!='' && count($this->data)!= 0)
|
||||||
|
@ -76,7 +76,7 @@ $(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="content" id="chart_div_online" style="width:600px;"></div>
|
<div class="content" id="chart_div_online" <?php if ($this->y) echo ' style="width:600px;"'; ?>></div>
|
||||||
<?php
|
<?php
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
@ -84,6 +84,52 @@ $(function () {
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="charts">
|
||||||
|
<div class="title" id="title_online1"><?php echo $this->y.'年按月在线下载条数(根据用户下载记录,会有数据重复,偏大)统计';?></div>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if($this->online!='' && count($this->online)!= 0)
|
||||||
|
{
|
||||||
|
$online = $this->online;
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
<?php
|
||||||
|
$vars_online = array();
|
||||||
|
$month_online = array();
|
||||||
|
foreach ($online as $v)
|
||||||
|
{
|
||||||
|
$vars_online[] = $v['c'];
|
||||||
|
$month_online[]= "'".$v['m']."月'";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
var s1 = [<?php echo join(',',$vars_online); ?>];
|
||||||
|
var ticks = [<?php echo join(',',$month_online); ?>];
|
||||||
|
|
||||||
|
plot1 = $.jqplot('chart_div_online1', [s1], {
|
||||||
|
seriesDefaults:{
|
||||||
|
renderer:$.jqplot.BarRenderer,
|
||||||
|
pointLabels: { show: true }
|
||||||
|
},
|
||||||
|
axes: {
|
||||||
|
xaxis: {
|
||||||
|
renderer: $.jqplot.CategoryAxisRenderer,
|
||||||
|
ticks: ticks
|
||||||
|
}
|
||||||
|
},
|
||||||
|
highlighter: { show: false }
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="content" id="chart_div_online1"<?php if ($this->y) echo ' style="width:600px;"'; ?>></div>
|
||||||
|
<?php
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
echo "暂无数据";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="charts">
|
<div class="charts">
|
||||||
<div class="title" id="title_offline"><?php echo $this->y.'年按月离线通过申请次数统计';?></div>
|
<div class="title" id="title_offline"><?php echo $this->y.'年按月离线通过申请次数统计';?></div>
|
||||||
|
@ -121,7 +167,7 @@ $(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="content" id="chart_div_offline" style="width:600px;"></div>
|
<div class="content" id="chart_div_offline" <?php if ($this->y) echo ' style="width:600px;"'; ?>></div>
|
||||||
<?php
|
<?php
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
@ -166,7 +212,7 @@ $(function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="content" id="chart_div_newuser" style="width:600px;"></div>
|
<div class="content" id="chart_div_newuser" <?php if ($this->y) echo ' style="width:600px;"'; ?>></div>
|
||||||
<?php
|
<?php
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue