master
ELF 5 years ago
parent e3b53e7df1
commit 77c692c44d

@ -140,6 +140,14 @@ class ConsoleController extends Think {
}
}
public function initPromoteAdmin()
{
$promotes = M('promote', 'tab_')->field(['id', 'chain', 'level', 'admin_id'])->where(['level' => 1, 'admin_id' => ['gt', 0]])->select();
foreach ($promotes as $promote) {
M('promote', 'tab_')->where(['chain' => ['like', $promote['chain'] . $promote['id'] . '/%']])->save(['admin_id' => $promote['admin_id']]);
}
}
public function modifyLoginRepair()
{
$this->modifyLogin(1569686400);

@ -80,10 +80,9 @@ class FinancePromoteController extends AdminController
$nwtflag = false;
}
}
if(isset($_REQUEST['develop_type'])){
if($_REQUEST['develop_type']!=0){
$nwtflag = false;
}
$isMarketAdmin = isMarketAdmin();
if(I('admin_id', 0) != 0 || $isMarketAdmin){
$nwtflag = false;
}
if (isset($_REQUEST['promote_id'])) {
if($_REQUEST['promote_id'] == 0){
@ -236,11 +235,22 @@ class FinancePromoteController extends AdminController
$map['company.develop_type'] = I('develop_type');
}
$adminId = 0;
$havingPids = [];
if (!empty(I('admin_id'))) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$adminId = $userAuth['uid'];
} else {
if (!empty(I('admin_id'))) {
$adminId = I('admin_id');
}
}
if ($adminId > 0) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
}
if($type == "spend"){
if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) {
$map["s.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) );
@ -269,9 +279,19 @@ class FinancePromoteController extends AdminController
if($istimeselect){
$map['s.create_time']=$istimeselect;
}
$adminId = 0;
$havingPids = [];
if (!empty(I('admin_id'))) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$adminId = $userAuth['uid'];
} else {
if (!empty(I('admin_id'))) {
$adminId = I('admin_id');
}
}
if ($adminId > 0) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
}
$map['s.status']=1;
@ -455,9 +475,20 @@ class FinancePromoteController extends AdminController
->join("tab_promote_company company ON promote.company_id = company.id", "left")
->group('promote_id');
$adminId = 0;
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$adminId = $userAuth['uid'];
} else {
if (!empty(I('admin_id'))) {
$adminId = I('admin_id');
}
}
$havingPids = [];
if (!empty(I('admin_id'))) {
$topIds = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
if ($adminId > 0) {
$topIds = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = getPromoteIdsByTopIds($topIds);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
$query->having('promote_id in (' . implode(',', $havingPids) . ')');
@ -477,10 +508,20 @@ 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")
->group('promote_id');
$adminId = 0;
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$adminId = $userAuth['uid'];
} else {
if (!empty(I('admin_id'))) {
$adminId = I('admin_id');
}
}
$havingPids = [];
if (!empty(I('admin_id'))) {
$topIds = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
if ($adminId > 0) {
$topIds = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = getPromoteIdsByTopIds($topIds);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
$query->having('promote_id in (' . implode(',', $havingPids) . ')');
@ -628,8 +669,20 @@ class FinancePromoteController extends AdminController
$map['pay_order_number'] = $_REQUEST['pay_order_number'];
}
if (!empty($_REQUEST['admin_id'])) {
$map['market_admin_id'] = $_REQUEST['admin_id'];
$adminId = 0;
$havingPids = [];
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$adminId = $userAuth['uid'];
} else {
if (!empty(I('admin_id'))) {
$adminId = I('admin_id');
}
}
if ($adminId > 0) {
$map['market_admin_id'] = $adminId;
}
/* if (!empty(I('develop_type'))) {
@ -717,6 +770,7 @@ class FinancePromoteController extends AdminController
"game_name"=>"游戏名称",
"sdk_version"=>"设备名称",
"promote_account"=>"所属推广员",
"market_admin_username"=>"所属市场专员",
"spend_ip"=>"充值ip",
"server_name"=>"游戏区服",
"game_player_name"=>"角色名称",
@ -770,9 +824,19 @@ class FinancePromoteController extends AdminController
if ($row != 0) {
$query = $query->page($page,$row);
}
$adminId = 0;
$isMarketAdmin = isMarketAdmin();
if ($isMarketAdmin) {
$userAuth = session('user_auth');
$adminId = $userAuth['uid'];
} else {
if (!empty(I('admin_id'))) {
$adminId = I('admin_id');
}
}
$havingPids = [];
if (!empty(I('admin_id'))) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => I('admin_id')])->getField('id', true);
if ($adminId > 0) {
$havingPids = M('promote', 'tab_')->where(['admin_id' => $adminId])->getField('id', true);
$havingPids = count($havingPids) > 0 ? $havingPids : [0];
$query->having('p_id in (' . implode(',', $havingPids) . ')');
}

@ -132,7 +132,7 @@ class MemberController extends ThinkController
}
}
//判断是否有列表和统计的权限
// $this->checkListOrCountAuthRestMap($map,["tab_user.id","tab_user.account","tab_user.device_number"]);
$this->checkListOrCountAuthRestMap($map,["tab_user.id","tab_user.account","tab_user.device_number"]);
//计算用户列表
$data = M("user","tab_")
->field("tab_user.id,`device_number`,`age_status`,tab_user.account,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,lock_remark,

@ -122,7 +122,7 @@ class SpendController extends ThinkController
// $map = '1 = 2';
// $map1 = $map;
// }
// $this->checkListOrCountAuthRestMap($map,["extend", "pay_order_number", "user_account"]);
$this->checkListOrCountAuthRestMap($map,["extend", "pay_order_number", "user_account"]);
$map1 = $map;
$map1['pay_status'] = 1;
$total = null_to_0(D(self::model_name)->where($map1)->sum('pay_amount'));

@ -703,7 +703,7 @@ class UserController extends AdminController
empty(I('user_account')) || $map['user_account'] = ['like', "%" . I('user_account') . "%"];
// $this->checkListOrCountAuthRestMap($map,["role_id", "role_name", "user_account"]);
$this->checkListOrCountAuthRestMap($map,["role_id", "role_name", "user_account"]);
$list = $this->lists(M('user_play_info', 'tab_'), $map, 'play_time desc');
$adminList = getMarketAdminsByPromoteIds(array_column($list, 'promote_id'));

@ -954,7 +954,7 @@ class PromoteService {
'bank_card' => $params['bank_card'],
'parent_id' => $parent ? $parent['id'] : 0,
'parent_name' => $parent ? $parent['account'] : '官方渠道',
'admin_id' => $params['admin_id'] ?? 0,
'admin_id' => $parent && $parent['admin_id'] > 0 ? $parent['admin_id'] : ($params['admin_id'] ?? 0),
'company_id' => $params['company_id'] ?? 0,
'invite_code' => $params['invite_code'] ?? '',
'create_time' => time(),

Loading…
Cancel
Save