Merge branch 'release' into feature/0207zgc

master
tping 4 years ago
commit d14cb334af

@ -47,6 +47,9 @@ class CompanyStatementOfflineController extends ThinkController
$time_end = strtotime($_REQUEST['time_end'])+ 86399;
$map["_string"] = "(c.statement_begin_time <= {$time_end} ) OR (c.statement_end_time <= {$time_end})";
}
if(isset($_REQUEST['pay_status'])){
$map['c.pay_status'] = $_REQUEST['pay_status'];
}
//其他
if(isset($_REQUEST['company_type'])){
@ -115,9 +118,12 @@ class CompanyStatementOfflineController extends ThinkController
$v['oplist'] = $this->OpAuth($v);
}
//pay_status
$field = "count(c.id) count,IFNULL(SUM(CASE WHEN pay_status = 1 THEN c.statement_money ELSE 0 END),0) as success_money,
IFNULL(SUM(CASE WHEN pay_status = 0 THEN c.statement_money ELSE 0 END),0) as statement_money,
IFNULL(SUM(CASE WHEN pay_status = -1 THEN c.statement_money ELSE 0 END),0) as error_money";
$count = SM("company_statement_info","tab_")->alias("c")->field($field)->join("tab_company_statement_pool as p ON c.pool_id = p.id")->where($map)->find();
$count = SM("company_statement_info","tab_")->alias("c")->field("count(c.id) count,sum(c.statement_money) statement_money")->join("tab_company_statement_pool as p ON c.pool_id = p.id")->where($map)->find();
// dd($count);
$params['p'] = $page;
$params['row'] = $row;
$page = set_pagination($count['count'], $row, $params);
@ -128,6 +134,7 @@ class CompanyStatementOfflineController extends ThinkController
$this->assign('data',$data);
$this->assign('count',$count);
$this->assign('CompanyType',$this->CompanyType);
$this->assign("PayStatus", $this->PayStatus);
$this->display();
}

@ -443,7 +443,7 @@ class PromoteController extends ThinkController
$data['withdraw_show'] = $_POST['withdraw_show'];
$data['withdraw_done'] = $_POST['withdraw_done'];
$data['can_view_recharge'] = $_POST['can_view_recharge'];
$data['ts_over_apply'] = $_POST['ts_over_apply'] ?? 0;
if (empty($pwd)) {
unset($data['password']);
}

@ -117,6 +117,14 @@
<div class="input-list">
<input style="width: 200px;" type="text" name="company_name" class="search-input" value="{:I('company_name')}" placeholder="请输入公司名称搜索">&nbsp;
</div>
<div class="input-list input-list-promote search_label_rehab">
<select id="pay_status" name="pay_status" class="select_gallery" >
<option value="">打款状态</option>
<volist name="PayStatus" id="vo">
<option value="{$key}" <if condition="isset($_GET['pay_status']) && $key eq I('pay_status')">selected</if> >{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="statement_pool_num" class="search-input" value="{:I('statement_pool_num')}" placeholder="请输入汇总单号">&nbsp;
@ -195,7 +203,8 @@
</td>
</tr>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="12" style="line-height: 42px;">结算总金额:&nbsp;{$count.statement_money}</td></tr>
<tr><td style="line-height: 42px;">合计</td><td colspan="12" style="line-height: 42px;">待打款金额:&nbsp;{$count.statement_money}&nbsp;&nbsp;&nbsp;&nbsp;打款成功金额:&nbsp;{$count.success_money}&nbsp;&nbsp;&nbsp;&nbsp;打款失败金额:&nbsp;{$count.error_money}</td></tr>
</notemtpy>
</tbody>
</table>

@ -76,12 +76,30 @@
display: block;
}
.main-place .question_content:before{
right: 20px;
left: auto;
}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">公会统计</h3>
<p class="description_text">说明:公会相关统计<span style="color: red;margin-left: 10px;">不含不参与结算的订单数据</span></p>
<p class="description_text">说明:公会相关统计</p>
<div class="question" style="float: right;margin-right: 20px;">
<i class="question_mark">?</i>
<ul class="question_content" style="right: -20px;left: auto;">
<li class="question_title">数据相关说明</li>
<li class="question_list">
<span class="">不结算充值合计:</span>
<span class="">该工会未推广的游戏所产生的流水将被记为不结算充值</span>
</li>
<li class="question_list">
<span class="">下游结算:</span>
<span class="">下游结算时不包含不结算订单</span>
</li>
</ul>
</div>
</div>
<style>
@ -251,7 +269,7 @@
<!-- <td><span class='ljzc'
data-value="{$data['id']}"><a>{$data.inside_cash_count}</a></span></td> -->
<td>{$data.allcount}</td>
<td>{$data.unallcount}</td>
<td style="color: red;">{$data.unallcount}</td>
<td>
@ -276,7 +294,7 @@
<td style="text-align: center;">{$all_count['bind_coin_count']}</td>
<td style="text-align: center;">{$all_count['inside_cash_count']}</td>
<td style="text-align: center;">{$all_count['all_count']}</td>
<td style="text-align: center;">{$all_count['unallcount']}</td>
<td style="text-align: center;color: red;">{$all_count['unallcount']}</td>
<td style="text-align: center;">
<a
href="{:U('FinancePromote/gameStatistics',array_merge(I('get.'),['promote_type'=>1,'p'=>1]))}">游戏查看</a>

