推广后台->验证安全密码--更新

master
chenxiaojun 5 years ago
parent 1561e71977
commit 03cbc66d92

@ -251,12 +251,20 @@ class BaseController extends HomeController
return $this->loginPromote;
}
//验证安全密码视图
//验证安全密码--视图
public function verifyPasswordView($modelList, $metaTitle)
{
$securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码
$model = new \User\Api\PromoteApi();
$res = $model->verify_er_User(PID, $securityCode);//验证安全密码
if ($res) {
return true;
}
$this->assign('modelList', $modelList);
$this->assign('metaTitle', $metaTitle);
$this->display('Public/verify_password');
exit;
}
//验证安全密码
@ -265,7 +273,6 @@ class BaseController extends HomeController
$password = I('post.password');
$model = new \User\Api\PromoteApi();
$res = $model->verify_er_User(PID, $password);
if ($res) {
session('game_divide_second_pwd', $password);

@ -3,7 +3,6 @@
namespace Home\Controller;
use OT\DataDictionary;
use User\Api\PromoteApi;
use Base\Repository\PromoteRepository;
use Base\Repository\SpendRepository;
use Base\Repository\UserRepository;
@ -15,82 +14,76 @@ class FinanceController extends BaseController
{
public function settlementDtl()
{
//验证安全密码
$metaTitle = '结算明细';
$securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码
$model = new PromoteApi();
$res = $model->verify_er_User(PID, $securityCode);//验证安全密码
if ($res) {
$model = M('spend', 'tab_');
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$payOrderNumber = I('pay_order_number', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$loginPromote = $this->getLoginPromote();
$modelList = ['财务管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['pay_order_number'] = $payOrderNumber;
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$model = M('spend', 'tab_');
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$payOrderNumber = I('pay_order_number', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$loginPromote = $this->getLoginPromote();
$map['chain'] = ['like', $loginPromote['chain'] . $loginPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$ids[] = $loginPromote['id'];
$ids = implode(',', $ids);
// var_dump($ids);
// die;
$parameter['p'] = $page;
$parameter['row'] = $row;
$parameter['pay_order_number'] = $payOrderNumber;
$parameter['begtime'] = $initBegTime;
$parameter['endtime'] = $initEndTime;
$map = [];
$map['promote_id'] = ['in', $ids];
if (!empty($payOrderNumber)) {
$map['pay_order_number'] = $payOrderNumber;
}
if (!empty($begTime) && empty($endTime)) {
$map['pay_time'] = ['egt', $begTime];
} elseif (empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['elt', $endTime + 86399];
} elseif (!empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['between', [$begTime, $endTime + 86399]];
}
$map['chain'] = ['like', $loginPromote['chain'] . $loginPromote['id'] . '/%'];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
$ids[] = $loginPromote['id'];
$ids = implode(',', $ids);
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,convert(pay_amount*if(selle_ratio >= 0,selle_ratio,0),decimal(10,2)) as income,pay_time,selle_status')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $model->where($map)->count();
$map = [];
$map['promote_id'] = ['in', $ids];
if (!empty($payOrderNumber)) {
$map['pay_order_number'] = $payOrderNumber;
}
if (!empty($begTime) && empty($endTime)) {
$map['pay_time'] = ['egt', $begTime];
} elseif (empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['elt', $endTime + 86399];
} elseif (!empty($begTime) && !empty($endTime)) {
$map['pay_time'] = ['between', [$begTime, $endTime + 86399]];
}
foreach ($data as &$list) {
switch ($list['selle_status']) {
case 0:
$list['selle_status'] = '未提现';
break;
default:
$list['selle_status'] = '';
break;
}
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,convert(pay_amount*if(selle_ratio >= 0,selle_ratio,0),decimal(10,2)) as income,pay_time,selle_status')
->where($map)
->order('id desc')
->page($page, $row)
->select();
$count = $model->where($map)->count();
foreach ($data as &$list) {
switch ($list['selle_status']) {
case 0:
$list['selle_status'] = '未提现';
break;
default:
$list['selle_status'] = '';
break;
}
$list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']);
}
$page = set_pagination($count, $row, $parameter);
$page = set_pagination($count, $row, $parameter);
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('_page', $page);
$this->assign('meta_title', '结算明细');
$this->display();
} else {
$modelList = ['财务管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
}
$this->assign('listData', $data);
$this->assign('count', $count);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('_page', $page);
$this->assign('meta_title', '结算明细');
$this->display();
}
}

@ -20,69 +20,65 @@ class GameDivideController extends BaseController
$this->error('权限异常');
}
//验证安全密码
$metaTitle = '分成比例';
$securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码
$model = new PromoteApi();
$res = $model->verify_er_User(PID, $securityCode);//验证安全密码
if ($res) {
$map['tab_game.online_status'] = 1;//开发者游戏上线状态
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
$map['tab_game.game_status'] = 1;//游戏状态
empty(I('relation_game_id')) || $map['relation_game_id'] = I('relation_game_id');
empty(I('sdk_version')) || $map['sdk_version'] = I('sdk_version');
empty(I('server_type')) || $map['server_type'] = I('server_type');
$modelList = ['游戏管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
$minRatio = floatval(I('min_ratio', 0));
$maxRatio = floatval(I('max_ratio', 0));
if (!empty($minRatio) && empty($maxRatio)) {
$map['ratio'] = ['egt', $minRatio];
} elseif (empty($minRatio) && !empty($maxRatio)) {
$map['ratio'] = ['elt', $maxRatio];
} elseif (!empty($minRatio) && !empty($maxRatio)) {
$map['ratio'] = ['between', [$minRatio, $maxRatio]];
}
$map['tab_game.online_status'] = 1;//开发者游戏上线状态
$map['tab_game.down_port'] = 1;//游戏端口 第三方接口不能申请
$map['tab_game.game_status'] = 1;//游戏状态
empty(I('relation_game_id')) || $map['relation_game_id'] = I('relation_game_id');
empty(I('sdk_version')) || $map['sdk_version'] = I('sdk_version');
empty(I('server_type')) || $map['server_type'] = I('server_type');
$page = intval(I('get.p', 0));
$page = $page ? $page : 1; //默认显示第一页数据
$minRatio = floatval(I('min_ratio', 0));
$maxRatio = floatval(I('max_ratio', 0));
if (!empty($minRatio) && empty($maxRatio)) {
$map['ratio'] = ['egt', $minRatio];
} elseif (empty($minRatio) && !empty($maxRatio)) {
$map['ratio'] = ['elt', $maxRatio];
} elseif (!empty($minRatio) && !empty($maxRatio)) {
$map['ratio'] = ['between', [$minRatio, $maxRatio]];
}
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
$page = intval(I('get.p', 0));
$page = $page ? $page : 1; //默认显示第一页数据
$data = M('Game', 'tab_')
->field('id,icon,game_name,game_type_name,sdk_version,server_type,discount,ratio')
->where($map)
->order('sort desc')
->page($page, $row)
->select();
$count = M('Game', 'tab_')
->where($map)
->count();
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
//分页
$parameter['p'] = I('get.p', 1);
$parameter['row'] = I('get.row');
empty(I('relation_game_id')) || $parameter['relation_game_id'] = I('relation_game_id');
empty(I('sdk_version')) || $parameter['sdk_version'] = I('sdk_version');
empty(I('server_type')) || $parameter['server_type'] = I('server_type');
empty($minRatio) || $parameter['min_ratio'] = $minRatio;
empty($maxRatio) || $parameter['max_ratio'] = $maxRatio;
$data = M('Game', 'tab_')
->field('id,icon,game_name,game_type_name,sdk_version,server_type,discount,ratio')
->where($map)
->order('sort desc')
->page($page, $row)
->select();
$count = M('Game', 'tab_')
->where($map)
->count();
$page = set_pagination($count, $row, $parameter);
if ($page) {
$this->assign('_page', $page);
}
//分页
$parameter['p'] = I('get.p', 1);
$parameter['row'] = I('get.row');
empty(I('relation_game_id')) || $parameter['relation_game_id'] = I('relation_game_id');
empty(I('sdk_version')) || $parameter['sdk_version'] = I('sdk_version');
empty(I('server_type')) || $parameter['server_type'] = I('server_type');
empty($minRatio) || $parameter['min_ratio'] = $minRatio;
empty($maxRatio) || $parameter['max_ratio'] = $maxRatio;
$this->assign('dataList', $data);
$this->assign('count', $count);
$this->assign('serverType', I('server_type', 0));
$this->meta_title = $metaTitle;
$this->display();
} else {
$modelList = ['游戏管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
$page = set_pagination($count, $row, $parameter);
if ($page) {
$this->assign('_page', $page);
}
$this->assign('dataList', $data);
$this->assign('count', $count);
$this->assign('serverType', I('server_type', 0));
$this->meta_title = $metaTitle;
$this->display();
}
}

@ -2258,17 +2258,12 @@ class PromoteController extends BaseController
$this->error('权限异常');
}
$securityCode = empty(session('game_divide_second_pwd')) ? '' : session('game_divide_second_pwd');//安全密码
$model = new PromoteApi();
$res = $model->verify_er_User(PID, $securityCode);//验证安全密码
if ($_POST) {
if (!$res) {
$data['status'] = 0;
$data['msg'] = '权限异常';
$this->ajaxReturn($data);
}
//验证安全密码
$metaTitle = '设置';
$modelList = ['游戏管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
if ($_POST) {
$save['child_game_permission'] = I('post.child_game_permission');
$saveRes = D('Promote')->where(array('id' => PID))->save($save);
if ($saveRes === false) {
@ -2281,18 +2276,12 @@ class PromoteController extends BaseController
$this->ajaxReturn($data);
} else {
$metaTitle = '设置';
if ($res) {
$map['id'] = PID;
$promoteData = D('Promote')->field('id,child_game_permission')->where($map)->find();
$this->assign('data', $promoteData);
$this->meta_title = $metaTitle;
$this->display();
} else {
$modelList = ['游戏管理', $metaTitle];
$this->verifyPasswordView($modelList, $metaTitle);
}
$map['id'] = PID;
$promoteData = D('Promote')->field('id,child_game_permission')->where($map)->find();
$this->assign('data', $promoteData);
$this->meta_title = $metaTitle;
$this->display();
}
}

Loading…
Cancel
Save