| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- @extends('base.base')
- @section('base')
- <!-- 内容区域 -->
- <div class="main-panel">
- <div class="content-wrapper">
- <div class="page-header">
- <h3 class="page-title">
- <span class="page-title-icon bg-gradient-primary text-white mr-2">
- <i class="mdi mdi-settings"></i>
- </span>
- {{ __('auto.实时数据') }}
- </h3>
- <nav aria-label="breadcrumb">
- <ol class="breadcrumb">
- <li class="breadcrumb-item"><a href="#">{{ __('auto.游戏数据') }}</a></li>
- <li class="breadcrumb-item active" aria-current="page">{{ __('auto.实时数据') }}</li>
- </ol>
- </nav>
- </div>
- <div class="row">
- <div class="col-lg-12 grid-margin stretch-card">
- <div class="card">
- <div class="card-body">
- <h4 class="card-title">{{ __('auto.实时数据') }}</h4>
- <form class="well form-inline margin-top-20" method="get" action='/admin/game/user/online'>
- <span style="padding-left: 5px" >{{ __('auto.游戏:') }}</span >
- <select class="form-control" name="game_id" id="game_id" value="" style="color: black">
- <option value="">{{ __('auto.请选择游戏') }}</option>
- @foreach($game_name as $k=>$v)
- <option value="{{$k}}">{{$v}}</option>
- @endforeach
- </select>
- <spen style="padding-left: 10px" >{{ __('auto.选择时间:') }}</spen>
- <input type="date" step="01" id="start_date" name="start_date" class="form-control" value="{{$start_date}}" />
- <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text" onclick="update(0)">
- {{ __('auto.搜索') }}
- </button>
- <!-- <input type="submit" class="btn btn-sm btn-gradient-dark btn-icon-text" value="搜索"/> -->
- <a href="/admin/game/user/online" class="btn btn-sm btn-gradient-warning btn-icon-text">{{ __('auto.清空') }}</a>
- </form>
- <br>
- <button onclick="update(0)" class="btn-sm btn btn-gradient-dark">{{ __('auto.在线') }}</button>
- <button onclick="update(1)" class="btn-sm btn btn-gradient-dark">{{ __('auto.注册') }}</button>
- <button onclick="update(2)" class="btn-sm btn btn-gradient-dark">{{ __('auto.活跃') }}</button>
- @if (hidden() != 'service')
- <button onclick="update(3)" class="btn-sm btn btn-gradient-dark">{{ __('auto.充值') }}</button>
- <button onclick="update(4)" class="btn-sm btn btn-gradient-dark">{{ __('auto.提现') }}</button>
- <button onclick="update(5)" class="btn-sm btn btn-gradient-dark">{{ __('auto.充减提') }}</button>
- @endif
- <div id="main" style="width: 100%;height:600px;"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="/assets/js/echarts.min.js"></script>
- <script type="text/javascript">
- let lastUpdate=0
- function update(type){
- lastUpdate=type;
- var start_date= document.getElementById('start_date').value;
- var game_id= document.getElementById('game_id').value;
- myRequest("/admin/game/user/onlines","get",{start_date:start_date,game_id:game_id,type:type},function(data){
- var myChart = echarts.init(document.getElementById('main'));
- if(type == 0){
- myChart.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type:'cross'
- },
- textStyle: {
- fontSize: 16
- }
- },
- legend: {
- data:['{{ __('auto.今日在线') }}','{{ __('auto.昨日在线') }}'],
- // orient: 'vertical' ,
- align: 'auto' ,
- top:'2%',
- // right:'0%',
- // bottom:'50%',
- textStyle:{
- fontSize: 16 ,
- }
- },
- xAxis: {
- data: data.created_at,
- },
- yAxis: [
- { type: 'value',show: true},
- { type: 'value',show: true}
- ],
- series: [
- {
- // 根据名字对应到相应的系列
- name: '{{ __('auto.今日在线') }}',
- type: 'line',
- data: data.online
- },{
- // 根据名字对应到相应的系列
- name: '{{ __('auto.昨日在线') }}',
- type: 'line',
- data: data.yonline
- }
- ]
- },true);
- }
- if(type == 1){
- // myChart.setOption({
- // xAxis: {
- // data: data.created_at
- // },
- // series: [
- // {
- // // 根据名字对应到相应的系列
- // name: '今日注册',
- // data: data.reg
- // },{
- // // 根据名字对应到相应的系列
- // name: '昨日注册',
- // data: data.yreg
- // }
- // ]
- // },true);
- myChart.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type:'cross'
- },
- textStyle: {
- fontSize: 16
- }
- },
- legend: {
- data:['{{ __('auto.今日注册') }}','{{ __('auto.昨日注册') }}'],
- // orient: 'vertical' ,
- align: 'auto' ,
- top:'2%',
- // right:'0%',
- // bottom:'50%',
- textStyle:{
- fontSize: 16 ,
- }
- },
- xAxis: {
- data: data.created_at,
- },
- yAxis: [
- { type: 'value',show: true},
- { type: 'value',show: true}
- ],
- series: [
- {
- // 根据名字对应到相应的系列
- name: '{{ __('auto.今日注册') }}',
- type: 'line',
- data: data.reg
- },{
- // 根据名字对应到相应的系列
- name: '{{ __('auto.昨日注册') }}',
- type: 'line',
- data: data.yreg
- }
- ]
- },true);
- }
- if(type == 2){
- myChart.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type:'cross'
- },
- textStyle: {
- fontSize: 16
- }
- },
- legend: {
- data:['{{ __('auto.今日活跃') }}','{{ __('auto.昨日活跃') }}'],
- // orient: 'vertical' ,
- align: 'auto' ,
- top:'2%',
- // right:'0%',
- // bottom:'50%',
- textStyle:{
- fontSize: 16 ,
- }
- },
- yAxis: [
- { type: 'value',show: true},
- { type: 'value',show: true}
- ],
- xAxis: {
- data: data.created_at
- },
- series: [
- {
- // 根据名字对应到相应的系列
- name: '{{ __('auto.今日活跃') }}',
- type: 'line',
- data: data.active
- },{
- // 根据名字对应到相应的系列
- name: '{{ __('auto.昨日活跃') }}',
- type: 'line',
- data: data.yactive
- }
- ]
- },true);
- }
- if(type == 3){
- myChart.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type:'cross'
- },
- textStyle: {
- fontSize: 16
- }
- },
- legend: {
- data:['{{ __('auto.今日充值') }}','{{ __('auto.昨日充值') }}'],
- // orient: 'vertical' ,
- align: 'auto' ,
- top:'2%',
- // right:'0%',
- // bottom:'50%',
- textStyle:{
- fontSize: 16 ,
- }
- },
- yAxis: [
- { type: 'value',show: true},
- { type: 'value',show: true}
- ],
- xAxis: {
- data: data.created_at
- },
- series: [
- {
- // 根据名字对应到相应的系列
- name: '{{ __('auto.今日充值') }}',
- type: 'line',
- data: data.recharge
- },{
- // 根据名字对应到相应的系列
- name: '{{ __('auto.昨日充值') }}',
- type: 'line',
- data: data.yrecharge
- }
- ]
- },true);
- }
- if(type == 4){
- myChart.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type:'cross'
- },
- textStyle: {
- fontSize: 16
- }
- },
- legend: {
- data:['{{ __('auto.今日提现') }}','{{ __('auto.昨日提现') }}'],
- // orient: 'vertical' ,
- align: 'auto' ,
- top:'2%',
- // right:'0%',
- // bottom:'50%',
- textStyle:{
- fontSize: 16 ,
- }
- },
- yAxis: [
- { type: 'value',show: true},
- { type: 'value',show: true}
- ],
- xAxis: {
- data: data.created_at
- },
- series: [
- {
- // 根据名字对应到相应的系列
- name: '{{ __('auto.今日提现') }}',
- type: 'line',
- data: data.withdraw
- },{
- // 根据名字对应到相应的系列
- name: '{{ __('auto.昨日提现') }}',
- type: 'line',
- data: data.ywithdraw
- }
- ]
- },true);
- }
- if(type == 5){
- myChart.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type:'cross'
- },
- textStyle: {
- fontSize: 16
- }
- },
- legend: {
- data:['{{ __('auto.今日充减提') }}','{{ __('auto.昨日充减提') }}'],
- // orient: 'vertical' ,
- align: 'auto' ,
- top:'2%',
- // right:'0%',
- // bottom:'50%',
- textStyle:{
- fontSize: 16 ,
- }
- },
- yAxis: [
- { type: 'value',show: true},
- { type: 'value',show: true}
- ],
- xAxis: {
- data: data.created_at
- },
- series: [
- {
- // 根据名字对应到相应的系列
- name: '{{ __('auto.今日充减提') }}',
- type: 'line',
- data: data.profit
- },{
- // 根据名字对应到相应的系列
- name: '{{ __('auto.昨日充减提') }}',
- type: 'line',
- data: data.yprofit
- }
- ]
- },true);
- }
- });
- }
- var myChart = echarts.init(document.getElementById('main'));
- setTimeout(function (){
- $.get('/admin/game/user/onlines').done(function (data) {
- // 填入数据
- myChart.setOption({
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type:'cross'
- },
- textStyle: {
- fontSize: 16
- }
- },
- legend: {
- data:['{{ __('auto.今日在线') }}','{{ __('auto.昨日在线') }}'],
- // orient: 'vertical' ,
- align: 'auto' ,
- top:'2%',
- // right:'0%',
- // bottom:'50%',
- textStyle:{
- fontSize: 16 ,
- }
- },
- yAxis: [
- { type: 'value',show: true},
- { type: 'value',show: true}
- ],
- xAxis: {
- data: data.created_at
- },
- series: [
- {
- // 根据名字对应到相应的系列
- name: '{{ __('auto.今日在线') }}',
- type: 'line',
- data: data.online
- },{
- // 根据名字对应到相应的系列
- name: '{{ __('auto.昨日在线') }}',
- type: 'line',
- data: data.yonline
- }
- ]
- },true);
- });
- },1000)
- setInterval(()=>{
- update(lastUpdate);
- },300000)
- </script>
- @endsection
|