@ -332,6 +332,22 @@
</span>
</td>
</tr>
<?php if($data['level'] > 1):?>
<tr>
<td class="l">测试资源申请权限:</td>
<td class="r table_radio">
<span class="form_radio table_btn">
<label >
<input type="radio" value="1" name="ts_over_apply" class="withdraw_done" <if condition="$data['ts_over_apply'] eq 1">checked="checked"</if>> 开启
</label >
<label >
<input type="radio" value="0" name="ts_over_apply" class="withdraw_done" <if condition="$data['ts_over_apply'] eq 0">checked="checked"</if>> 锁定
</label>
</span>
<span class="notice-text">开启后该推广员有权限操作整个公会的测试资源查看与申请</span>
</td>
</tr>
<?php endif;?>
<tr>
<td class="l">备注:</td>
<td class="r table_textarea" >

@ -95,8 +95,9 @@ class TestingResourceRepository
if (!is_null($promote)) {
$promoteService = new PromoteService();
$permissionPromote = $promoteService->getTSPermPromote($promote);
$subSql = M('user', 'tab_')
->where('id=tab_testing_resource_batch.user_id and promote_id in (' . $promoteService->subInSql($promote) . ')')
->where('id=tab_testing_resource_batch.user_id and promote_id in (' . $promoteService->subInSql($permissionPromote) . ')')
->select(false);
$conditions['_string'] .= ' and exists (' . $subSql . ')';
@ -530,14 +531,15 @@ class TestingResourceRepository
$strCondition = '1=1';
$promoteService = new PromoteService();
if ($promote) {
$visibleGameIds = $promoteService->getVisibleGameIds($promote);
$permissionPromote = $promoteService->getTSPermPromote($promote);
if ($permissionPromote) {
$visibleGameIds = $promoteService->getVisibleGameIds($permissionPromote);
if (count($visibleGameIds) > 0) {
$strCondition .= ' and game_id in (' . implode(',', $visibleGameIds) . ')';
} else {
$strCondition .= ' and 1=0';
}
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($promote) . ')';
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($permissionPromote) . ')';
}
$gameIds = $this->getHadSettingGameIds();

@ -1337,4 +1337,18 @@ class PromoteService {
$siteConfig['keywords'] = C('channel_index.seo_keyword');
return $siteConfig;
}
/**
* 获取推广员实际拥有的测试资源数据操作范围(测试资源跨部门操作权限)
*/
public function getTSPermPromote($promote)
{
if (empty($promote)) {
return null;
}
if ($promote['ts_over_apply'] == 1) {
return $this->getTopPromote($promote);
}
return $promote;
}
}

@ -205,7 +205,8 @@ class TestingResourceService
$strCondition = '1=1';
if ($promote) {
$promoteService = new PromoteService();
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($promote) . ')';
$permissionPromote = $promoteService->getTSPermPromote($promote);
$strCondition .= ' and promote_id in (' . $promoteService->subInSql($permissionPromote) . ')';
}
$users = M('user', 'tab_')->field(['id', 'account'])->where(['account' => ['in', $newAccounts], '_string' => $strCondition])->select();
@ -293,8 +294,9 @@ class TestingResourceService
}
$promoteService = new PromoteService();
$permissionPromote = $promoteService->getTSPermPromote($promote);
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $testingRole['promote_id']])->find();
if (is_null($testPromote) || ($promote && !$promoteService->isSubOrSelf($testPromote, $promote))) {
if (is_null($testPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($testPromote, $permissionPromote))) {
throw new \Exception('测试角色所属推广员异常');
}
@ -307,7 +309,7 @@ class TestingResourceService
}
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindRole['promote_id']])->find();
if (is_null($bindPromote) || ($promote && !$promoteService->isSubOrSelf($bindPromote, $promote))) {
if (is_null($bindPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($bindPromote, $permissionPromote))) {
throw new \Exception('玩家账号所属推广员异常');
}
@ -357,7 +359,9 @@ class TestingResourceService
$userAccount = $params['user_account'] ?? '';
$records = $params['records'] ?? [];
if ($promote && $promote['level'] > 2) {
$promoteService = new PromoteService();
$permissionPromote = $promoteService->getTSPermPromote($promote);
if ($permissionPromote && $permissionPromote['level'] > 2) {
throw new \Exception('权限不足');
}
@ -394,8 +398,6 @@ class TestingResourceService
throw new \Exception('区服不存在');
}
$promoteService = new PromoteService();
$role = M('user_play_info', 'tab_')
->field(['id', 'role_id', 'promote_id', 'game_id', 'testing_other_quota'])
->where(['user_id' => $user['id'], 'game_id' => $gameId, 'server_id' => $server['server_id'], 'role_id' => $roleId])
@ -418,7 +420,7 @@ class TestingResourceService
}
$testPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $role['promote_id']])->find();
if (is_null($testPromote) || ($promote && !$promoteService->isSubOrSelf($testPromote, $promote))) {
if (is_null($testPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($testPromote, $permissionPromote))) {
throw new \Exception('测试角色所属推广员异常');
}
@ -433,7 +435,7 @@ class TestingResourceService
}
$bindingRole['binding_time'] = $binding['create_time'];
$bindPromote = M('promote', 'tab_')->field(['id', 'chain'])->where(['id' => $bindingRole['promote_id']])->find();
if (is_null($bindPromote) || ($promote && !$promoteService->isSubOrSelf($bindPromote, $promote))) {
if (is_null($bindPromote) || ($permissionPromote && !$promoteService->isSubOrSelf($bindPromote, $permissionPromote))) {
throw new \Exception('绑定角色所属推广员异常');
}
/* if ($testPromote['id'] != $bindPromote['id']) {

@ -125,7 +125,7 @@
<?php endif;?>
<a href="{:U('Safe/promoteLogs')}" class="<?=is_active_class(['Safe'], ['promoteLogs'])?>">操作日志</a>
</div>
<?php if($loginer['level'] <= 2):?>
<?php if($loginer['level'] == 1 || $loginer['ts_over_apply'] == 1):?>
<div class="subNav jssubNav"><i class="prev_icon icon_fenbao"></i><span>测试资源</span><i class="arrow_icon"></i></div>
<div class="navContent jsnavContent">
<a href="{:U('TestingResource/index')}" class="<?=is_active_class(['TestingResource'], ['index'])?>">测试资源申请</a>

@ -73,6 +73,16 @@ class PaymentController extends BaseController
$map['s.verify_time'] = ['ELT', strtotime($_REQUEST['verifytime_end']) + 86399];
}
if(isset($_REQUEST['statement_num'])){
$statement_num = $_REQUEST['statement_num'];
$pool_ids = M("company_statement_pool","tab_")->where("statement_num like '%{$statement_num}%'")->getField("id",true);
if(!empty($pool_ids)){
$map['s.pool_id'] = ['in', $pool_ids];
}else{
$map['s.pool_id'] = 0;
}
}
if(isset($_REQUEST['company_type'])){
$map['s.company_type'] = $_REQUEST['company_type'];
}

@ -145,7 +145,7 @@
<div class="input-list input-list-promote search_label_rehab">
<select id="pay_status" name="pay_status" class="select_gallery" >
<option value="">支付状态</option>
<option value="">打款状态</option>
<volist name="PayStatus" id="vo">
<option value="{$key}" <if condition="isset($_GET['pay_status']) && $key eq I('pay_status')">selected</if> >{$vo}</option>
</volist>
@ -258,7 +258,7 @@
</tr>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">
打款成功金额:&nbsp;{$money.success_money}&nbsp;&nbsp;/&nbsp;&nbsp;待打款金额:&nbsp;{$money.statement_money}&nbsp;&nbsp;/&nbsp;&nbsp;打款失败金额:&nbsp;{$money.error_money}
待打款金额:&nbsp;{$money.statement_money}&nbsp;&nbsp;&nbsp;&nbsp;打款成功金额:&nbsp;{$money.success_money}&nbsp;&nbsp;&nbsp;&nbsp;打款失败金额:&nbsp;{$money.error_money}
</td></tr>
</notemtpy>
</tbody>

@ -180,8 +180,9 @@
<option value="2" <if condition="isset($_GET['pay_type']) && I('pay_type') eq 2">selected</if> >线上打款</option>
</select>
</div>
<div class="input-list">
<input type="text" name="statement_num" class="" value="{:I('statement_num')}" placeholder="请输入汇总单号" style="width: 180px;"/>
</div>
<div class="input-list">
<input type="text" readonly id="time_start2" name="pay_time_start" class="" value="{:I('pay_time_start')}" placeholder="支付开始时间" />
&nbsp;-&nbsp;
@ -324,7 +325,7 @@
</if>
</volist>
</volist>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">待打款金额:&nbsp;{$sum['unpay_amount']|default='0.00'}&nbsp;&nbsp;打款成功金额:&nbsp;{$sum['pay_amount']|default='0.00'}&nbsp;打款失败金额:&nbsp;{$sum['faild_pay_amount']|default='0.00'}</td></tr>
<tr><td style="line-height: 42px;">合计</td><td colspan="13" style="line-height: 42px;">待打款金额:&nbsp;{$sum['unpay_amount']|default='0.00'}&nbsp;&nbsp;&nbsp;&nbsp;打款成功金额:&nbsp;{$sum['pay_amount']|default='0.00'}&nbsp;&nbsp;&nbsp;&nbsp;打款失败金额:&nbsp;{$sum['faild_pay_amount']|default='0.00'}</td></tr>
</notemtpy>
</tbody>
</table>

Loading…
Cancel
Save