合并热更

master
chenzhi 5 years ago
commit c9d6b9859d

@ -2472,7 +2472,7 @@ function getAvailableBalance($promote_id=0,$game_id=0,$server_id='') {
function getMarketGroupIds()
{
return ['11', '12'];
return M('auth_group', 'sys_')->where(['title' => ['like', '%市场专员%']])->getField('id', true);
}
function getAdmins()
@ -2483,6 +2483,9 @@ function getAdmins()
function getMarketAdmins()
{
$ids = getMarketGroupIds();
if (count($ids) == 0) {
return [];
}
$adminIds = M('auth_group_access', 'sys_')->where(['group_id' => ['in', $ids]])->getField('uid', true);
return M('ucenter_member', 'sys_')->where(['id' => ['in', $adminIds]])->select();
}
@ -2547,6 +2550,9 @@ function isMarketLeader()
function isMarketAdmin()
{
$ids = getMarketGroupIds();
if (count($ids) == 0) {
return false;
}
$userAuth = session('user_auth');
$adminIds = M('auth_group_access', 'sys_')->where(['group_id' => ['in', $ids]])->getField('uid', true);
return in_array($userAuth['uid'], $adminIds);

@ -143,7 +143,7 @@ class CompanyGameRatioController extends AdminController
->join("JOIN tab_promote_company p ON ( m.company_id = p.id".$pwhere.")")
->where($where)->find()['count'];
$this->assign('data', $dbres);
$page = set_pagination($count, $row);
$page = set_pagination($count, $row,$params);
if($page) {
$this->assign('_page', $page);
}
@ -317,7 +317,7 @@ class CompanyGameRatioController extends AdminController
->join("JOIN tab_promote_company p ON ( m.company_id = p.id".$pwhere.")")
->where($where)->find()['count'];
$this->assign('data', $dbres);
$page = set_pagination($count, $row);
$page = set_pagination($count, $row,$params);
if($page) {
$this->assign('_page', $page);
}

@ -107,7 +107,7 @@ class CompanyRelationController extends AdminController
$count = $this->DBModel->field("count(id) count")->where($where)->find()['count'];
$this->assign('data', $dbres);
$page = set_pagination($count, $row);
$page = set_pagination($count, $row,$params);
if($page) {
$this->assign('_page', $page);
}
@ -223,7 +223,7 @@ class CompanyRelationController extends AdminController
$count = $this->DBlogModel->field("count(id) count")->where($where)->find()['count'];
$this->assign('data', $dbres);
$page = set_pagination($count, $row);
$page = set_pagination($count, $row,$params);
if($page) {
$this->assign('_page', $page);
}

@ -178,9 +178,9 @@ class CompanyStatementController extends ThinkController
}
$count = M("company_statement","tab_")->field("count(id) count,IFNULL(SUM(CASE WHEN withdraw_type < 2 THEN platform_amount ELSE 0 END),0) as platform_amount,SUM(statement_money) as statement_money")->where($map)->find();
// dd($count);
$parameter['p'] = $page;
$parameter['row'] = $row;
$page = set_pagination($count['count'], $row, $parameter);
$params['p'] = $page;
$params['row'] = $row;
$page = set_pagination($count['count'], $row, $params);
if ($page) {
$this->assign('_page', $page);
}

@ -83,9 +83,9 @@ class CompanyStatementLackController extends ThinkController
$count = $this->DBModel->field("count(id) count,sum(statement_money) statement_money")->where($map)->find();
// dd($count);
$parameter['p'] = $page;
$parameter['row'] = $row;
$page = set_pagination($count['count'], $row, $parameter);
$params['p'] = $page;
$params['row'] = $row;
$page = set_pagination($count['count'], $row, $params);
if ($page) {
$this->assign('_page', $page);
}

@ -165,9 +165,9 @@ class CompanyStatementPoolController extends ThinkController
}
$count = $this->DBModel->field("count(id) count,SUM(statement_money) as statement_money")->where($map)->find();
// dd($count);
$parameter['p'] = $page;
$parameter['row'] = $row;
$page = set_pagination($count['count'], $row, $parameter);
$params['p'] = $page;
$params['row'] = $row;
$page = set_pagination($count['count'], $row, $params);
if ($page) {
$this->assign('_page', $page);
}

