Statindustry.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. use think\facade\Db;
  6. /**
  7. * ============================================================================
  8. * DSMall多用户商城
  9. * ============================================================================
  10. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  11. * 网站地址: http://www.csdeshang.com
  12. * ----------------------------------------------------------------------------
  13. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  14. * 不允许对程序代码以任何形式任何目的的再发布。
  15. * ============================================================================
  16. * 控制器
  17. */
  18. class Statindustry extends AdminControl
  19. {
  20. public function initialize()
  21. {
  22. parent::initialize(); // TODO: Change the autogenerated stub
  23. include_once root_path(). 'extend/mall/statistics.php';
  24. include_once root_path(). 'extend/mall/datehelper.php';
  25. Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/stat.lang.php');
  26. $stat_model = model('stat');
  27. //存储参数
  28. $this->search_arr = input('param.');
  29. //处理搜索时间
  30. if (in_array(request()->action(),array('scale','rank','price'))){
  31. $this->search_arr = $stat_model->dealwithSearchTime($this->search_arr);
  32. //获得系统年份
  33. $year_arr = getSystemYearArr();
  34. //获得系统月份
  35. $month_arr = getSystemMonthArr();
  36. //获得本月的周时间段
  37. $week_arr = getMonthWeekArr($this->search_arr['week']['current_year'], $this->search_arr['week']['current_month']);
  38. View::assign('year_arr', $year_arr);
  39. View::assign('month_arr', $month_arr);
  40. View::assign('week_arr', $week_arr);
  41. }
  42. View::assign('search_arr', $this->search_arr);
  43. /**
  44. * 处理商品分类
  45. */
  46. $show_depth = 3;//select需要展示的深度
  47. if (in_array(request()->action(),array('scale','general'))){//仅显示前两级分类
  48. $show_depth = 2;
  49. }
  50. $gcid=input('param.choose_gcid');
  51. $this->choose_gcid = $gcid >0 ? $gcid : 0;
  52. $gccache_arr = model('goodsclass')->getGoodsclassCache($this->choose_gcid,$show_depth);
  53. $this->gc_arr = $gccache_arr['showclass'];
  54. View::assign('gc_json',json_encode($gccache_arr['showclass']));
  55. View::assign('gc_choose_json',json_encode($gccache_arr['choose_gcid']));
  56. }
  57. /**
  58. * 行业规模
  59. */
  60. public function scale(){
  61. if(!isset($this->search_arr['search_type'])){
  62. $this->search_arr['search_type'] = 'day';
  63. }
  64. $stat_model = model('stat');
  65. //获得搜索的开始时间和结束时间
  66. $searchtime_arr = $stat_model->getStarttimeAndEndtime($this->search_arr);
  67. View::assign('searchtime',implode('|',$searchtime_arr));
  68. $this->setAdminCurItem('scale');
  69. return View::fetch();
  70. }
  71. /**
  72. * 行业规模列表
  73. */
  74. public function scale_list(){
  75. //获得子分类ID
  76. $gc_childid = $gc_childarr = array();
  77. if (input('param.choose_gcid') > 0){//如果进行了分类搜索,则统计该分类下的子分类
  78. $gc_childdepth = $this->gc_arr[input('param.choose_gcid')]['depth'] + 1;
  79. $gc_childid = explode(',',$this->gc_arr[input('param.choose_gcid')]['child']);
  80. if ($gc_childid){
  81. foreach ((array)$this->gc_arr as $k=>$v){
  82. if (in_array($v['gc_id'],$gc_childid)){
  83. $gc_childarr[$v['gc_id']] = $v;
  84. }
  85. }
  86. }
  87. } else {//如果没有搜索分类,则默认统计一级分类
  88. $gc_childdepth = 1;
  89. foreach ((array)$this->gc_arr as $k=>$v){
  90. if ($v['depth'] == 1){
  91. $gc_childarr[$v['gc_id']] = $v;
  92. }
  93. }
  94. }
  95. if($gc_childarr){
  96. $stat_model = model('stat');
  97. $stat_list = array();
  98. //构造横轴数据
  99. foreach($gc_childarr as $k=>$v){
  100. $stat_list[$k]['gc_name'] = $v['gc_name'];
  101. $stat_list[$k]['y'] = 0;
  102. }
  103. $where = array();
  104. $where[] = array('order_isvalid','=',1);//计入统计的有效订单
  105. $searchtime_arr_tmp = explode('|',input('param.t'));
  106. foreach ((array)$searchtime_arr_tmp as $k=>$v){
  107. $searchtime_arr[] = intval($v);
  108. }
  109. $where[] = array('order_add_time','between',$searchtime_arr);
  110. if ($this->choose_gcid > 0){
  111. $where[] = array('gc_parentid_'.($gc_childdepth-1),'=',$this->choose_gcid);
  112. }
  113. $field = 'gc_parentid_'.$gc_childdepth.' as statgc_id';
  114. $stattype = input('param.stattype');
  115. switch ($stattype){
  116. case 'ordernum':
  117. $caption = lang('statstore_ordernum');
  118. $field .= ',COUNT(DISTINCT order_id) as ordernum';
  119. $orderby = 'ordernum desc';
  120. break;
  121. case 'goodsnum':
  122. $caption = lang('goodsnum');
  123. $field .= ',SUM(goods_num) as goodsnum';
  124. $orderby = 'goodsnum desc';
  125. break;
  126. default:
  127. $stattype = 'orderamount';
  128. $caption = lang('statstore_orderamount');
  129. $field .= ',SUM(goods_pay_price) as orderamount';
  130. $orderby = 'orderamount desc';
  131. break;
  132. }
  133. $orderby .= ',statgc_id asc';
  134. $goods_list = $stat_model->statByStatordergoods($where, $field, 0, 0, $orderby, 'statgc_id');
  135. foreach ((array)$goods_list as $k=>$v){
  136. $statgc_id = intval($v['statgc_id']);
  137. if (in_array($statgc_id,array_keys($gc_childarr))){
  138. $stat_list[$statgc_id]['gc_name'] = strval($gc_childarr[$v['statgc_id']]['gc_name']);
  139. } else {
  140. $stat_list[$statgc_id]['gc_name'] = lang('other');
  141. }
  142. switch ($stattype){
  143. case 'orderamount':
  144. $stat_list[$statgc_id]['y'] = floatval($v[$stattype]);
  145. break;
  146. default:
  147. $stat_list[$statgc_id]['y'] = intval($v[$stattype]);
  148. break;
  149. }
  150. }
  151. //构造横轴数据
  152. foreach($stat_list as $k=>$v){
  153. //数据
  154. $stat_arr['series'][0]['data'][] = array('name'=>strval($v['gc_name']),'y'=>$v['y']);
  155. //横轴
  156. $stat_arr['xAxis']['categories'][] = strval($v['gc_name']);
  157. }
  158. //得到统计图数据
  159. $stat_arr['series'][0]['name'] = $caption;
  160. $stat_arr['title'] = sprintf(lang('industry_statis'),$caption);
  161. $stat_arr['legend']['enabled'] = false;
  162. $stat_arr['yAxis']['title']['text'] = $caption;
  163. $stat_arr['yAxis']['title']['align'] = 'high';
  164. $statjson = getStatData_Basicbar($stat_arr);
  165. View::assign('stat_json',$statjson);
  166. View::assign('stattype',$stattype);
  167. echo View::fetch('stat_linelabels');
  168. }
  169. }
  170. /**
  171. * 行业排行
  172. */
  173. public function rank(){
  174. if(!isset($this->search_arr['search_type'])){
  175. $this->search_arr['search_type'] = 'day';
  176. }
  177. $stat_model = model('stat');
  178. //获得搜索的开始时间和结束时间
  179. $searchtime_arr = $stat_model->getStarttimeAndEndtime($this->search_arr);
  180. $where = array();
  181. $where[] = array('order_isvalid','=',1);//计入统计的有效订单
  182. $where[] = array('order_add_time','between',$searchtime_arr);
  183. if ($this->choose_gcid > 0){
  184. $gc_id_depth = $this->gc_arr[$this->choose_gcid]['depth'];
  185. $where[] = array('gc_parentid_'.$gc_id_depth,'=',$this->choose_gcid);
  186. }
  187. /**
  188. * 商品排行
  189. */
  190. $goods_stat_arr = array();
  191. //构造横轴数据
  192. for($i=1; $i<=50; $i++){
  193. //数据
  194. $goods_stat_arr['series'][0]['data'][] = array('name'=>'','y'=>0);
  195. //横轴
  196. $goods_stat_arr['xAxis']['categories'][] = "$i";
  197. }
  198. $field = 'goods_id,goods_name,SUM(goods_num) as goodsnum';
  199. $goods_list = $stat_model->statByStatordergoods($where, $field, 0, 50, 'goodsnum desc,goods_id asc', 'goods_id');
  200. foreach ((array)$goods_list as $k=>$v){
  201. $goods_stat_arr['series'][0]['data'][$k] = array('name'=>strval($v['goods_name']),'y'=>floatval($v['goodsnum']));
  202. }
  203. //得到统计图数据
  204. $goods_stat_arr['series'][0]['name'] = lang('goodsnum');
  205. $goods_stat_arr['title'] = lang('statindustry_top_50');
  206. $goods_stat_arr['legend']['enabled'] = false;
  207. $goods_stat_arr['yAxis'] = lang('goodsnum');
  208. $goods_statjson = getStatData_Column2D($goods_stat_arr);
  209. /**
  210. * 店铺排行
  211. */
  212. $store_stat_arr = array();
  213. //构造横轴数据
  214. for($i=1; $i<=30; $i++){
  215. //数据
  216. $store_stat_arr['series'][0]['data'][] = array('name'=>'','y'=>0);
  217. //横轴
  218. $store_stat_arr['xAxis']['categories'][] = "$i";
  219. }
  220. $field = 'store_id,store_name,COUNT(DISTINCT order_id) as ordernum';
  221. $store_list = $stat_model->statByStatordergoods($where, $field, 0, 30, 'ordernum desc,store_id asc', 'store_id');
  222. foreach ((array)$store_list as $k=>$v){
  223. $store_stat_arr['series'][0]['data'][$k] = array('name'=>strval($v['store_name']),'y'=>floatval($v['ordernum']));
  224. }
  225. //得到统计图数据
  226. $store_stat_arr['series'][0]['name'] = lang('statstore_ordernum');
  227. $store_stat_arr['title'] = lang('statindustry_top_30');
  228. $store_stat_arr['legend']['enabled'] = false;
  229. $store_stat_arr['yAxis'] = lang('statstore_ordernum');
  230. $store_statjson = getStatData_Column2D($store_stat_arr);
  231. View::assign('goods_statjson',$goods_statjson);
  232. View::assign('goods_list',$goods_list);
  233. View::assign('store_statjson',$store_statjson);
  234. View::assign('store_list',$store_list);
  235. $this->setAdminCurItem('rank');
  236. return View::fetch();
  237. }
  238. /**
  239. * 价格分布
  240. */
  241. public function price(){
  242. if(!isset($this->search_arr['search_type'])){
  243. $this->search_arr['search_type'] = 'day';
  244. }
  245. $stat_model = model('stat');
  246. //获得搜索的开始时间和结束时间
  247. $searchtime_arr = $stat_model->getStarttimeAndEndtime($this->search_arr);
  248. $where = array();
  249. $where[] = array('order_isvalid','=',1);//计入统计的有效订单
  250. $where[] = array('order_add_time','between',$searchtime_arr);
  251. if ($this->choose_gcid > 0){
  252. $gc_id_depth = $this->gc_arr[$this->choose_gcid]['depth'];
  253. $where[] = array('gc_parentid_'.$gc_id_depth,'=',$this->choose_gcid);
  254. }
  255. $field='1';
  256. $pricerange_arr = ($t = trim(config('ds_config.stat_orderpricerange')))?unserialize($t):'';
  257. if ($pricerange_arr){
  258. $goodsnum_stat_arr['series'][0]['name'] = lang('goodsnum');
  259. $orderamount_stat_arr['series'][0]['name'] = lang('statstore_orderamount');
  260. //设置价格区间最后一项,最后一项只有开始值没有结束值
  261. $pricerange_count = count($pricerange_arr);
  262. if ($pricerange_arr[$pricerange_count-1]['e']){
  263. $pricerange_arr[$pricerange_count]['s'] = $pricerange_arr[$pricerange_count-1]['e'] + 1;
  264. $pricerange_arr[$pricerange_count]['e'] = '';
  265. }
  266. foreach ((array)$pricerange_arr as $k=>$v){
  267. $v['s'] = intval($v['s']);
  268. $v['e'] = intval($v['e']);
  269. //构造查询字段
  270. if ($v['e']){
  271. $field .= ",SUM(IF(goods_pay_price/goods_num > {$v['s']} and goods_pay_price/goods_num <= {$v['e']},goods_num,0)) as goodsnum_{$k}";
  272. $field .= " ,SUM(IF(goods_pay_price/goods_num > {$v['s']} and goods_pay_price/goods_num <= {$v['e']},goods_pay_price,0)) as orderamount_{$k}";
  273. } else {//由于最后一个区间没有结束值,所以需要单独构造sql
  274. $field .= ",SUM(IF(goods_pay_price/goods_num > {$v['s']},goods_num,0)) as goodsnum_{$k}";
  275. $field .= " ,SUM(IF(goods_pay_price/goods_num > {$v['s']},goods_pay_price,0)) as orderamount_{$k}";
  276. }
  277. }
  278. $ordergooods_list = Db::query('SELECT '.$field.' FROM '.config('database.connections.mysql.prefix').'statordergoods WHERE order_isvalid=1 AND order_add_time BETWEEN '.$searchtime_arr[0].' AND '.$searchtime_arr[1].($this->choose_gcid > 0?(' AND gc_parentid_'.$gc_id_depth.'='.$this->choose_gcid):''));
  279. if($ordergooods_list){
  280. $ordergooods_list= current($ordergooods_list);
  281. foreach ((array)$pricerange_arr as $k=>$v){
  282. //横轴
  283. if($v['e']){
  284. $goodsnum_stat_arr['xAxis']['categories'][] = $v['s'].'-'.$v['e'];
  285. $orderamount_stat_arr['xAxis']['categories'][] = $v['s'].'-'.$v['e'];
  286. } else {
  287. $goodsnum_stat_arr['xAxis']['categories'][] = $v['s'].lang('above');
  288. $orderamount_stat_arr['xAxis']['categories'][] = $v['s'].lang('above');
  289. }
  290. //统计图数据
  291. $goodsnum_stat_arr['series'][0]['data'][$k] = 0;
  292. $orderamount_stat_arr['series'][0]['data'][$k] = 0;
  293. if (isset($ordergooods_list['goodsnum_'.$k])){
  294. $goodsnum_stat_arr['series'][0]['data'][$k] = intval($ordergooods_list['goodsnum_'.$k]);
  295. }
  296. if (isset($ordergooods_list['orderamount_'.$k])){
  297. $orderamount_stat_arr['series'][0]['data'][$k] = intval($ordergooods_list['orderamount_'.$k]);
  298. }
  299. }
  300. }
  301. //得到统计图数据
  302. $goodsnum_stat_arr['legend']['enabled'] = false;
  303. $goodsnum_stat_arr['title'] = lang('industry_goods_number');
  304. $goodsnum_stat_arr['yAxis'] = '';
  305. $orderamount_stat_arr['legend']['enabled'] = false;
  306. $orderamount_stat_arr['title'] = lang('industry_order_amount');
  307. $orderamount_stat_arr['yAxis'] = '';
  308. $goodsnum_stat_json = getStatData_LineLabels($goodsnum_stat_arr);
  309. $orderamount_stat_json = getStatData_LineLabels($orderamount_stat_arr);
  310. } else {
  311. $goodsnum_stat_json = '';
  312. $orderamount_stat_json = '';
  313. }
  314. View::assign('goodsnum_stat_json',$goodsnum_stat_json);
  315. View::assign('orderamount_stat_json',$orderamount_stat_json);
  316. $this->setAdminCurItem('price');
  317. return View::fetch();
  318. }
  319. /**
  320. * 销售统计
  321. */
  322. public function general(){
  323. $this->setAdminCurItem('general');
  324. return View::fetch();
  325. }
  326. /**
  327. * 概况总览
  328. */
  329. public function general_list(){
  330. $ordergoods_list=array();
  331. //获得子分类ID
  332. $gc_childid = $gc_childarr = array();
  333. if ($this->choose_gcid > 0){
  334. $gc_childdepth = $this->gc_arr[$this->choose_gcid]['depth'] + 1;
  335. $gc_childid = explode(',',$this->gc_arr[$this->choose_gcid]['child']);
  336. if ($gc_childid){
  337. foreach ((array)$this->gc_arr as $k=>$v){
  338. if (in_array($v['gc_id'],$gc_childid)){
  339. $gc_childarr[$v['gc_id']] = $v;
  340. }
  341. }
  342. }
  343. } else {//如果没有搜索分类,则默认统计一级分类
  344. $gc_childdepth = 1;
  345. foreach ((array)$this->gc_arr as $k=>$v){
  346. if ($v['depth'] == 1){
  347. $gc_childarr[$v['gc_id']] = $v;
  348. }
  349. }
  350. }
  351. $statlist = array();
  352. if ($gc_childarr){
  353. $stat_model = model('stat');
  354. //查询订单商品信息
  355. $where = array();
  356. $where[] = array('order_isvalid','=',1);//计入统计的有效订单
  357. //计算开始时间和结束时间
  358. $searchtime_arr[1] = strtotime(date('Y-m-d',TIMESTAMP)) - 1;//昨天23:59点
  359. $searchtime_arr[0] = $searchtime_arr[1] - (86400 * 30) + 1; //从昨天开始30天前
  360. $where[] = array('order_add_time','between',$searchtime_arr);
  361. //halt($this->choose_gcid);
  362. if ($this->choose_gcid > 0){
  363. $where[] = array('gc_parentid_'.($gc_childdepth-1),'=',$this->choose_gcid);
  364. }
  365. $field = 'gc_parentid_'.$gc_childdepth.' as statgc_id,COUNT(DISTINCT goods_id) as ordergcount,SUM(goods_num) as ordergnum,SUM(goods_pay_price) as orderamount';
  366. $ordergoods_list_tmp = $stat_model->statByStatordergoods($where, $field, 0, 0, '', 'gc_parentid_'.$gc_childdepth);
  367. foreach ((array)$ordergoods_list_tmp as $k=>$v){
  368. $ordergoods_list[$v['statgc_id']] = $v;
  369. }
  370. //查询商品信息
  371. $field = 'gc_id_'.$gc_childdepth.' as statgc_id,COUNT(*) as goodscount,AVG(goods_price) as priceavg';
  372. $goods_list_tmp = $stat_model->statByGoods(array('is_virtual'=>0), $field, 0, 0, '', 'gc_id_'.$gc_childdepth);
  373. foreach ((array)$goods_list_tmp as $k=>$v){
  374. $goods_list[$v['statgc_id']] = $v;
  375. }
  376. //将订单和商品数组合并
  377. $statlist_tmp = array();
  378. foreach ($gc_childarr as $k=>$v){
  379. $tmp = array();
  380. $tmp['statgc_id'] = $v['gc_id'];
  381. $tmp['gc_name'] = $v['gc_name'];
  382. $tmp['ordergcount'] = isset($ordergoods_list[$v['gc_id']]['ordergcount'])?$ordergoods_list[$v['gc_id']]['ordergcount']:0;
  383. $tmp['ordergnum'] = isset($ordergoods_list[$v['gc_id']]['ordergnum'])?$ordergoods_list[$v['gc_id']]['ordergnum']:0;
  384. $tmp['orderamount'] = isset($ordergoods_list[$v['gc_id']]['orderamount'])?$ordergoods_list[$v['gc_id']]['orderamount']:0;
  385. $tmp['goodscount'] = isset($goods_list[$v['gc_id']]['goodscount'])?$goods_list[$v['gc_id']]['goodscount']:0;
  386. $tmp['priceavg'] = ds_price_format(isset($goods_list[$v['gc_id']]['priceavg'])?$goods_list[$v['gc_id']]['priceavg']:0);
  387. $tmp['unordergcount'] = intval($tmp['goodscount']) - intval($tmp['ordergcount']);//计算无销量商品数
  388. $statlist_tmp[]= $tmp;
  389. }
  390. $statlist = array();
  391. //整理排序
  392. $orderby = isset($this->search_arr['orderby'])?trim($this->search_arr['orderby']):'';
  393. if (!$orderby){
  394. $orderby = 'orderamount desc';
  395. }
  396. $orderkeys = explode(' ',$orderby);
  397. $keysvalue = $new_array = array();
  398. foreach ($statlist_tmp as $k=>$v){
  399. $keysvalue[$k] = $v[$orderkeys[0]];
  400. }
  401. if($orderkeys[1] == 'asc'){
  402. asort($keysvalue);
  403. }else{
  404. arsort($keysvalue);
  405. }
  406. reset($keysvalue);
  407. foreach ($keysvalue as $k=>$v){
  408. $statlist[$k] = $statlist_tmp[$k];
  409. }
  410. //导出Excel
  411. if (isset($this->search_arr['exporttype']) && $this->search_arr['exporttype'] == 'excel'){
  412. //列表header
  413. $statheader = array();
  414. $statheader[] = array('text'=>lang('ds_goodsclass'),'key'=>'gc_name');
  415. $statheader[] = array('text'=>lang('average_price').'('.lang('ds_yuan').')','key'=>'priceavg','isorder'=>1);
  416. $statheader[] = array('text'=>lang('have_sale_goods_number'),'key'=>'ordergcount','isorder'=>1);
  417. $statheader[] = array('text'=>lang('ds_order_sn'),'key'=>'ordergnum','isorder'=>1);
  418. $statheader[] = array('text'=>lang('stattrade_order_amount').'('.lang('ds_yuan').')','key'=>'orderamount','isorder'=>1);
  419. $statheader[] = array('text'=>lang('industry_goods_total'),'key'=>'goodscount','isorder'=>1);
  420. $statheader[] = array('text'=>lang('no_sale_goods_number'),'key'=>'unordergcount','isorder'=>1);
  421. //导出Excel
  422. $excel_obj = new \excel\Excel();
  423. $excel_data = array();
  424. //设置样式
  425. $excel_obj->setStyle(array('id'=>'s_title','Font'=>array('FontName'=>'宋体','Size'=>'12','Bold'=>'1')));
  426. //header
  427. foreach ($statheader as $k=>$v){
  428. $excel_data[0][] = array('styleid'=>'s_title','data'=>$v['text']);
  429. }
  430. //data
  431. foreach ($statlist as $k=>$v){
  432. foreach ($statheader as $h_k=>$h_v){
  433. $excel_data[$k+1][] = array('data'=>$v[$h_v['key']]);
  434. }
  435. }
  436. $excel_data = $excel_obj->charset($excel_data,CHARSET);
  437. $excel_obj->addArray($excel_data);
  438. $excel_obj->addWorksheet($excel_obj->charset(lang('industry_state_view'),CHARSET));
  439. $excel_obj->generateXML($excel_obj->charset(lang('industry_state_view'),CHARSET).date('Y-m-d-H',TIMESTAMP));
  440. exit();
  441. }
  442. }
  443. //列表header
  444. $statheader = array();
  445. $statheader[] = array('text'=>lang('ds_goodsclass'),'key'=>'gc_name');
  446. $statheader[] = array('text'=>'<span title="'.lang('goods_class_average_goods_price').'" class="tip iconfont">&#xe71c;</span>&nbsp;'.lang('average_price').'('.lang('ds_yuan').')','key'=>'priceavg','isorder'=>1);
  447. $statheader[] = array('text'=>'<span title="'.lang('have_sale_goods_number_recent').'" class="tip iconfont">&#xe71c;</span>&nbsp;'.lang('have_sale_goods_number'),'key'=>'ordergcount','isorder'=>1);
  448. $statheader[] = array('text'=>'<span title="'.lang('industry_goods_total_recent').'" class="tip iconfont">&#xe71c;</span>&nbsp;'.lang('ds_order_sn'),'key'=>'ordergnum','isorder'=>1);
  449. $statheader[] = array('text'=>'<span title="'.lang('have_sale_goods_amount_recent').'" class="tip iconfont">&#xe71c;</span>&nbsp;'.lang('stattrade_order_amount').'('.lang('ds_yuan').')','key'=>'orderamount','isorder'=>1);
  450. $statheader[] = array('text'=>'<span title="'.lang('goods_class_goods_number').'" class="tip iconfont">&#xe71c;</span>&nbsp;'.lang('industry_goods_total'),'key'=>'goodscount','isorder'=>1);
  451. $statheader[] = array('text'=>'<span title="'.lang('have_sale_goods_number_recent').'" class="tip iconfont">&#xe71c;</span>&nbsp;'.lang('no_sale_goods_number'),'key'=>'unordergcount','isorder'=>1);
  452. View::assign('statheader',$statheader);
  453. View::assign('statlist',$statlist);
  454. View::assign('orderby',$orderby);
  455. View::assign('actionurl',(string)url('Statindustry'.'/'.request()->action(),['choose_gcid'=>$this->choose_gcid]));
  456. echo View::fetch('listandorder');exit;
  457. }
  458. protected function getAdminItemList()
  459. {
  460. $menu_array = array(
  461. array(
  462. 'name' => 'scale', 'text' => lang('stat_industryscale'), 'url' => (string)url('Statindustry/scale')
  463. ), array(
  464. 'name' => 'rank', 'text' => lang('stat_industryrank'), 'url' => (string)url('Statindustry/rank')
  465. ), array(
  466. 'name' => 'price', 'text' => lang('stat_industryprice'), 'url' => (string)url('Statindustry/price')
  467. ),array(
  468. 'name' => 'general', 'text' => lang('stat_industrygeneral'), 'url' => (string)url('Statindustry/general')
  469. )
  470. );
  471. return $menu_array;
  472. }
  473. }