<?php
/** 
 * UQ云商：	www.uqcms.com  
 * 联系QQ：	2200631718 
 * 可免费商用，需要留UQ云商链接作为交换，只首页底部留取即可，不影响使用。
 */

defined('IN_UQ') or exit('Access Denied'); class statistic_uqcms extends control { function __construct(){ $this->aid = $_SESSION['admin']['aid']; parent::__construct(); } public function order() { $uq0 = time_range::today(); $uq0 = time_range::today(); $uq1 = $this->db->get_all("select count(distinct id) order_count, FROM_UNIXTIME(addtime, '%Y-%m-%d %H:00:00') as hours from ".table('order_info')." where addtime >= ".$uq0['stime']." and addtime <= ".$uq0['etime']." group by hours order by addtime"); if($uq1){ foreach($uq1 as $uq2){ $uq3[strtotime($uq2['hours'])] = $uq2['order_count']; } } $time2 = time_range::yesterday(1); $day_all2 = $this->db->get_all("select count(distinct id) order_count, FROM_UNIXTIME(addtime, '%Y-%m-%d %H:00:00') as hours from ".table('order_info')." where addtime >= ".$time2['stime']." and addtime <= ".$time2['etime']." group by hours order by addtime"); if($day_all2){ foreach($day_all2 as $uq2){ $count_arr2[strtotime($uq2['hours'])] = $uq2['order_count']; } } for ($uq4 = 0; $uq4<24; $uq4++){ $uq5 = $uq0['stime'] + ($uq4*3600); $uq6['time'] = date('H', $uq5); if(isset($uq3[$uq5])){ $uq6['count'] = $uq3[$uq5]; }else{ $uq6['count'] = '0'; } $day_time2 = $time2['stime'] + ($uq4*3600); if(isset($count_arr2[$day_time2])){ $uq6['count2'] = $count_arr2[$day_time2]; }else{ $uq6['count2'] = '0'; } $uq7[] = $uq6; } foreach($uq7 as $uq2){ $uq8[] = $uq2['time']; $uq9[] = $uq2['count']; $countarr2[] = $uq2['count2']; } $uq10['time'] = implode(',', $uq8); $uq10['count1'] = implode(',', $uq9); $uq10['count2'] = implode(',', $countarr2); $this->assign('row', $uq10); $this->display(); } function goods() { $uq11 = $this->db->get_one("select count(id) as total from ".table('goods')." "); $uq7['goods'] = $uq11['total']; $uq12 = $this->db->get_one("select count(id) as total from ".table('goods')." where status = 1"); $uq7['seller_goods'] = $uq12['total']; $this->assign('data', $uq7); $uq13 = $this->db->get_all("select * from ".table('goods')." order by volume desc limit 10"); if($uq13){ foreach($uq13 as $uq2){ $uq14[] = $uq2; } } $this->assign('vol_list', $uq14); $this->display(); } function member() { $this->display(); } } 