user_for_site.blade.php 28 KB

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