Merge branch 'feature/group_type' into dev

# Conflicts:
#	Application/Admin/Controller/QueryController.class.php
master
zhengyongxing 5 years ago
commit 8965fe8201

@ -1601,4 +1601,61 @@ class QueryController extends ThinkController
}
$this->ajaxReturn(['balance' => $balance]);
}
public function getChannelStream() {
$map = [];
// setPowerPromoteIds($map,'root_id');
if ($_REQUEST['promote_id']||$_REQUEST['promote_id']=='0') {
if ($_REQUEST['promote_id']=='0') {
unset($map['root_id']);
$map['promote_account'] = '官方渠道';
} else {
$map['root_id'] = $_REQUEST['promote_id'];
}
}
if ($_REQUEST['game_name']) {
$map['game_names'] = $_REQUEST['game_name'];
}
if ($_REQUEST['count_date']) {
$map['my_time'] = $_REQUEST['count_date'];
}
if ($_REQUEST['device']) {
$map['game_name'] = ['like','%'.$_REQUEST['device'].'%'];
}
//获取spend表中的数据同时根据会长id进行group分类
$data = M('Spend','tab_')
->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,game_name,SUBSTRING_INDEX(`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id,pay_way ")
->join("left join tab_promote on promote_id = tab_promote.id")
->where(['pay_status'=>1])
->group("my_time,game_names,root_id,pay_way")
->order("my_time Desc")
->select(false);
//关联表获取会长账号名
$data = M()->table('('.$data.') as a')
->field("pay_amount,a.pay_way")
->join("left join tab_promote on root_id = tab_promote.id")
->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.game_id and tab_ratio.promote_id=root_id")
->where($map)
->group("my_time,game_names,root_id,pay_way")
->order("my_time Desc")
->select();
$returnData = '';
foreach($data as $key => $value) {
$returnData .=get_pay_way($value['pay_way']).':'.$value['pay_amount']."<br />";
}
// echo $returnData;die();
$this->ajaxReturn($returnData);
}
}

@ -29,6 +29,46 @@
}
.select2-results__option[aria-selected] {font-size:12px;}
.layui-layer-dialog .layui-layer-content{color:red}
.tooltip {
position: relative;
display: inline-block;
color: #056dae;
}
.tooltip .tooltiptext {
/*visibility: hidden;*/
width: 250%;
background-color: #fff;
color: #000;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 80%;
left: 0;
margin-left: -70%;
border: #000 solid 1px;
/*color: #000;*/
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
color: #000;
/*visibility: visible;*/
/*line-height: 20px;*/
}
</style>
<div class="cf main-place top_nav_list navtab_list">
@ -116,7 +156,7 @@
<td>{$data.company_belong}</td>
<td>{$data.company_relation}</td>
<td>{$data.game_names}</td>
<td>{$data.pay_amount}</td>
<td><div class="tooltip" onclick="getChannelStream(this,{$data.root_id},'{$data.game_names}','{$data.my_time}','{$_GET[\'device\']}')">{$data.pay_amount}<span class="tooltiptext" style="display: none"><span style="margin-left: -10px"></span></span></div></td>
<td>{$data.upstream}</td>
<td>{$data.downstream}</td>
<td>{$data.highquality}</td>
@ -219,6 +259,29 @@
</script>
<script type="text/javascript">
//导航高亮
function getChannelStream(_this,promote_id,game_name,count_date,device) {
console.log(promote_id)
console.log(game_name)
console.log(count_date)
console.log(device)
if ($(_this).children().children().text()=='') {
$.ajax({
url: "{:U('Query/getChannelStream')}",
type: "get",
data: {'promote_id': promote_id,'game_name':game_name,'count_date':count_date,'device':device},
dataType: 'json',
success: function (response) {
console.log(response)
$(_this).children().toggle();
$(_this).children().children().html(response);
}
});
} else {
$(_this).children().toggle();
}
}
$(function(){
//搜索功能
var promote_id = "{:I('promote_id')}";

Loading…
Cancel
Save