Browse Source

后台统计,成员收益日历

lizhen_gitee 11 months ago
parent
commit
18cacaef4d

+ 41 - 4
application/admin/controller/Agent.php

@@ -401,20 +401,54 @@ class Agent extends Backend
     //成员详情-日历数据
     public function user_info_date(){
         $user_id = input('user_id',0);
+        $user_info = Db::name('user')->where('id',$user_id)->field('id,username,avatar,nickname,intro_uid,yaoqingtime')->find();
 
         //日期
         $todaytime = strtotime(date('Y-m-d'));//今天凌晨
+        $page      = input('page',1);
+
+        //
+        $datelist = [];
+
+        //总共查几天,页数
+        $days = ceil((time() - strtotime(date('Y-m-d',$user_info['yaoqingtime']))) / 86400);
+        $pagemax = ceil($days/10);
+
+        //上一页,下一页
+        $lastpage = $page > 1 ? ('/admin.php/agent/user_info_date?user_id='.$user_id.'&page='. ($page - 1) ) : '';
+        $nextpage = $page < $pagemax ? ('/admin.php/agent/user_info_date?user_id='.$user_id.'&page='. ($page + 1) ) : '';
+        $this->assign('page',$page);
+        $this->assign('pagemax',$pagemax);
+        $this->assign('lastpage',$lastpage);
+        $this->assign('nextpage',$nextpage);
+
+        if($page > $pagemax){
+            $this->assign('datelist',$datelist);
+            return $this->view->fetch();
+        }
+
+        //
 
         $datelist = [];
-        for($i=0;$i<$this->listrow;$i++){ //循环10次
+        for($i=0;$i<10;$i++){ //循环10次
 
-            $day = ($this->page-1)*$this->listrow + $i;//往前推的天数
+            $day = ($page-1)*10 + $i;//往前推的天数
 
             $starttime = $todaytime - $day*86400;
             $endtime   = $starttime + 86399;
 
+            /*if($starttime <= $user_info['yaoqingtime']){
+                //break;
+            }*/
+            if($endtime <= $user_info['yaoqingtime']){
+                break;
+            }
+
+//            dump(datetime($starttime));
+//            dump(datetime($endtime));
+
             $thisday = [
-                'date' => date('m-d',$starttime),
+                'date' => date('Y-m-d',$starttime),
             ];
 
             //邀请奖励收益
@@ -439,7 +473,10 @@ class Agent extends Backend
             $datelist[] = $thisday;
         }
 
-        $this->success(1,$datelist);
+        $this->assign('datelist',$datelist);
+
+
+        return $this->view->fetch();
 
     }
 

+ 2 - 1
application/admin/view/agent/all_user.html

@@ -204,6 +204,7 @@
                         <td>视频收益(金币)</td>
                         <td>礼物收益(金币)</td>
                         <td>邀请奖励(金币)</td>
+                        <td></td>
                     </tr>
                     {volist name="user_list" id="vo"}
                     <tr>
@@ -219,7 +220,7 @@
                         <td>{$vo.video_sum}</td>
                         <td>{$vo.gift_sum}</td>
                         <td>{$vo.recharge_sum}</td>
-
+                        <td><a href="/admin.php/agent/user_info_date?user_id={$vo.id}">详情</a></td>
                     </tr>
                     {/volist}
                 </table>

+ 228 - 0
application/admin/view/agent/user_info_date.html

@@ -0,0 +1,228 @@
+
+<style type="text/css">
+    .sm-st {
+        background: #fff;
+        padding: 20px;
+        -webkit-border-radius: 3px;
+        -moz-border-radius: 3px;
+        border-radius: 3px;
+        margin-bottom: 20px;
+    }
+
+    .sm-st-icon {
+        width: 60px;
+        height: 60px;
+        display: inline-block;
+        line-height: 60px;
+        text-align: center;
+        font-size: 30px;
+        background: #eee;
+        -webkit-border-radius: 5px;
+        -moz-border-radius: 5px;
+        border-radius: 5px;
+        float: left;
+        margin-right: 10px;
+        color: #fff;
+    }
+
+    .sm-st-info {
+        padding-top: 2px;
+    }
+
+    .sm-st-info span {
+        display: block;
+        font-size: 24px;
+        font-weight: 600;
+    }
+
+    .orange {
+        background: #fa8564 !important;
+    }
+
+    .tar {
+        background: #45cf95 !important;
+    }
+
+    .sm-st .green {
+        background: #86ba41 !important;
+    }
+
+    .pink {
+        background: #AC75F0 !important;
+    }
+
+    .yellow-b {
+        background: #fdd752 !important;
+    }
+
+    .stat-elem {
+
+        background-color: #fff;
+        padding: 18px;
+        border-radius: 40px;
+
+    }
+
+    .stat-info {
+        text-align: center;
+        background-color: #fff;
+        border-radius: 5px;
+        margin-top: -5px;
+        padding: 8px;
+        -webkit-box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
+        box-shadow: 0 1px 0px rgba(0, 0, 0, 0.05);
+        font-style: italic;
+    }
+
+    .stat-icon {
+        text-align: center;
+        margin-bottom: 5px;
+    }
+
+    .st-red {
+        background-color: #F05050;
+    }
+
+    .st-green {
+        background-color: #27C24C;
+    }
+
+    .st-violet {
+        background-color: #7266ba;
+    }
+
+    .st-blue {
+        background-color: #23b7e5;
+    }
+
+    .stats .stat-icon {
+        color: #28bb9c;
+        display: inline-block;
+        font-size: 26px;
+        text-align: center;
+        vertical-align: middle;
+        width: 50px;
+        float: left;
+    }
+
+    .stat {
+        white-space: nowrap;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: inline-block;
+    }
+
+    .stat .value {
+        font-size: 20px;
+        line-height: 24px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        font-weight: 500;
+    }
+
+    .stat .name {
+        overflow: hidden;
+        text-overflow: ellipsis;
+        margin: 5px 0;
+    }
+
+    .stat.lg .value {
+        font-size: 26px;
+        line-height: 28px;
+    }
+
+    .stat-col {
+        margin:0 0 10px 0;
+    }
+    .stat.lg .name {
+        font-size: 16px;
+    }
+
+    .stat-col .progress {
+        height: 2px;
+    }
+
+    .stat-col .progress-bar {
+        line-height: 2px;
+        height: 2px;
+    }
+
+    .item {
+        padding: 30px 0;
+    }
+
+
+    #statistics .panel {
+        min-height: 150px;
+    }
+
+    #statistics .panel h5 {
+        font-size: 14px;
+    }
+</style>
+<div class="panel panel-default panel-intro">
+    <form  method="POST"  class="form-horizontal" action="">
+
+        <div class="form-group">
+            <label class="control-label col-xs-12 col-sm-2"></label>
+            <div class="col-xs-12 col-sm-8">
+                <?php if($lastpage){ ?>
+                    <a class="btn btn-success btn-embossed" href="{$lastpage}">上一页</a>
+                <?php }?>
+                <?php if($nextpage){ ?>
+                    <a class="btn btn-success btn-embossed" href="{$nextpage}">下一页</a>
+                <?php }?>
+                第{$page}页
+                共{$pagemax}页
+            </div>
+        </div>
+    </form>
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+
+
+                <span style="font-size: 30px;">成员详情</span>
+                <table class="table table-striped table-bordered table-hover">
+                    <tr>
+                        <td>日期</td>
+                        <td>私信收益</td>
+                        <td>视频收益</td>
+                        <td>语音收益</td>
+                        <td>礼物收益</td>
+                        <td>邀请收益</td>
+                        <td>总收益</td>
+                    </tr>
+                    {volist name="datelist" id="vo"}
+                    <tr>
+                        <td>{$vo.date}</td>
+                        <td>{$vo.typing_sum}</td>
+                        <td>{$vo.video_sum}</td>
+                        <td>{$vo.audio_sum}</td>
+                        <td>{$vo.gift_sum}</td>
+                        <td>{$vo.recharge_sum}</td>
+                        <td>{$vo.total}</td>
+                    </tr>
+                    {/volist}
+                </table>
+
+            </div>
+            <div class="tab-pane fade" id="two">
+                <div class="row">
+                    <div class="col-xs-12">
+                        {:__('Custom zone')}
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="/assets/laydate/laydate.js"></script>
+<script>
+    laydate.render({
+        elem: '#startday'
+        //设置开始日期、日期日期的 input 选择器
+        //数组格式为 5.3.0 开始新增,之前版本直接配置 true 或任意分割字符即可
+        //,range: ['#test-startDate-1', '#test-endDate-1']
+    });
+</script>