Merge branch 'feature/game_change_statement_20201125' of wmtx/platform into release

优化订单查看
master
陈志 4 years ago committed by Gogs
commit 46d8139c90

@ -2576,7 +2576,7 @@ function getCompanyBlongOther($id = -1)
* array(
* op_type=>操作类型 0:新增1:编辑 2:删除 3:下载,
* op_name=>操作说明 例如:编辑,删除,锁定等,
* url=>需要跳转的url 添加去列表加唯一id编辑直接去编辑页面下载可以重新下载(新开页面),
* url=>U函数可以跳转 的操作地址,
* key=>关键词:用户的账号,游戏的名词等,
* menu=>非必须,菜单目录,不存在的话按控制器寻找。
* )

@ -282,6 +282,7 @@ class FinancePromoteController extends AdminController
$map['s.market_admin_id'] = $adminId;
}
$map['s.pay_status']=1;
$map['s.is_check']=1;
$field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as bind_coin_count,
@ -511,6 +512,7 @@ class FinancePromoteController extends AdminController
$map['s.market_admin_id'] = $adminId;
}
$map['s.pay_status']=1;
$map['s.is_check']=1;
// dd($map);
$field= "SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count,
@ -775,6 +777,8 @@ class FinancePromoteController extends AdminController
$row = 10;
}
$map['pay_status'] = 1;
$map['is_check'] = 1;
if (!empty(I("game_id"))) {
$map['game_id'] = I("game_id");
}
@ -893,6 +897,7 @@ class FinancePromoteController extends AdminController
}
$map['s.pay_status']=1;
$map['s.is_check']=1;
$query = M("spend","tab_")->alias("s")
->field("s.game_id,s.game_name,s.sdk_version,p.partner as partner_name,
SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count,
@ -946,7 +951,7 @@ class FinancePromoteController extends AdminController
->join("tab_promote promote ON s.promote_id = promote.id","left")
->join("tab_promote_company company ON promote.company_id = company.id","left");
}
$data = $query->where(['s.pay_status' => 1])
$data = $query->where(['s.pay_status' => 1,'s.is_check'=>1])
->where($map)
->find();
return $data;
@ -996,6 +1001,7 @@ class FinancePromoteController extends AdminController
$row = 10;
}
$map['pay_status'] = 1;
$map['is_check'] = 1;
if (!empty(I('user_account'))) {
$map['tab_spend.user_account'] = array('like','%'.I("user_account").'%');

@ -1335,6 +1335,9 @@ class PromoteCompanyController extends ThinkController
$is_change_game = false;
$Promote = M("Promote", "tab_");
if($old_info['game_ids'] != $game_ids){
//操作日志
$this->addCompanyGameChangeLog($company_id,$old_info['game_ids'],$game_ids);
if($old_info['company_belong'] == 1 || $old_info['company_belong'] == 2){
//外团跟随公司
$new_game_ids = D("Game")->changeRelationGameidToGameid($game_ids,true);
@ -1374,6 +1377,20 @@ class PromoteCompanyController extends ThinkController
}
}
}
protected function addCompanyGameChangeLog($company_id,$old_game_ids,$new_game_ids){
$old_game_ids = explode(',',$old_game_ids);
$new_game_ids = explode(',',$new_game_ids);
$addGameid = array_diff($new_game_ids,$old_game_ids);
$removeGameid = array_diff($old_game_ids,$new_game_ids);
if(!empty($addGameid)){
$gameid = implode(',',$addGameid);
addOperationLog(['op_type'=>1,'key'=>"addCompanyGame","op_name"=>"新增推广游戏","content"=>json_encode(["company_id"=>$company_id,"relation_game_id"=>$gameid])]);
}
if(!empty($removeGameid)){
$gameid = implode(',',$removeGameid);
addOperationLog(['op_type'=>1,'key'=>"removeCompanyGame","op_name"=>"移除推广游戏","content"=>json_encode(["company_id"=>$company_id,"relation_game_id"=>$gameid])]);
}
}
/**
* 由于修改公司信息引起的会长信息修改
* @param [type] $save

@ -11,6 +11,11 @@ use User\Api\UserApi as UserApi;
class SpendController extends ThinkController
{
const model_name = 'Spend';
const IsCheckStr=[
"1"=>"是",
"2"=>"否"
];
public $OpAuthList;
public function lists()
{
@ -24,6 +29,10 @@ class SpendController extends ThinkController
unset($_REQUEST['timestart']);
unset($_REQUEST['timeend']);
if (isset($_REQUEST['is_check'])) {
$map['is_check'] = (int)($_REQUEST['is_check']);
}
if (isset($_REQUEST['user_account'])) {
$map['user_account'] = array('like', trim($_REQUEST['user_account']));
unset($_REQUEST['user_account']);
@ -142,13 +151,13 @@ class SpendController extends ThinkController
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find());
$data = D(self::model_name)->lists($_GET["p"], $map, $order);
$adminUsernameList = getAdminUsernameList(array_column($data['data'], 'market_admin_id'));
foreach ($data['data'] as $key=>&$value ) {
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
$value['market_admin_username'] = $adminUsernameList[$value['market_admin_id']] ?? '无';
$value['is_check_str'] = self::IsCheckStr[$value['is_check']];
}
$this->assign('showMarketAdmin', session('user_auth')['show_market_admin']);
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('isMarketAdmin', $isMarketAdmin);
@ -159,16 +168,72 @@ class SpendController extends ThinkController
$this->assign('_page', $data['page']);
$show_data_power = (is_administrator()|| session('user_auth')['show_data']);
$this->assign('show_data_power', $show_data_power);
if(!IS_ROOT){
$this->OpAuthList= getModuleControllerAuth();
}
$this->assign('menubtn',$this->menuAuth());
$this->display();
}
/**
* 充值补单功能
*/
public function order_repair() {
if (IS_AJAX) {
protected function menuAuth()
{
$mentBtn = [
"addStatement"=>"<a class='butn' id='addStatement'>参与结算</a>",
"removeStatement"=>"<a class='butn' id='removeStatement' style='background-color: red;'>移出结算</a>",
];
$resarr = [];
foreach ($mentBtn as $k => $v) {
if(IS_ROOT){
$resarr[] = $v;
}else{
if(in_array($k,$this->OpAuthList)){
$resarr[] = $v;
}
}
}
return $resarr;
}
public function addStatement()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$this->editOrderIscheck($ids,2,1);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"操作成功"
));
}
public function removeStatement()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$this->editOrderIscheck($ids,1,2);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"操作成功"
));
}
protected function editOrderIscheck($ids,$oldval,$newval){
$dbres = D(self::model_name)->where("id in ({$ids}) and is_check = '{$oldval}'")->select();
if(empty($dbres)) return false;
$changeIds = implode(",",array_column($dbres,"id"));
//执行操作
$res = D(self::model_name)->where("id in ({$changeIds}) and is_check = '{$oldval}'")->save(['is_check'=>$newval]);
if(empty($res)) return false;
//日志
if($newval == 1){
$op_name = "加入结算";
$key = "addStatement";
}else{
$op_name = "移出结算";
$key = "removeStatement";
}
addOperationLog(['op_type'=>1,'key'=>$key,"op_name"=>$op_name,"content"=>json_encode(["ids"=>$_REQUEST['ids'],"is_check"=>$newval])]);
return true;
}
}

