user.blade.php 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. @extends('admin/layout')
  2. @section('content')
  3. <body class="gray-bg">
  4. <div class="wrapper wrapper-content">
  5. <div class="row">
  6. <div class="col-sm-3">
  7. <div class="ibox float-e-margins">
  8. <div class="ibox-title">
  9. <span class="label label-success pull-right"></span>
  10. <h5>已发布内容</h5>
  11. </div>
  12. <div class="ibox-content">
  13. <h1 class="no-margins">{{ $total_content }}</h1>
  14. <div class="stat-percent font-bold text-success">
  15. </div>
  16. <small></small>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="col-sm-3">
  21. <div class="ibox float-e-margins">
  22. <div class="ibox-title">
  23. <span class="label label-info pull-right"></span>
  24. <h5>网页浏览量</h5>
  25. </div>
  26. <div class="ibox-content">
  27. <h1 class="no-margins">{{$total_pv_data['pv']}}</h1>
  28. <div class="stat-percent font-bold text-info">
  29. </div>
  30. <small></small>
  31. </div>
  32. </div>
  33. </div>
  34. <div class="col-sm-3">
  35. <div class="ibox float-e-margins">
  36. <div class="ibox-title">
  37. <span class="label label-primary pull-right"></span>
  38. <h5>访客数</h5>
  39. </div>
  40. <div class="ibox-content">
  41. <h1 class="no-margins">{{$total_pv_data['uv']}}</h1>
  42. <div class="stat-percent font-bold text-navy">
  43. </div>
  44. <small></small>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="col-sm-3">
  49. <div class="ibox float-e-margins">
  50. <div class="ibox-title">
  51. <span class="label label-danger pull-right"></span>
  52. <h5>平均在线时长</h5>
  53. </div>
  54. <div class="ibox-content">
  55. <h1 class="no-margins">{{$total_pv_data['avg_duration']}}</h1>
  56. <div class="stat-percent font-bold text-danger">
  57. </div>
  58. <small></small>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="row">
  64. <div class="col-sm-12">
  65. <div class="ibox float-e-margins">
  66. <div class="ibox-title">
  67. <div class="row">
  68. <div class="col-sm-6">
  69. <h5>流量趋势</h5>
  70. </div>
  71. <div class="col-sm-6">
  72. <h5>行为趋势</h5>
  73. </div>
  74. </div>
  75. {{--<div class="pull-right">--}}
  76. {{--<div class="btn-group">--}}
  77. {{--<button type="button" class="btn btn-xs btn-white active">周</button>--}}
  78. {{--<button type="button" class="btn btn-xs btn-white">月</button>--}}
  79. {{--</div>--}}
  80. {{--</div>--}}
  81. </div>
  82. <div class="ibox-content">
  83. <div class="row">
  84. <div class="col-sm-6">
  85. <div id="main" style="width: 100%;height: 300px;"></div>
  86. <script>
  87. var charts = [];
  88. window.onresize = function () {
  89. for (var i = 0; i < charts.length; i++) {
  90. charts[i].resize();
  91. }
  92. }
  93. </script>
  94. <script src="{{asset('js/plugins/echarts/echarts.min.js')}}"></script>
  95. <script type="text/javascript">
  96. var myChart = echarts.init(document.getElementById('main'));
  97. //app.title = '折柱混合';
  98. var xAxis_data =@json($pv_data['xAxis']);
  99. var pv =@json($pv_data['pv']);
  100. var uv =@json($pv_data['uv']);
  101. var duration =@json($pv_data['duration']);
  102. var bounces =@json($pv_data['bounces']);
  103. var option = {
  104. tooltip: {
  105. trigger: 'axis',
  106. axisPointer: {
  107. type: 'cross',
  108. crossStyle: {
  109. color: '#999'
  110. }
  111. }
  112. },
  113. toolbox: {
  114. feature: {
  115. dataView: {show: true, readOnly: false},
  116. magicType: {show: true, type: ['line', 'bar']},
  117. restore: {show: true},
  118. saveAsImage: {show: true}
  119. }
  120. },
  121. legend: {
  122. data: ['点击量', '访客数']
  123. },
  124. xAxis: [
  125. {
  126. type: 'category',
  127. data: xAxis_data,
  128. axisPointer: {
  129. type: 'shadow'
  130. },
  131. splitLine: {
  132. show: false
  133. }
  134. }
  135. ],
  136. yAxis: [
  137. {
  138. type: 'value',
  139. name: '',
  140. min: 0,
  141. axisLabel: {
  142. formatter: '{value}'
  143. },
  144. axisLine: {
  145. show: false //隐藏Y轴
  146. }
  147. }
  148. ],
  149. series: [
  150. {
  151. name: '点击量',
  152. type: 'bar',
  153. data: pv
  154. },
  155. {
  156. name: '访客数',
  157. type: 'line',
  158. data: uv
  159. }
  160. ]
  161. };
  162. myChart.setOption(option);
  163. charts.push(myChart);
  164. </script>
  165. </div>
  166. <div class="col-sm-6">
  167. <div id="main2" style="width: 100%;height:300px;"></div>
  168. {{--<div class="flot-chart">--}}
  169. {{--<div class="flot-chart-content" id="flot-dashboard-chart"></div>--}}
  170. {{--</div>--}}
  171. <script type="text/javascript">
  172. var myChart = echarts.init(document.getElementById('main2'));
  173. //app.title = '折柱混合';
  174. var option = {
  175. tooltip: {
  176. trigger: 'axis',
  177. axisPointer: {
  178. type: 'cross',
  179. crossStyle: {
  180. color: '#999'
  181. }
  182. }
  183. },
  184. toolbox: {
  185. feature: {
  186. dataView: {show: true, readOnly: false},
  187. magicType: {show: true, type: ['line', 'bar']},
  188. restore: {show: true},
  189. saveAsImage: {show: true}
  190. }
  191. },
  192. legend: {
  193. data: ['平均在线时长', '跳出率']
  194. },
  195. xAxis: [
  196. {
  197. type: 'category',
  198. data: xAxis_data,
  199. axisPointer: {
  200. type: 'shadow'
  201. },
  202. splitLine: {
  203. show: false
  204. }
  205. },
  206. ],
  207. yAxis: [
  208. {
  209. type: 'value',
  210. name: '',
  211. min: 0,
  212. axisLabel: {
  213. formatter: '{value}'
  214. },
  215. axisLine: {
  216. show: false //隐藏Y轴
  217. }
  218. },
  219. {
  220. type: 'value',
  221. name: '',
  222. min: 0,
  223. max: 200,
  224. axisLabel: {//数字
  225. formatter: '{value}',
  226. show:false
  227. },
  228. axisTick:{//刻度线
  229. show:false
  230. },
  231. splitLine: {//横线
  232. show: false
  233. },
  234. axisLine: {
  235. show: false //隐藏Y轴
  236. }
  237. }
  238. ],
  239. series: [
  240. {
  241. name: '平均在线时长',
  242. type: 'bar',
  243. data: duration
  244. },
  245. {
  246. name: '跳出率',
  247. type: 'line',
  248. yAxisIndex: 1,
  249. data: bounces
  250. }
  251. ]
  252. };
  253. myChart.setOption(option);
  254. charts.push(myChart);
  255. </script>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. <div class="row">
  263. <div class="col-sm-12">
  264. <div class="row">
  265. <div class="col-sm-6">
  266. <div class="ibox float-e-margins">
  267. <div class="ibox-title">
  268. <h5>网站入口TOP10</h5>
  269. <div class="ibox-tools">
  270. </div>
  271. </div>
  272. <div class="ibox-content">
  273. <table class="table table-hover no-margins">
  274. <thead>
  275. <tr>
  276. <th>URL</th>
  277. <th><a style="font-size: 12px;font-weight: normal;color: black"
  278. onclick="units.more()">更多...</a></th>
  279. </tr>
  280. </thead>
  281. <tbody>
  282. @foreach($top_url as $key=>$value)
  283. @if($key>=10) @break; @endif
  284. <tr>
  285. <td>{{$value['url']}}</td>
  286. <td class="text-navy"> {{$value['pv']}}</td>
  287. </tr>
  288. @endforeach
  289. </tbody>
  290. </table>
  291. </div>
  292. </div>
  293. </div>
  294. <div class="col-sm-6">
  295. <div class="ibox float-e-margins">
  296. <div class="ibox-title">
  297. <h5>来源网站TOP10</h5>
  298. <div class="ibox-tools">
  299. </div>
  300. </div>
  301. <div class="ibox-content">
  302. <table class="table table-hover no-margins">
  303. <thead>
  304. <tr>
  305. <th>来源</th>
  306. <th><a style="font-size: 12px;font-weight: normal;color: black"
  307. onclick="units.sourceMore()">更多...</a></th>
  308. </tr>
  309. </thead>
  310. <tbody>
  311. @foreach($top_host as $key=>$value)
  312. @if($key>=10) @break; @endif
  313. <tr>
  314. <td>{{$value['ref_host']?$value['ref_host']:'直接访问'}}</td>
  315. <td class="text-navy"> {{$value['pv']}}</td>
  316. </tr>
  317. @endforeach
  318. </tbody>
  319. </table>
  320. </div>
  321. </div>
  322. </div>
  323. </div>
  324. <div class="row">
  325. <div class="col-sm-12">
  326. <div class="ibox float-e-margins">
  327. <div class="ibox-title">
  328. <h5>区域统计</h5>
  329. </div>
  330. <div class="ibox-content">
  331. <div class="row">
  332. <div class="col-sm-8">
  333. <div id="main3" style="width: 100%;height:300px;"></div>
  334. <script type="text/javascript">
  335. var myChart = echarts.init(document.getElementById('main3'));
  336. var country =@json($country_data['country']);
  337. var pv =@json($country_data['pv']);
  338. var uv =@json($country_data['uv']);
  339. var duration =@json($country_data['duration']);
  340. var bounces =@json($country_data['bounces']);
  341. var option = {
  342. tooltip: {
  343. trigger: 'axis',
  344. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  345. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  346. }
  347. },
  348. legend: {
  349. data: ['访问量', '访客数', '平均在线时长', '跳出率']
  350. },
  351. grid: {
  352. left: '3%',
  353. right: '4%',
  354. bottom: '3%',
  355. containLabel: true
  356. },
  357. xAxis: {
  358. type: 'value'
  359. },
  360. yAxis: {
  361. type: 'category',
  362. data: country
  363. },
  364. series: [
  365. {
  366. name: '访问量',
  367. type: 'bar',
  368. stack: '总量',
  369. label: {
  370. normal: {
  371. show: true,
  372. position: 'inside'
  373. }
  374. },
  375. data: pv
  376. },
  377. {
  378. name: '访客数',
  379. type: 'bar',
  380. stack: '总量',
  381. label: {
  382. normal: {
  383. show: true,
  384. position: 'inside'
  385. }
  386. },
  387. data: uv
  388. },
  389. {
  390. name: '平均在线时长',
  391. type: 'bar',
  392. stack: '总量',
  393. label: {
  394. normal: {
  395. show: true,
  396. position: 'inside'
  397. }
  398. },
  399. data: duration
  400. },
  401. {
  402. name: '跳出率',
  403. type: 'bar',
  404. stack: '总量',
  405. label: {
  406. normal: {
  407. show: true,
  408. position: 'inside'
  409. }
  410. },
  411. data: bounces
  412. }
  413. ]
  414. };
  415. myChart.setOption(option);
  416. charts.push(myChart);
  417. </script>
  418. </div>
  419. <div class="col-sm-4">
  420. <div id="main4" style="width: 100%;height:300px;"></div>
  421. <script type="text/javascript">
  422. var myChart = echarts.init(document.getElementById('main4'));
  423. var pie_data = @json($country_data['pie']);
  424. var pie_country =@json($country_data['pie_country']);
  425. var option = {
  426. tooltip: {
  427. trigger: 'item',
  428. formatter: "{a} <br/>{b} : {c} ({d}%)"
  429. },
  430. legend: {
  431. orient: 'vertical',
  432. left: 'left',
  433. data: pie_country
  434. },
  435. series: [
  436. {
  437. name: '访问来源',
  438. type: 'pie',
  439. radius: '55%',
  440. center: ['50%', '60%'],
  441. data: pie_data,
  442. itemStyle: {
  443. emphasis: {
  444. shadowBlur: 10,
  445. shadowOffsetX: 0,
  446. shadowColor: 'rgba(0, 0, 0, 0.5)'
  447. }
  448. }
  449. }
  450. ]
  451. };
  452. myChart.setOption(option);
  453. charts.push(myChart);
  454. </script>
  455. </div>
  456. </div>
  457. </div>
  458. </div>
  459. </div>
  460. </div>
  461. </div>
  462. </div>
  463. </div>
  464. </body>
  465. @endsection
  466. @section('footer')
  467. <script>
  468. var units = {
  469. more: function () {
  470. var str = '<div class="ibox float-e-margins">\n' +
  471. ' <div class="ibox-title">\n' +
  472. ' <h5>网站入口TOP10</h5>\n' +
  473. ' <div class="ibox-tools">\n' +
  474. ' </div>\n' +
  475. ' </div>\n' +
  476. ' <div class="ibox-content">\n' +
  477. ' <table class="table table-hover no-margins">\n' +
  478. ' <thead>\n' +
  479. ' <tr>\n' +
  480. ' <th>URL</th>\n' +
  481. ' <th></th>\n' +
  482. ' </tr>\n' +
  483. ' </thead>\n' +
  484. ' <tbody>\n' +
  485. ' @foreach($top_url as $key=>$value)' +
  486. ' <tr>\n' +
  487. ' <td>{{$value['url']}}</td>\n' +
  488. ' <td class="text-navy"> {{$value['pv']}}</td>\n' +
  489. ' </tr>\n' +
  490. ' @endforeach' +
  491. '\n' +
  492. ' </tbody>\n' +
  493. ' </table>\n' +
  494. ' </div>\n' +
  495. ' </div>';
  496. layer.open({
  497. type: 1,
  498. content: str,
  499. area: ['60%', '100%'],
  500. title: '网站入口'
  501. });
  502. },
  503. sourceMore: function () {
  504. var str = ' <div class="ibox float-e-margins">\n' +
  505. ' <div class="ibox-title">\n' +
  506. ' <h5>来源网站TOP10</h5>\n' +
  507. ' <div class="ibox-tools">\n' +
  508. ' </div>\n' +
  509. ' </div>\n' +
  510. ' <div class="ibox-content">\n' +
  511. ' <table class="table table-hover no-margins">\n' +
  512. ' <thead>\n' +
  513. ' <tr>\n' +
  514. ' <th>来源</th>\n' +
  515. ' <th></th>\n' +
  516. ' </tr>\n' +
  517. ' </thead>\n' +
  518. ' <tbody>\n' +
  519. ' @foreach($top_host as $value)' +
  520. ' @if($key>=10) @break; @endif' +
  521. ' <tr>\n' +
  522. ' <td>{{$value['ref_host']?$value['ref_host']:'直接访问'}}</td>\n' +
  523. ' <td class="text-navy"> {{$value['pv']}}</td>\n' +
  524. ' </tr>\n' +
  525. ' @endforeach' +
  526. '\n' +
  527. ' </tbody>\n' +
  528. ' </table>\n' +
  529. ' </div>\n' +
  530. ' </div>';
  531. layer.open({
  532. type: 1,
  533. content: str,
  534. area: ['60%', '100%'],
  535. title: '来源网站详情'
  536. });
  537. }
  538. };
  539. </script>
  540. @endsection