Browse Source

后台统计,成员管理,成员收入

lizhen_gitee 11 months ago
parent
commit
2b7080ba69

+ 25 - 7
application/admin/controller/Agent.php

@@ -228,16 +228,20 @@ class Agent extends Backend
     }
     //成员管理
     public function all_user(){
+        $authuid  = input('authuid',0);
+        $authinfo = Db::name('user')->where('id',$authuid)->find();
+
         $result = [];
 
         //传入代理
         $down_all_id = input('down_all_id',0);
-
+        $result['down_all_id'] = $down_all_id;
         //传入用户id
-        $get_username = input('get_username',0);
+        $get_username = input('get_username','');
+        $result['get_username'] = $get_username;
 
         //一级代理  下拉  可选二级代理
-        $down_all = $this->select_agent();
+        $down_all = $this->select_agent($authinfo);
         $result['down_all'] = $down_all;
         //dump($down_all);
 
@@ -261,6 +265,10 @@ class Agent extends Backend
         //dump($downall_uid);
 
         foreach($downall_uid as $key => &$user){
+            $user['avatar'] = one_domain_image($user['avatar']);
+            $user['yaoqingtime'] = !$user['yaoqingtime'] ? '' : date('Y-m-d H:i:s',$user['yaoqingtime']);
+
+            $user['is_active'] = $user['is_active'] == 1 ? '在线' : '离线';
             $user['agentname'] = Db::name('user')->where('id',$user['intro_uid'])->value('agentname');
             //邀请奖励收益
             $recharge_sum = Db::name('user_agentjewel_log')->where('user_id',$user['id'])->where('log_type',51)->sum('change_value');
@@ -283,10 +291,14 @@ class Agent extends Backend
 
         $result['user_list'] = $downall_uid;
 
-        $this->success(1,$result);
+        $this->assign($result);
+        return $this->view->fetch();
     }
     //成员收入
     public function user_shouyi(){
+        $authuid  = input('authuid',0);
+        $authinfo = Db::name('user')->where('id',$authuid)->find();
+
         $result = [];
 
         //日期
@@ -297,14 +309,16 @@ class Agent extends Backend
 
         //传入代理
         $down_all_id = input('down_all_id',0);
+        $result['down_all_id'] = $down_all_id;
 
         //传入用户id
-        $get_username = input('get_username',0);
+        $get_username = input('get_username','');
+        $result['get_username'] = $get_username;
 
         $result['startday']    = $startday;
 
         //一级代理  下拉  可选二级代理
-        $down_all = $this->select_agent();
+        $down_all = $this->select_agent($authinfo);
         $result['down_all'] = $down_all;
         //dump($down_all);
 
@@ -327,6 +341,8 @@ class Agent extends Backend
         }
         //dump($downall_uid);
         foreach($downall_uid as $key => &$user){
+            $user['avatar'] = one_domain_image($user['avatar']);
+
             $user['agentname'] = Db::name('user')->where('id',$user['intro_uid'])->value('agentname');
             //邀请奖励收益
             $recharge_sum = Db::name('user_agentjewel_log')->where('user_id',$user['id'])->where('log_type',51)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('change_value');
@@ -350,10 +366,12 @@ class Agent extends Backend
 
         $result['user_list'] = $downall_uid;
 
-        $this->success(1,$result);
+        $this->assign($result);
+        return $this->view->fetch();
     }
 
     //成员详情
+    //用不到
     public function user_info(){
         $user_id = input('user_id',0);
 

+ 238 - 0
application/admin/view/agent/all_user.html

@@ -0,0 +1,238 @@
+
+<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">
+            <div class="col-xs-12 col-sm-2">
+                <input type="text" class="form-control" name="get_username" value="{$get_username}" placeholder="输入成员id"  id="get_username" >
+            </div>
+        </div>
+        <div class="form-group">
+            <div class="col-xs-12 col-sm-2">
+                <select name="down_all_id" data-size="8">
+                    <option value="0" {eq name="down_all_id" value="0" }selected="selected"{/eq} >全部</option>
+                    {volist name="down_all" id="vo"}
+                    <option value="{$vo.id}" {eq name="$down_all_id" value="$vo.id" }selected="selected"{/eq} >{$vo.agentname}</option>
+                    {/volist}
+                </select>
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="control-label col-xs-12 col-sm-2"></label>
+            <div class="col-xs-12 col-sm-8">
+                <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
+            </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>用户ID</td>
+                        <td>好友</td>
+                        <td>总收益(金币)</td>
+                        <td>在线状态</td>
+                        <td>私信收益(金币)</td>
+                        <td>语音收益(金币)</td>
+                        <td>视频收益(金币)</td>
+                        <td>礼物收益(金币)</td>
+                        <td>邀请奖励(金币)</td>
+                    </tr>
+                    {volist name="user_list" id="vo"}
+                    <tr>
+                        <td><img style="width: 50px;height: 50px;" src="{$vo.avatar}"></td>
+                        <td>{$vo.nickname}</td>
+                        <td>{$vo.yaoqingtime}</td>
+                        <td>{$vo.username}</td>
+                        <td>{$vo.agentname}</td>
+                        <td>{$vo.total}</td>
+                        <td>{$vo.is_active}</td>
+                        <td>{$vo.typing_sum}</td>
+                        <td>{$vo.audio_sum}</td>
+                        <td>{$vo.video_sum}</td>
+                        <td>{$vo.gift_sum}</td>
+                        <td>{$vo.recharge_sum}</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>
+

+ 237 - 0
application/admin/view/agent/user_shouyi.html

@@ -0,0 +1,237 @@
+
+<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">
+            <div class="col-xs-12 col-sm-2">
+                <input type="text" class="form-control" name="get_username" value="{$get_username}" placeholder="输入成员id"  id="get_username" >
+            </div>
+        </div>
+        <div class="form-group">
+            <div class="col-xs-12 col-sm-2">
+                <input type="text" class="form-control" name="startday" value="{$startday}" placeholder="选择时间"  id="startday" data-index="4" autocomplete="off">
+            </div>
+        </div>
+        <div class="form-group">
+            <div class="col-xs-12 col-sm-2">
+                <select name="down_all_id" data-size="8">
+                    <option value="0" {eq name="down_all_id" value="0" }selected="selected"{/eq} >全部</option>
+                    {volist name="down_all" id="vo"}
+                    <option value="{$vo.id}" {eq name="$down_all_id" value="$vo.id" }selected="selected"{/eq} >{$vo.agentname}</option>
+                    {/volist}
+                </select>
+            </div>
+        </div>
+        <div class="form-group">
+            <label class="control-label col-xs-12 col-sm-2"></label>
+            <div class="col-xs-12 col-sm-8">
+                <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
+            </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>用户ID</td>
+                        <td>好友</td>
+                        <td>当日收益(金币)</td>
+                    </tr>
+                    {volist name="user_list" id="vo"}
+                    <tr>
+                        <td><img style="width: 50px;height: 50px;" src="{$vo.avatar}"></td>
+                        <td>{$vo.nickname}</td>
+                        <td>{$vo.username}</td>
+                        <td>{$vo.agentname}</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>

+ 2 - 0
application/api/controller/Userintro.php

@@ -330,6 +330,8 @@ class Userintro extends Api
         //dump($downall_uid);
 
         foreach($downall_uid as $key => &$user){
+            $user['avatar'] = one_domain_image($user['avatar']);
+
             $user['agentname'] = Db::name('user')->where('id',$user['intro_uid'])->value('agentname');
             //邀请奖励收益
             $recharge_sum = Db::name('user_agentjewel_log')->where('user_id',$user['id'])->where('log_type',51)->sum('change_value');