@ -81,7 +81,7 @@
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">公会统计</h3>
<p class="description_text">说明:公会相关统计</p>
<p class="description_text">说明:公会相关统计<span style="color: red;margin-left: 10px;">不含不参与结算的订单数据</span></p>
</div>
<style>

@ -25,12 +25,40 @@
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
tr td:nth-child(2){
tr td:nth-child(3){
max-width: 200px;
word-wrap:break-word;
line-height: 1.5;
padding:5px;
}
.search_list{
margin-bottom: 15px;
}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
.data_list table td{
line-height: 2;
}
.layui-layer-title {
text-align: center;
height: 42px;
line-height: 42px;
font-weight: 400;
font-size: 14px;
}
</style>
<!-- 标题栏 -->
@ -158,6 +186,16 @@
</volist>
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select id="is_check" name="is_check" class="select_gallery">
<option value="">是否参与结算</option>
<option value="1"></option>
<option value="2"></option>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
@ -166,7 +204,13 @@
</div>
</div>
</div>
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<foreach name="menubtn" item="vo" >
{$vo}
</foreach>
</div>
</div>
@ -177,6 +221,7 @@
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th>支付订单号</th>
<th style="max-width: 100px;">CP订单号</th>
<th><a class="paixu" data-order='pay_time'>
@ -206,16 +251,18 @@
<th>充值方式</th>
<th>订单状态</th>
<th>游戏通知状态</th>
<th>是否参与结算</th>
<th>操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="list_data">
<td colspan="19" class="text-center">aOh! 暂时还没有内容!</td>
<td colspan="22" class="text-center">aOh! 暂时还没有内容!</td>
<else/>
<volist name="list_data" id="data">
<tr>
<td ><input class="ids" type="checkbox" data-ischeck="{$data.is_check}" value="{$data['id']}" name="ids[]"></td>
<td>
<if condition="$show_data_power eq true ">
{$data.pay_order_number}
@ -295,6 +342,7 @@
{:get_info_status($data['pay_game_status'],14)}
</if>
</td>
<td>{$data.is_check_str}</td>
<td style="text-indent:0;">
<?php
@ -326,8 +374,8 @@
<if condition="$rule_count_check">
<tr class="data_summary">
<td>汇总</td>
<td colspan="19">
<td colspan="2">汇总</td>
<td colspan="20">
当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_status','',$list_data),'pay_amount')))}
<!-- 今日充值:{$ttotal}-->
<!-- 昨日充值:{$ytotal}-->
@ -670,6 +718,63 @@
});
$("#game_name").change();
$("#addStatement,#removeStatement").on("click",function(){
var id = $(this).attr("id");
if(id == "addStatement"){
var opname = "参与结算";
var opurl = "{:U('addStatement')}";
var opst ="[不参与结算]";
var status = [2];
}else if(id=="removeStatement"){
var opname = "移出结算";
var opurl = "{:U('removeStatement')}";
var opst ="[参与结算]";
var status = [1];
}
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
const ischeck = $(elem).data("ischeck");
if($.inArray(ischeck,status) > -1){
return $(elem).val();
}
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>" + '无需要'+opname+'的操作,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
text = text.join(",");
layer.confirm('【提示】'+opname+'操作后,相应的结算单需要进行重算后生效', {
btn: ['确认','取消'],
title:false
}, function(index){
layer.close(index);
layer.load(2);
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: true,
data: {ids:text},
success:function(data){
layer.closeAll('loading');
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
});
})
/**
* 初始化select2单选默认带搜索功能。
*/

Loading…
Cancel
Save