@ -252,7 +252,7 @@ class CompanyStatementSetController extends Controller {
$game['pay_amount'] =$va['pay_money'];
$game['game_name'] =$ke;
//获取游戏id及比例
$game_id = $GameDb->where("game_name='{$ke}' OR relation_game_name='{$ke}'")->field("id,relation_game_id")->find();
$game_id = $GameDb->where("game_name='{$ke}' OR original_package_name='{$ke}'")->field("id,relation_game_id")->find();
if(empty($game_id)){
$game['relation_game_id']=0;
// $game['sum_money']=0;

@ -75,6 +75,11 @@ class FinancePromoteController extends AdminController
$nwtflag = false;
}
}
if(isset($_REQUEST['develop_type'])){
if($_REQUEST['develop_type']!=0){
$nwtflag = false;
}
}
if(isset($_REQUEST['admin_id'])){
if($_REQUEST['admin_id']!=0){
$nwtflag = false;
@ -183,12 +188,15 @@ class FinancePromoteController extends AdminController
$outBelong = 0;
$insideBelong = 0;
$otherBelong = 0;
foreach ($data as $key => $value) {
if ($value['company_belong']=='内团') {
$insideBelong+=$value['allcount'];
} else {
} elseif ($value['company_belong']=='外团' || $value['company_belong']=='外团-分发') {
$outBelong+=$value['allcount'];
} else {
$otherBelong+=$value['allcount'];
}
}
@ -205,7 +213,7 @@ class FinancePromoteController extends AdminController
$this->assign('outBelong',number_format($outBelong/$count['all_count']*100,2,'.',''));
//内团占比
$this->assign('insideBelong',number_format($insideBelong/$count['all_count']*100,2,'.',''));
$this->assign('otherBelong',number_format($otherBelong/$count['all_count']*100,2,'.',''));
$size = $row;
$data = array_slice($data, ($arraypage - 1) * $size, $size);
$this->assign('list_data', $data);
@ -347,6 +355,11 @@ class FinancePromoteController extends AdminController
//获取各会长的现金充值
$map=[];
$title = '';
if (!empty(I('develop_type'))) {
$map['company.develop_type'] = I('develop_type');
}
self::setPromoteMap($map,"s.promote_id",$title);
$title .= "渠道统计";
$this->assign('title', $title);
@ -1205,12 +1218,10 @@ class FinancePromoteController extends AdminController
$title .= (getCompanyBlong($_REQUEST['company_belong'])."-");
}
if (!empty(I('develop_type'))) {
$map['company.develop_type'] = I('develop_type');
if(I('develop_type') != 0){
$gfflg = false;
}
if (I('develop_type', 0) != 0) {
$gfflg = false;
}
if (!empty(I('admin_id'))) {
if(I('admin_id') != 0){
$gfflg = false;

@ -81,7 +81,7 @@ class GameRatioMouldController extends AdminController
$count = $this->DBModel->alias('m')->field("count(id) count")->join("INNER JOIN ({$gameres}) g ON m.relation_game_id = g.relation_game_id")->where($where)->find()['count'];
$this->assign('data', $dbres);
$page = set_pagination($count, $row);
$page = set_pagination($count, $row,$params);
if($page) {
$this->assign('_page', $page);
}

@ -48,8 +48,7 @@ class MarketController extends ThinkController
if (count($recordCompanyIds) > 0) {
$recordCompanys = M('promote_company', 'tab_')->field(['id', 'company_name', 'company_belong'])->where(['id' => ['in', $recordCompanyIds]])->select();
}
$adminIds = array_merge(array_column($items, 'from_id'), array_column($items, 'to_id'));
$recordAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->where(['id' => ['in', $adminIds]])->select();
$recordAdmins = M('ucenter_member', 'sys_')->field(['id', 'username'])->select();
$recordPromotes = index_by_column('id', $recordPromotes);
$recordCompanys = index_by_column('id', $recordCompanys);
$recordAdmins = index_by_column('id', $recordAdmins);
@ -82,7 +81,8 @@ class MarketController extends ThinkController
'split_time' => $item['split_time'] == 0 ? '全部' : date('Y-m-d H:i:s', $item['split_time']),
'created_time' => date('Y-m-d H:i:s', $item['created_time']),
'status_text' => $statusList[$item['status']],
'status' => $item['status']
'status' => $item['status'],
'creator_username' => isset($recordAdmins[$item['creator_id']]) ? $recordAdmins[$item['creator_id']]['username'] : '未知',
];
}
$companys = M('promote_company', 'tab_')->field(['id', 'company_name'])->where(['company_belong' => ['in', [1, 2]]])->select();
@ -99,8 +99,17 @@ class MarketController extends ThinkController
public function rebind()
{
$this->meta_title = '新增换绑';
$companyTypes = [
0 => '内团',
1 => '外团',
2 => '外团-分发联盟',
3 => '无'
];
$id = I('id', 0);
$companys = M('promote_company', 'tab_')->field(['id', 'company_name'])->where(['company_belong' => ['in', [1, 2]]])->select();
$companys = M('promote_company', 'tab_')->field(['id', 'company_name', 'company_belong'])->where(['company_belong' => ['in', [1, 2]]])->select();
foreach ($companys as &$company) {
$company['company_belong'] = $companyTypes[$company['company_belong']] ?? '未知';
}
$marketAdmins = getMarketAdmins();
$this->assign('companys', $companys);
$this->assign('marketAdmins', $marketAdmins);

@ -609,19 +609,27 @@ class TimingController extends AdminController {
public function shiftPromoteStatistics() {
$data = M("shift_task")->where(['status'=>0,'type'=>2])->select();
$data = M("shift_task")->where(['change_status'=>0,'type'=>2])->select();
$promote_data = [];
$change_id = [];
foreach ($data as $key => $value) {
$promote_data[] = $value['from_promote_id'];
$promote_data[] = $value['to_promote_id'];
$change_id[] = $value['id'];
}
$promote_data=array_unique($promote_data);
sort($promote_data);
if(!$promote_data) {
echo "没有数据";
die();
}
$chain_data = M("promote","tab_")
->field("id")
->where(['chain'=>'/','id'=>['in',$promote_data]])
@ -650,6 +658,8 @@ class TimingController extends AdminController {
$this->PromoteStatistics($data);
M("shift_task")->where(['id'=>['in',$change_id]])->save(['change_status'=>1]);
// dump($data);
// dump(array_unique($chain_data_secord));

@ -252,9 +252,6 @@
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<!-- <a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a> -->
</if>
{$_page|default=''}
</div>
<div style="width: 100vw;height: 100vh;padding: 0;position: absolute;top: 0;z-index: 9999;display: none;" id="creat_msg">

@ -282,7 +282,7 @@
</tr>
<tr class="data_summary">
<td style="text-align: center;">内外团占比:</td>
<td colspan="20" style="text-align: center;">内团充值金额占比:{$insideBelong}%&nbsp&nbsp&nbsp&nbsp其他团体充值金额占比:{$outBelong}%</td>
<td colspan="20" style="text-align: center;">内团充值金额占比:{$insideBelong}%&nbsp&nbsp&nbsp&nbsp外团充值金额占比:{$outBelong}%&nbsp&nbsp&nbsp&nbsp其他团体充值金额占比:{$otherBelong}%</td>
</tr>
</tbody>
</table>

@ -95,7 +95,7 @@
<select name="company_id" id="company-select" class="select_gallery">
<option value="">请选择推广公司</option>
<?php foreach($companys as $company):?>
<option value="<?=$company['id']?>" <?php if($company['id'] == $promote['company_id']):?>selected<?php endif;?>><?=$company['company_name']?></option>
<option value="<?=$company['id']?>" data-belong="<?=$company['company_belong']?>" <?php if($company['id'] == $promote['company_id']):?>selected<?php endif;?>><?=$company['company_name']?></option>
<?php endforeach;?>
</select>
</td>
@ -260,6 +260,8 @@ $(function(){
var companyOption = $("#company-select option:selected");
var companyId = companyOption.val()
var companyName = companyOption.text()
var belong = companyOption.attr('data-belong');
belong == undefined ? '--' : belong
var promoteOption = $("#promote-select option:selected");
var promoteId = promoteOption.val()
var promoteName = promoteOption.text()
@ -296,7 +298,7 @@ $(function(){
console.log(promoteIds)
var html = '<tr data-post=' + JSON.stringify(data) + '><td>' + companyName + '</td>' +
'<td class="promote-item" data-id="' + promoteId + '">' + promoteName + '</td>' +
'<td>' + 'ssb' + '</td>' +
'<td>' + belong + '</td>' +
'<td>' + $('#from-market-name').text() + '</td>' +
'<td>' + marketName + '</td>' +
'<td>' + splitTime + '</td>' +

@ -97,6 +97,7 @@
<th>新市场专员</th>
<th>备注</th>
<th>订单切分时间</th>
<th>操作人</th>
<th>状态</th>
<th>换绑操作时间</th>
<!-- <th>操作</th> -->
@ -117,6 +118,7 @@
<td>{$data.to_username}</td>
<td>{$data.remark}</td>
<td>{$data.split_time}</td>
<td>{$data.creator_username}</td>
<td>{$data.status_text}</td>
<td>{$data.created_time}</td>
<!-- <td>

@ -336,7 +336,6 @@
format: 'yyyy-mm-dd',
language:"zh-CN",
minView: "month",
// startDate:new Date(),
autoclose:true
}).change(function(){
var start = new Date($(this).val()).getTime();
@ -353,7 +352,6 @@
format: 'yyyy-mm-dd',
language:"zh-CN",
minView: "month",
// startDate:new Date(),
autoclose:true
}).change(function(){
var end = new Date($(this).val()).getTime();

@ -374,175 +374,4 @@ class SpendRepository
{
// return M('spend', 'tab_')->field($columns)->where($map);
}
public function achievement()
{
$time = I('time', date('Y-m-d'));
if (!empty($time)) {
$defaultTime = $time;
} else {
$defaultTime = date('Y-m-d', time());
}
$sdkVersion = I('sdk_version', 0);
$relationGameId = I('relation_game_id', 0);
$serverId = I('server_id', 0);
$parentId = I('parent_id', 0);
$promoteId = I('promote_id', 0);
$status = I('status', 0);
$searchLevel = 0;
$searchLevelName = '';
$currentDisplay = '';
$prevParentId = 0;
$promoteService = new PromoteService();
$loginPromote = $this->getLoginPromote();
$parent = null;
if ($parentId > 0) {
$parent = M('promote', 'tab_')->where(['id' => $parentId])->find();
$currentDisplay = $promoteService->getLevelName($parent['level']) . '推广';
$prevParentId = $parent['parent_id'] == $loginPromote['parent_id'] ? 0 : $parent['parent_id'];
} else {
$parent = $loginPromote;
$currentDisplay = '自己';
}
$searchLevel = $parent['level'] + 1;
$searchLevelName = $promoteService->getLevelName($searchLevel);
$games = get_promote_serach_game();
$subPromotes = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'group_remark'])->where(['parent_id' => $parent['id']])->select();
$map = ['parent_id' => $parent['id']];
if ($promoteId > 0) {
$map['id'] = $promoteId;
}
$query = M('promote', 'tab_')->field(['id', 'account', 'real_name', 'level', 'chain'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
$rows = [];
if (count($ids) > 0) {
$rows = M('promote', 'tab_')
->field(['id', 'chain'])
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
->select();
}
$basicPromotes = [];
foreach ($ids as $id) {
foreach ($rows as $row) {
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
if (strpos($row['chain'], $needChain) !== false) {
$basicPromotes[$row['id']] = $id;
}
}
}
$params = [
'isContainSubs' => true,
'basicPromotes' => $basicPromotes,
];
if ($relationGameId != 0 || $sdkVersion != 0) {
$gameIds = gameSearch($relationGameId, $sdkVersion);
$params['game_id'] = ['in', $gameIds];
}
if ($serverId > 0) {
$params['server_id'] = $serverId;
}
if ($status > 0) {
$params['lock_status'] = $status;
}
list($beginTime, $endTime) = $this->getBetweenTime($time);
$params['begin_time'] = $beginTime;
$params['end_time'] = $endTime;
$timeout = 0;
$records = [];
if (intval($endTime - $beginTime) / (24 * 3600) <= 7) {
$promoteRepository = new PromoteRepository();
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
$createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params);
$newCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds($ids, $params);
// $newCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds($ids, $params);
$newCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds($ids, $params);
$loginUserCountList = $promoteRepository->getLoginUserCountByIds($ids, $params);
$rechargeCountList = [];
$rechargeUserCountList = [];
$rechargeAmountList = [];
if ($this->canViewUserRecharge) {
$rechargeCountList = $promoteRepository->getRechargeCountByIds($ids, $params);
$rechargeUserCountList = $promoteRepository->getRechargeUserCountByIds($ids, $params);
$rechargeAmountList = $promoteRepository->getRechargeAmountByIds($ids, $params);
}
$promoteService = new PromoteService();
if (I('p', 1) == 1) {
$selfParams = $params;
$selfParams['isContainSubs'] = false;
$selfCreateRoleCountList = $promoteRepository->getCreateRoleCountByIds([$parent['id']], $selfParams);
$selfCreateRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds([$parent['id']], $selfParams);
$selfNewCreateRoleUserCountList = $promoteRepository->getNewCreateRoleUserCountByIds([$parent['id']], $selfParams);
// $selfNewCreateRoleDeviceCountList = $promoteRepository->getNewCreateRoleDeviceCountByIds([$parent['id']], $selfParams);
$selfNewCreateRoleIpCountList = $promoteRepository->getNewCreateRoleIpCountByIds([$parent['id']], $selfParams);
$selfLoginUserCountList = $promoteRepository->getLoginUserCountByIds([$parent['id']], $selfParams);
$record = [
'id' => $parent['id'],
'account' => $parent['account'],
'promote_group' => $promoteService->getGroupNameByChain($parent['chain'], $parent['id']),
'real_name' => hideRealName($parent['real_name']),
'level' => $parent['level'],
'create_role_count' => $selfCreateRoleCountList[$parent['id']],
'create_role_user_count' => $selfCreateRoleUserCountList[$parent['id']],
'new_create_role_user_count' => $selfNewCreateRoleUserCountList[$parent['id']],
// 'new_create_role_device_count' => $selfNewCreateRoleDeviceCountList[$parent['id']],
'new_create_role_ip_count' => $selfNewCreateRoleIpCountList[$parent['id']],
'login_user_count' => $selfLoginUserCountList[$parent['id']],
'current_display' => $currentDisplay,
];
if ($this->canViewUserRecharge) {
$selfRechargeCountList = $promoteRepository->getRechargeCountByIds([$parent['id']], $selfParams);
$selfRechargeUserCountList = $promoteRepository->getRechargeUserCountByIds([$parent['id']], $selfParams);
$selfRechargeAmountList = $promoteRepository->getRechargeAmountByIds([$parent['id']], $selfParams);
$record['recharge_count'] = $selfRechargeCountList[$parent['id']];
$record['recharge_user_count'] = $selfRechargeUserCountList[$parent['id']];
$record['recharge_amount'] = $selfRechargeAmountList[$parent['id']]['ban_coin'] + $selfRechargeAmountList[$parent['id']]['coin'] + $selfRechargeAmountList[$parent['id']]['cash'];
$record['recharge_by_ban_coin'] = $selfRechargeAmountList[$parent['id']]['ban_coin'];
$record['recharge_by_coin'] = $selfRechargeAmountList[$parent['id']]['coin'];
$record['recharge_by_cash'] = $selfRechargeAmountList[$parent['id']]['cash'];
}
$records[] = $record;
}
foreach ($promotes as $promote) {
$id = $promote['id'];
$record = [
'id' => $id,
'account' => $promote['account'],
'promote_group' => $promoteService->getGroupNameByChain($promote['chain'], $promote['id']),
'real_name' => hideRealName($promote['real_name']),
'level' => $promote['level'],
'create_role_count' => $createRoleCountList[$id],
'create_role_user_count' => $createRoleUserCountList[$id],
'new_create_role_user_count' => $newCreateRoleUserCountList[$id],
// 'new_create_role_device_count' => $newCreateRoleDeviceCountList[$id],
'new_create_role_ip_count' => $newCreateRoleIpCountList[$id],
'login_user_count' => $loginUserCountList[$id],
'current_display' => '',
];
if ($this->canViewUserRecharge) {
$record['recharge_count'] = $rechargeCountList[$id];
$record['recharge_user_count'] = $rechargeUserCountList[$id];
$record['recharge_amount'] = $rechargeAmountList[$id]['ban_coin'] + $rechargeAmountList[$id]['coin'] + $rechargeAmountList[$id]['cash'];
$record['recharge_by_ban_coin'] = $rechargeAmountList[$id]['ban_coin'];
$record['recharge_by_coin'] = $rechargeAmountList[$id]['coin'];
$record['recharge_by_cash'] = $rechargeAmountList[$id]['cash'];
}
$records[] = $record;
}
} else {
$timeout = 1;
}
}

@ -2088,4 +2088,6 @@ ADD COLUMN `server_fee` decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '服务器
ADD COLUMN `cooperation_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '合作关系1合作中 0暂停合作' AFTER `server_fee`;
ALTER TABLE `tab_partner`
MODIFY COLUMN `settlement_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '结算方式(作废,请查看tab_company_relation表)' AFTER `is_sign_contract`;
MODIFY COLUMN `settlement_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '结算方式(作废,请查看tab_company_relation表)' AFTER `is_sign_contract`;
ALTER TABLE `sys_shift_task`
ADD COLUMN `change_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '推广员充值换榜执行状态 0 未处理 1 已处理' AFTER `status`;

Loading…
Cancel
Save