导出账号权限添加

master
zhengyongxing 5 years ago
parent fcc7bf2aaa
commit 0482836a8e

@ -920,3 +920,43 @@ function getGameTypeName($id,$chinese=true)
}
}
/**
* 权限检测
* @param string $rule 检测的规则
* @param string $mode check模式
* @return boolean
* @author 朱亚杰 <xcoolcc@gmail.com>
*/
use Admin\Model\AuthRuleModel;
function checkRule($rule, $type=AuthRuleModel::RULE_URL, $mode='url'){
static $Auth = null;
if (!$Auth) {
$Auth = new \Think\Auth();
}
if(!$Auth->check($rule,is_login(),$type,$mode)){
return false;
}
return true;
}
/**
* 验证导出账号权限是否加密
* @param [type] $type 0:"_list_check",1:"_count_check"
* @return void
*/
function checkEncryptionAuth(&$value,$string){
//验证count
if(is_administrator()){
return true;
}else{
$exportRule = strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'/'.$string."_encryption_check");
if (checkRule($exportRule,array('in','1,2'))) {
$value = encryption($value);
}
}
}

@ -1219,6 +1219,9 @@ class ExportController extends Controller
}else {
$value['payed_time'] = "------";
}
checkEncryptionAuth($value['user_account'],'spend_lists');
// $value['user_account'] = encryption($value['user_account']);
$value['extend'] = $value['extend'].'`';
$value['pay_way'] = get_pay_way($value['pay_way']);
$value['pay_status'] = get_info_status($value['pay_status'],9);
@ -1340,6 +1343,9 @@ class ExportController extends Controller
->order('id DESC')
->select();
foreach ($xlsData as $key => $value) {
checkEncryptionAuth($xlsData[$key]['user_account'],'deposit_lists');
$xlsData[$key]['create_time'] = date('Y-m-d H:i:s', $value['create_time']);
if ($value['pay_status'] == 1){
$xlsData[$key]['payed_time'] = date('Y-m-d H:i:s', $value['payed_time']);
@ -2466,6 +2472,9 @@ class ExportController extends Controller
$order_list['pay_amount'] = $v['pay_amount'];
$order_list['pay_way'] = get_pay_way($v['pay_way']);
$order_list['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
checkEncryptionAuth($order_list['user_account'],'TestOrder_lists');
$xlsData[] = $order_list;
}
$sumData = [['server_type'=>'总计',
@ -4142,6 +4151,7 @@ class ExportController extends Controller
$xlsName = $_REQUEST['xlsname'];
$data = $data['data'];
foreach ($data as $key => $value) {
checkEncryptionAuth($data[$key]['user_account'],'deposit_lists');
$data[$key]['pay_way'] = get_pay_way($value['pay_way']);
$data[$key]['create_time'] = date('Y-m-d H:i:s',$value['create_time']);
if ($value['pay_status'] == 1) {

@ -854,6 +854,11 @@ class FinanceController extends ThinkController
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
if (isset($_REQUEST['export'])) {
checkEncryptionAuth($data[$key]['user_account'],'gameStatisticsDetail');
}
}
if(isset($_REQUEST['export'])){
//操作日志
@ -877,7 +882,13 @@ class FinanceController extends ThinkController
data2csv($data,"游戏统计订单查看",$dcop);
}
$totalData = D('spend')->totalGameStatistics($map, false);
$totalMap = $map;
if ($map['game_id']) {
$totalMap['s.game_id'] = $map['game_id'];
unset($totalMap['game_id']);
}
$totalData = D('spend')->totalGameStatistics($totalMap, false);
$sumCash = $totalData['cash_count'] ?? 0;
$sumBalance = $totalData['balance_coin_count'] ?? 0;

@ -589,6 +589,11 @@ class FinancePromoteController extends AdminController
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']);
if (isset($_REQUEST['export'])) {
checkEncryptionAuth($data[$key]['user_account'],'gameStatisticsDetail');
}
}
if (isset($_REQUEST['export'])) {
@ -760,6 +765,9 @@ class FinancePromoteController extends AdminController
$data[$key]['cost'] = number_format($value['cost'],2,'.','');
$data[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.','');
if (isset($_REQUEST['export'])) {
checkEncryptionAuth($data[$key]['user_account'],'gameCoinDetail');
}
}
if (isset($_REQUEST['export'])) {

@ -887,6 +887,10 @@ class PayChannelController extends ThinkController
$v['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']);
$v['pay_way'] = get_pay_way($v['pay_way']);
if ($v['user_account']) {
checkEncryptionAuth($v['user_account'],'gameDetail');
}
$xlsData[] = $v;
mb_convert_variables('GBK', 'UTF-8', $v);
@ -1436,6 +1440,8 @@ class PayChannelController extends ThinkController
foreach ($data as $key => $value) {
checkEncryptionAuth($value['user_account'],'testDetail');
$value['pay_order_number'] = "'".$value['pay_order_number'];
$value['order_number'] = "'".$value['order_number'];
$value['game_name'] =clearGameNameType($value['game_name']);

Loading…
Cancel
Save