Statindustry.php 24 KB

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