Statindustry.php 24 KB

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