Merge branch 'master' of 8.136.139.249:wmtx/platform into feature/more_payment

master
chenzhi 4 years ago
commit fd285df021

@ -3297,4 +3297,14 @@ function array_repeat($array,$keyid="id",$desc=false)
$c = array_rsort($c,true);
}
return $c;
}
function getShiftingMends(array $userIds = null)
{
$map = ['status' => 0];
if (!is_null($userIds)) {
$map['user_id'] = ['in', $userIds];
}
$mends = M('mend', 'tab_')->field(['id', 'user_id'])->where($map)->select();
return index_by_column('user_id', $mends);
}

@ -572,7 +572,7 @@ class AuthManagerController extends AdminController{
$promoteData = '';
}
if ($AuthGroup->where("id = {$gid}")->syncSave(array(
if ($AuthGroup->where("id = {$gid}")->save(array(
'data_empower_type' => $data_empower_type,
'data_president' => $promoteData,
'show_data' => $show_data,

@ -293,8 +293,9 @@ class CompanyStatementOfflineController extends ThinkController
M("company_statement_info_part","tab_")->save($savedata);
} else {
$ydata = $CompanyInfo->where("id= '{$keys[1]}'")->find();
$ydata = $CompanyInfo->where("id= '{$k}'")->find();
$company_info = json_decode($ydata['company_info'],true);
if($ydata['verify_status'] == 2){
$company_info['payee_name'] = $v['payee_name'];
$company_info['bank_account'] = $v['bank_account'];

@ -278,6 +278,20 @@ class CompanyStatementPoolController extends ThinkController
}else{
$pool_info["payment"] = '--';
}
//获取基本信息
$payedData = SM("company_statement_info","tab_")
->field("SUM(CASE WHEN verify_status = 2 THEN statement_money ELSE 0 END) as offline_amount,SUM(CASE WHEN verify_status != 2 THEN statement_money ELSE 0 END) as online_amount")
->where("pool_id = '{$id}'")->find();
// $payedData = SM("company_statement_info","tab_")
// ->field("*")
// ->where("pool_id = '{$id}' and verify_status = 2")->select();
//
// dump($payedData);die();
$this->assign("payed_data",$payedData);
// dump($pool_info);die();
$statement_num = $pool_info['statement_num'];
$this->assign("pool_data",$pool_info);
@ -312,11 +326,11 @@ class CompanyStatementPoolController extends ThinkController
$infolist = SM("company_statement_info","tab_")->field("*,'1' as st")->where("pool_id = '{$id}' and pay_status!=1")->select();
//获取母单
$pool_info = SM("company_statement_pool","tab_")->field('statement_num,create_lack_ids,verify_status,is_payment,withdraw_type,statement_begin_time,statement_end_time')->where("id={$id}")->find();
if(!empty($pool_info['create_lack_ids'])){
$l_ids = $pool_info['create_lack_ids'];
$lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
$infolist =array_merge($infolist,$lack_info);
}
// if(!empty($pool_info['create_lack_ids'])){
// $l_ids = $pool_info['create_lack_ids'];
// $lack_info = SM("company_lack_statement_info","tab_")->field("*,'0' as st")->where("id in ({$l_ids})")->select();
// $infolist =array_merge($infolist,$lack_info);
// }
// dump($infolist);die();

@ -0,0 +1,369 @@
<?php
// 游戏默认分成比例模板
namespace Admin\Controller;
class CompanySystemRatioController extends AdminController
{
private $api = "https://admin.wmtxkj.com/index.php?g=Api&m=CpJuheCompany&a=ratioIndex";
public function _initialize()
{
$this->admininfo = $_SESSION['onethink_admin']['user_auth'];
parent::_initialize();
}
//比例类型 0-内团 1-外团 2-分发联盟 3上游游戏 4聚合比例
private $checkRatio = [0,1,2,3,4];
public function index()
{
$params = I('get.');
$page = $params['p'] ? intval($params['p']) : 1;
$row = $params['row'] ? intval($params['row']) : 10;
//权限分配
if(!IS_ROOT){
$this->OpAuthList= getModuleControllerAuth();
}
$map = [];
$data = M("game_ratio_mould","tab_")->where($map)->select();
$handleData=[];
$handleData = $this->getAggregateData();
foreach ($data as $key => $value) {
$handleData[$value['relation_game_id']][$value['company_belong']][] = ['turnover'=>"0.00",'ratio'=>$value['ratio'],'instanceof'=>1];
$handleData[$value['relation_game_id']][$value['company_belong']]=array_merge($handleData[$value['relation_game_id']][$value['company_belong']],json_decode($value['turnover_ratio'],true)??[]);
}
$handleData = $this->getCpGameRatio($handleData);
$data = $this->handleRatio($handleData);
$checkData = $handleData;
// dump($data);die();
$gameData = M("game","tab_")->field("original_package_name,relation_game_name game_name,game_type_name,relation_game_id game_id")
->where($map)
->group("original_package_name")
->select();
$gameOriginData = M("game","tab_")->field("original_package_name,relation_game_name game_name,relation_game_id")->where($map)->group("relation_game_id")->select();
//类型区分
$handleGameData = [];
foreach ($gameData as $key => $value) {
if ($value['game_type_name']) {
$handleGameData[$value['game_type_name']][] = $value;
}
}
//游戏原包名区分
$handleOriginData = [];
foreach ($gameOriginData as $key => $value) {
if ($value['original_package_name']) {
$handleOriginData[$value['original_package_name']][] = $value;
}
}
//将比例打进游戏中
foreach ($handleOriginData as $key => $value) {
foreach ($value as $k => $v) {
$handleOriginData[$key][$k]['ratio_data'] = $data[$v['relation_game_id']];
}
}
//处理数据
$data = [];
foreach ($handleGameData as $key => $value) {
$handleData = [];
foreach ($value as $k => $v) {
// unset($handleGameData[$key][$k]['original_package_name']);
$handleGameData[$key][$k]['game_data'] = $handleOriginData[$v['original_package_name']];
}
$handleData['game_type'] = $key;
$handleData['data'] = $handleGameData[$key];
$data[] = $handleData;
}
// dump($data);die();
foreach ($data as $key => $value) {
foreach ($value['data'] as $k => $v) {
if (!$v['game_data']) {
$data[$key]['data'][$k]['row'] = 1;
$data[$key]['row'] += 1;
}
foreach ($v['game_data'] as $vk => $vv) {
$data[$key]['data'][$k]['game_data'][$vk]['row'] = $vv['ratio_data']?count($vv['ratio_data']):1;
$data[$key]['data'][$k]['row'] += $vv['ratio_data']?count($vv['ratio_data']):1;
$data[$key]['row'] += $vv['ratio_data']?count($vv['ratio_data']):1;
// if (!$vv['ratio_data']) {
// $data[$key]['data'][$k]['game_data'][$vk]['row']=1;
// }
foreach($vv['ratio_data'] as $vvk=>$vvv) {
if (count($data[$key]['data'][$k]['game_data'][$vk]['ratio_data']) == 1) {
$data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk]['turnover'] = '无阶梯';
break;
} else {
if ($vvv['is_equal'] != 1) {
if (($data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk+1]['turnover'] == $vvv['turnover'] && !$data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk+2]['turnover'])
||!($data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk+1]['turnover'])) {
$end = '∞';
} elseif($data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk+1]['turnover'] == $vvv['turnover'] && $data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk+2]['turnover']) {
$end = floatval($data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk+2]['turnover']);
} else {
$end = floatval($data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk+1]['turnover']);
}
$data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk]['turnover']
= floatval($vvv['turnover']).($vvv['instanceof']==1?'<=':'<').'月流水'.
('<').
($end);
} else {
if ($vvv['instanceof'] != 1) {
foreach ($this->checkRatio as $ck => $cv) {
// if($v['game_id'] == 187) {
//
// dump($checkData[$v['game_id']][$cv]);
// dump($vvv);
// }
foreach ($checkData[$v['game_id']][$cv] as $gk=> $gv){
// if($cv == 2){
// dump($gv);
// dump($vvv['turnover']);
// die();
if($gv['turnover'] < $vvv['turnover']) {
$checkInstanceof = array_column($checkData[$v['game_id']][$cv],'instanceof');
// if($v['game_id'] == 187 && $cv == 2) {
// dump($checkData[$v['game_id']][$cv]);
// dump($vvv['turnover']);
// dump(in_array(3,$checkInstanceof));
// }
// in_array($checkInstanceof,2);
// die();
if (in_array(2,$checkInstanceof)) {
$data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk][$cv] = $gv['ratio'];
}
} else {
break;
}
// }
}
}
}
$data[$key]['data'][$k]['game_data'][$vk]['ratio_data'][$vvk]['turnover']=
'月流水='.$vvv['turnover'];
}
}
}
}
}
}
// die();
if ($_REQUEST['export']) {
$this->assign("is_export",true);
$this->assign("data",$data);
$time = date("Y-m-d",time());
$this->assign('title',"海南万盟天下产品分成比例体系[{$time}]");
$this->display("export");die();
}
$count = count($data);
$page = set_pagination($count, $row,$params);
if($page) {
$this->assign('_page', $page);
}
$size = $row;//每页显示的记录数
$data = array_slice($data, (($params['p']??1) - 1) * $size, $size);
// dump($data);die();
$this->assign("data",$data);
$this->display();
}
//获取上游游戏比例
function getCpGameRatio($handleData = []) {
$cpGameData = M('cp_game_ratio', 'tab_')->where(['is_del'=>"0"])->order('id asc')->select();
foreach ($cpGameData as $key => $value) {
$cpRatio['turnover'] = $value['begin_total_amount'];
$cpRatio['instanceof'] = $value['instanceof'];
$cpRatio['ratio'] = $value['ratio'];
$handleData[$value['game_id']][3][] =$cpRatio;
}
return $handleData;
}
//将比例整合
function handleRatio($handleData = []) {
$finalData = [];
// dump($handleData);die();
foreach ($handleData as $key => $value) {
foreach ($value as $vk => $vv) {
foreach ($vv as $k => $v) {
if ($finalData[$key][$v['turnover']]) {
$finalData[$key][$v['turnover']][$vk] = $v["ratio"];
// if($v["instanceof"] != 0 && ($vk==0||$vk==1||$vk==2) && $handleData[$key][$vk][$k-1]["ratio"]) {
// $finalData[$key][$v['turnover']][$vk] = $handleData[$key][$vk][$k-1]["ratio"];
// }
//判断是否有相同值且一个是>=另一个是>的情况
if ($finalData[$key][$v['turnover']]["instanceof"] != $v["instanceof"]) {
$finalData[$key][$v['turnover']]["instanceof"] = 0;
$finalData[$key][$v['turnover']."ed"] = $finalData[$key][$v['turnover']];
$finalData[$key][$v['turnover']."ed"]['is_equal'] = 1;
}
continue;
}
$v['is_equal'] = 0;
$v[$vk] = $v["ratio"];
unset($v["ratio"]);
$finalData[$key][$v['turnover']] = $v;
}
}
}
foreach ($finalData as $key => $value) {
$last_names = array_column($finalData[$key],'turnover');
array_multisort($last_names,SORT_ASC,$finalData[$key]);
}
// dump($finalData);die();
$data = [];
foreach ($finalData as $key => $value) {
foreach ($value as $k => $v) {
foreach ($this->checkRatio as $ck=>$cv) {
if ($k == "0.00" && !$finalData[$key][$k][$cv]) {
$finalData[$key][$k][$cv] = "0.00";
}
if ($k != "0.00" && !$finalData[$key][$k][$cv]) {
//查找上一个比例
$finalData[$key][$k][$cv] = $data[$key][count($data[$key])-1][$cv];
}
}
// dump($finalData[$key]);
$data[$key][] = $finalData[$key][$k];
}
}
// dump($data);die();
// foreach ($data as $key => $value) {
//
// $last_names = array_column($data[$key],'turnover');
// array_multisort($last_names,SORT_ASC,$data[$key]);
//
// }
// dump($data);
return $data;
}
function getAggregateData() {
$request = [];
$request['remote'] = 1;
$aggregateData = json_decode(curl_post($this->api,$request),true);
// dump($aggregateData);
$gameData = M("game","tab_")
->field("unique_code,relation_game_id game_id")
->where('unique_code is not null or unique_code!=""')
->group("unique_code")
->select();
// dump($gameData);
$gameUniqueData = [];
foreach ($gameData as $key => $value ) {
$gameUniqueData[$value['unique_code']] = $value['game_id'];
}
$handleAggregateData = [];
foreach ($aggregateData as $key => $value) {
if ($value['unique_code']) {
$explodeData = explode('|',$value['exploitation_rate']);
$explodeDefauleData = explode('|',$value['default_exploitation_rate']);
$temporaryNum = 100;
$temporaryData = [];
foreach ($explodeDefauleData as $k => $v) {
// dump($v);
if ($v<$temporaryNum && $v>0) {
$temporaryData = [];
$temporaryNum = $v;
$temporaryData[] = ['turnover'=>'0.00','instanceof'=>1,'ratio'=>number_format(100.00-$v,2,'.','')];
$defauleData = json_decode($explodeData[$k],true);
foreach ($defauleData as $ek => $ev) {
$temporaryData[] = ['turnover'=>number_format($ev['money'],2,'.',''),'instanceof'=>$ev['symbol'],'ratio'=>number_format(100.00-$ev['rate'],2,'.','')];
}
// dump($temporaryData);
}
}
if($temporaryData) {
$handleAggregateData[$gameUniqueData[$value['unique_code']]][4] = $temporaryData;
}
}
}
return $handleAggregateData;
}
}

@ -4,6 +4,7 @@ namespace Admin\Controller;
use Think\Controller;
use GuzzleHttp\Client;
use Admin\Model\PromoteModel;
use Base\Repository\UserRepository;
use Base\Tool\AggregateClient;
class ExportController extends Controller
@ -4193,8 +4194,10 @@ class ExportController extends Controller
}
$gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name'];
$promoteName = '全部';
$promote = null;
if ($promoteId) {
$promoteName = get_promote_account($promoteId);
$promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
$promoteName = $promote['account'];
}
$data = $result['data']['records'];
$dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30];
@ -4210,6 +4213,18 @@ class ExportController extends Controller
}
$data[$key] = $item;
}
$repository = new UserRepository();
$deviceKey = 0;
if ($deviceType) {
$deviceKey = $deviceType == 'android' ? 1 : 2;
}
$otherResult = $repository->getUserRetention($baseGameId, [$start, $end], $deviceKey, $promote, [60, 90]);
foreach ($data as $key => $item) {
$otherItem = $otherResult[$item['date']];
$data[$key]['retention_day60'] = $otherItem['retention_rate'][60];
$data[$key]['retention_day90'] = $otherItem['retention_rate'][90];
}
} else {
$this->error($error);
}
@ -4582,14 +4597,12 @@ class ExportController extends Controller
array('total_amt','充值金额'),
array('user_count','活跃用户'),
array('ltv_1','LTV1'),
array('ltv_2','LTV2'),
array('ltv_3','LTV3'),
array('ltv_4','LTV4'),
array('ltv_5','LTV5'),
array('ltv_6','LTV6'),
array('ltv_7','LTV7'),
array('ltv_14','LTV14'),
array('ltv_30','LTV30'),
array('ltv_60','LTV60'),
array('ltv_90','LTV90'),
array('ltv_180','LTV180'),
);
$start_time = $start = strtotime($start);
@ -4635,18 +4648,16 @@ class ExportController extends Controller
$result = [];
foreach ($users as $index => $item) {
$ltv_start = strtotime($item['reg_date']);
$ltv_end = strtotime($item['reg_date']) + 30 * 86400;
$ltv_end = strtotime($item['reg_date']) + 180 * 86400;
$ltv = M()->query("
SELECT
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 1).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_1,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 2).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_2,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 3).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_3,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 4).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_4,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 5).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_5,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 6).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_6,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 7).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_7,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 14).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_14,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_30,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 60).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_60,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 90).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_90,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 180).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_180,
SUM(if (pay_time BETWEEN {$start_time} and ".($end_time).", pay_amount, 0)) as total_amt
FROM
tab_spend
@ -4661,14 +4672,12 @@ class ExportController extends Controller
'total_amt'=>$ltv[0]['total_amt'] ?: 0,
'user_count'=>$item['total_count'] ?: 0,
'ltv_1'=>$ltv[0]['ltv_1'] ?: 0,
'ltv_2'=>$ltv[0]['ltv_2'] ?: 0,
'ltv_3'=>$ltv[0]['ltv_3'] ?: 0,
'ltv_4'=>$ltv[0]['ltv_4'] ?: 0,
'ltv_5'=>$ltv[0]['ltv_5'] ?: 0,
'ltv_6'=>$ltv[0]['ltv_6'] ?: 0,
'ltv_7'=>$ltv[0]['ltv_7'] ?: 0,
'ltv_7'=>$ltv[0]['ltv_7'] ?: 0,
'ltv_14'=>$ltv[0]['ltv_14'] ?: 0,
'ltv_30'=>$ltv[0]['ltv_30'] ?: 0
'ltv_30'=>$ltv[0]['ltv_30'] ?: 0,
'ltv_60'=>$ltv[0]['ltv_60'] ?: 0,
'ltv_90'=>$ltv[0]['ltv_90'] ?: 0,
'ltv_180'=>$ltv[0]['ltv_180'] ?: 0,
];
unset($user[$index]);
}
@ -4683,15 +4692,13 @@ class ExportController extends Controller
'date'=>date("Y-m-d", $i),
'total_amt'=> 0,
'user_count'=> 0,
'ltv_1'=> 0,
'ltv_2'=> 0,
'ltv_3'=> 0,
'ltv_4'=> 0,
'ltv_5'=> 0,
'ltv_6'=> 0,
'ltv_7'=> 0,
'ltv_1'=> 0,
'ltv_7'=> 0,
'ltv_14'=> 0,
'ltv_30'=> 0
'ltv_30'=> 0,
'ltv_60'=> 0,
'ltv_90'=> 0,
'ltv_180'=> 0,
];
}
}

@ -355,6 +355,11 @@ class GameController extends ThinkController
if ($invalid || $inv == '') {
$this->error('关联数据错误');
}
if ($_GET['type'] != 2) {
$this->assign('show_status', 1);
}
$suffix = $inv['sdk_version'] == 1 ? "PGB" : "AZB";
$inv['short'] = substr($inv['short'], 0, -3) . $suffix;
$this->assign('data', $inv);

@ -1,8 +1,11 @@
<?php
namespace Admin\Controller;
use Base\Service\MendService;
use User\Api\UserApi as UserApi;
use Base\Service\PromoteService as PromoteService;
use Think\Model;
/**
* 后台首页控制器
@ -69,7 +72,7 @@ class MendController extends ThinkController {
//为数据权限添加
setPowerPromoteIds($map);
$data = M("Mend","tab_")
->field("user_account,promote_account,pay_amount,promote_account_to,order_time,create_time,op_account,remark")
->field("user_account,promote_account,pay_amount,promote_account_to,order_time,create_time,op_account,remark,status")
->where($map)
->order("create_time desc");
@ -79,6 +82,7 @@ class MendController extends ThinkController {
$data = $data->page($page, $row)->select();
}
//格式化信息
$mendService = new MendService();
foreach ($data as $key => $value) {
($data[$key]['promote_account']=='官方渠道')?($data[$key]['promote_account']=C('OFFICIEL_CHANNEL')):'';
@ -88,9 +92,10 @@ class MendController extends ThinkController {
if(!$show_data_power){
$data[$key]['user_account'] = encryptStr($data[$key]['user_account']);
}
$data[$key]['status'] = $mendService->getStatusText($value['status']);
}
if($export) db2csv($data,"推广员管理_推广补链_补链记录",["玩家账号","补链前渠道","补链前归属金额","补链后渠道","切分时间","补链时间","操作人员","备注"]);
if($export) db2csv($data,"推广员管理_推广补链_补链记录",["玩家账号","补链前渠道","补链前归属金额","补链后渠道","切分时间","补链时间","操作人员","备注","处理状态"]);
if(IS_POST){
$page = set_pagination($_REQUEST['row_count'],$row);
@ -112,73 +117,31 @@ class MendController extends ThinkController {
$this->assign('show_data_power', $show_data_power);
$this->display();
// parent::lists("Mend",$p,$map);
}
public function edit($id = null)
{
if (IS_POST) {
$promoteService = new PromoteService();
if ($_POST['prmoote_id_to'] == -1){
$_POST['prmoote_id_to'] = 0;
}
if ($_POST['prmoote_id_to'] === ''){
$this->error('请选择需要变更的渠道');
}
if ($_POST['promote_id'] == $_POST['prmoote_id_to']) {
$this->error('没有变更数据');
}
if ($_POST['order_time'] == '') {
$this->error('没有订单日期');
}
//判断是否已经结算
// if(self::checkSettlement(strtotime($_POST['order_time']),$_POST['promote_id'])){
// $this->error('在订单日期内含有已经结算的订单,无法补链');
// }
// if(self::checkSpend(strtotime($_POST['order_time']),$_POST['account'])){
// $this->error("在订单日期内含有已经结算的订单,无法补链。");
// }
if(self::checkOrderTime(strtotime($_POST['order_time']))){
$this->error('仅能补链本周数据,请重新选择补链时间');
}
if(self::checkPromote(strtotime($_POST['order_time']),$_POST['account'])){
$this->error('在订单日期内含有多个推广员,无法补链');
}
$create = $_REQUEST;
$create['order_time'] = date($create['order_time']);
$params = array(
"from_promote_id"=>$create['promote_id'],
"to_promote_id"=>$create['prmoote_id_to'],
"order_time"=>$create['order_time'],
"type"=>2,
"shift_ids"=>[$create['user_id']],
"creator_type"=>0,
"creator_id"=>$_SESSION["onethink_admin"]["user_auth"]["uid"]
);
if(!empty($create['remark'])){
$params['remark'] = $create['remark'];
}
// dump($create);die();
$res = $promoteService->addShiftTask($params);
if($res['status']){
$userData = M('user','tab_')->field('account')->where(['id'=>$create['user_id']])->find();
$promoteToData = M('promote','tab_')->field('account')->where(['id'=>$create['prmoote_id_to']])->find();
$promoteFromData = M('promote','tab_')->field('account')->where(['id'=>$create['promote_id']])->find();
if ($create['promote_id'] == '0') {
$promoteFromData['account'] = '官方渠道';
}
addOperationLog(['op_type'=>1,'key'=>$userData['account'].'/'.$promoteFromData['account'].'/'.$promoteToData['account'],'op_name'=>'编辑推广补链','url'=>U('Mend/edit',['id'=>$create['user_id']]),'menu'=>'推广员-推广员管理-推广补链-编辑推广补链']);
$params = I('post.');
$service = new MendService();
try {
$service->addMendTask($params);
$userData = M('user','tab_')->field(['account', 'promote_id', 'promote_account'])->where(['id' => $params['user_id']])->find();
$promoteToData = M('promote','tab_')->field('account')->where(['id'=> $params['prmoote_id_to']])->find();
addOperationLog([
'op_type' => 1,
'key' => $userData['account'].'/'.$userData['promote_account'].'/'.$promoteToData['account'],
'op_name' => '编辑推广补链',
'url' => U('Mend/edit', ['id' => $userData['id']]),
'menu' => '推广员-推广员管理-推广补链-编辑推广补链'
]);
$this->success('补链成功', U('lists'), 2);
}else{
$this->error($res['msg']);
} catch (\Exception $e) {
$this->error($e->getMessage());
}
} else {
// echo 1;die();
@ -300,17 +263,11 @@ class MendController extends ThinkController {
public function shiftInfo()
{
$id = I('id');
$info = M("shift_task")->where("id = {$id} and status = 0")->find();
if(empty($info)){
$info = M("mend", 'tab_')->where("id = {$id} and status = 0")->find();
if(empty($mend)){
$this->error("补链不存在或已处理");
}
$info['user_id'] = json_decode($info['shift_ids'])[0];
$info['order_time'] = date("Y-m-d",$info['order_time']);
$userid = $info['user_id'];
$info['account'] = M("User","tab_")->field("account")->where("id = '{$userid}'")->find()['account'];
$this->assign('data',$info);
$this->display();
}
@ -318,11 +275,16 @@ class MendController extends ThinkController {
public function cancelShift()
{
$id = I('id');
$status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]);
if ($status) {
addOperationLog(['op_type'=>1,'key'=>$id,'op_name'=>'取消补链','url'=>U('Mend/shiftInfo',['id'=>$id]),'menu'=>'推广员-推广员管理-推广补链-取消补链']);
$model = new Model();
$model->startTrans();
$status1 = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]);
$status2 = M('mend', 'tab_')->where(['task_id' => $id, 'status' => 0])->save(['status' => 2, 'update_time' => time()]);
if ($status1 && $status2) {
$model->commit();
addOperationLog(['op_type'=>1,'key'=>$id,'op_name'=>'取消补链','url'=>U('Mend/shiftInfo',['id'=>$id]),'menu'=>'推广员-推广员管理-推广补链-取消补链']);
$this->ajaxReturn(array("status"=>1,"url"=> U('lists')));
} else {
$this->ajaxReturn(array("status"=>0,"url"=> U('lists')));

@ -110,7 +110,21 @@ class PromoteCompanyController extends ThinkController
// $where["_string"] = "begin_time <= {$time_end}";
// }
// dd($map);
if (I('ali_user', 0)) {
$map['ali_user'] = I('ali_user');
}
if (I('ali_account', 0)) {
$map['ali_account'] = I('ali_account');
}
if (I('bank_address', 0)) {
$map['bank_address'] = I('bank_address');
}
if (I('settlement_contact', 0)) {
$map['settlement_contact'] = I('settlement_contact');
}
if (I('contact_phone', 0)) {
$map['contact_phone'] = I('contact_phone');
}
$page = intval(I('get.p', 0));
$page = $page ? $page : 1; //默认显示第一页数据

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

@ -71,6 +71,9 @@ class SocietyInfoController extends ThinkController
$map['communication_time'] = array('elt', time() - $gap * 86400);
}
if (I('sociaty_level') && I('sociaty_level') != '0') $map['sociaty_level'] = I('sociaty_level');
if (I('num')) {
$map['id'] = substr(I('num'), 8);
}
//获取分页数据
$query = $model->where($map)->order("communication_time desc");
@ -122,7 +125,7 @@ class SocietyInfoController extends ThinkController
return ;
} else {
$societyInfos = $order_query->page($page,$row)->field("*")->select();
// dump($societyInfos);die();
// dump($order_query->_sql());die();
}
//分页
@ -136,7 +139,7 @@ class SocietyInfoController extends ThinkController
foreach ($societyInfos as $k => &$v) {
$v['num'] = $k+1+intval((I('get.p', 0)?I('get.p', 0):1)-1)*$row;
$v['num'] = date('Ymd', $v['create_time']).$v['id'];
$v['sociaty_level_str'] = $this->level[$v['sociaty_level']];
if (time() - $v['communication_time'] > $gap * 86400

@ -4,6 +4,7 @@ namespace Admin\Controller;
use Admin\Model\SpendModel;
use Open\Model\UserLoginRecordModel;
use Admin\Model\UserPlayModel;
use Base\Repository\UserRepository;
use User\Api\UserApi as UserApi;
use GuzzleHttp\Client;
@ -208,8 +209,10 @@ class StatController extends ThinkController
$dayList = [1, 2, 3, 4, 5, 6, 7, 15, 30];
$gameName = $deviceType ? get_game_name($searchGameId) : $baseGame['name'];
$promoteName = '全部';
$promote = null;
if ($promoteId) {
$promoteName = get_promote_account($promoteId);
$promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
$promoteName = $promote['account'];
}
foreach ($data as $key => $item) {
$item['promote_name'] = $promoteName;
@ -223,6 +226,18 @@ class StatController extends ThinkController
}
$data[$key] = $item;
}
$repository = new UserRepository();
$deviceKey = 0;
if ($deviceType) {
$deviceKey = $deviceType == 'android' ? 1 : 2;
}
$otherResult = $repository->getUserRetention($baseGameId, [$start, $end], $deviceKey, $promote, [60, 90]);
foreach ($data as $key => $item) {
$otherItem = $otherResult[$item['date']];
$data[$key]['retention_day60'] = $otherItem['retention_rate'][60];
$data[$key]['retention_day90'] = $otherItem['retention_rate'][90];
}
if ($dataOrder) {
$data = $this->multisort($data, $orderColumn, $orderType);
}

@ -1068,18 +1068,16 @@ class StatisticsController extends ThinkController {
$result = [];
foreach ($users as $index => $item) {
$ltv_start = strtotime($item['reg_date']);
$ltv_end = strtotime($item['reg_date']) + 30 * 86400;
$ltv_end = strtotime($item['reg_date']) + 180 * 86400;
$ltv = M()->query("
SELECT
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 1).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_1,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 2).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_2,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 3).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_3,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 4).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_4,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 5).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_5,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 6).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_6,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 7).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_7,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 14).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_14,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_30,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 60).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_60,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 90).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_90,
ROUND(SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 180).", pay_amount, 0))/{$item['total_count']}, 2) as ltv_180,
SUM(if (pay_time BETWEEN {$ltv_start} and ".($ltv_start+86400 * 30).", pay_amount, 0)) as total_amt
FROM
tab_spend
@ -1094,14 +1092,12 @@ class StatisticsController extends ThinkController {
'total_amt'=>$ltv[0]['total_amt'] ?: 0,
'user_count'=>$item['total_count'] ?: 0,
'ltv_1'=>$ltv[0]['ltv_1'] ?: 0,
'ltv_2'=>$ltv[0]['ltv_2'] ?: 0,
'ltv_3'=>$ltv[0]['ltv_3'] ?: 0,
'ltv_4'=>$ltv[0]['ltv_4'] ?: 0,
'ltv_5'=>$ltv[0]['ltv_5'] ?: 0,
'ltv_6'=>$ltv[0]['ltv_6'] ?: 0,
'ltv_7'=>$ltv[0]['ltv_7'] ?: 0,
'ltv_14'=>$ltv[0]['ltv_14'] ?: 0,
'ltv_30'=>$ltv[0]['ltv_30'] ?: 0
'ltv_30'=>$ltv[0]['ltv_30'] ?: 0,
'ltv_60'=>$ltv[0]['ltv_60'] ?: 0,
'ltv_90'=>$ltv[0]['ltv_90'] ?: 0,
'ltv_180'=>$ltv[0]['ltv_180'] ?: 0,
];
unset($user[$index]);
}
@ -1117,14 +1113,12 @@ class StatisticsController extends ThinkController {
'total_amt'=> 0,
'user_count'=> 0,
'ltv_1'=> 0,
'ltv_2'=> 0,
'ltv_3'=> 0,
'ltv_4'=> 0,
'ltv_5'=> 0,
'ltv_6'=> 0,
'ltv_7'=> 0,
'ltv_14'=> 0,
'ltv_30'=> 0
'ltv_30'=> 0,
'ltv_60'=> 0,
'ltv_90'=> 0,
'ltv_180'=> 0,
];
}
}

@ -293,7 +293,7 @@ class UserController extends AdminController
$moblieUser = SM('UcenterMember', 'sys_')->field('id')->where(['mobile' => $_POST['mobile']])->find();
if (!empty($moblieUser)) {
if (!empty($moblieUser)&&$_POST['mobile']) {
$this->error('手机号码已存在!');
}

@ -300,7 +300,9 @@
</tr>
</if>
<tr>
<td colspan=40 >线下打款:{$payed_data.offline_amount}&nbsp&nbsp&nbsp&nbsp线上打款{$payed_data.online_amount}</td>
</tr>
</tbody>

@ -288,6 +288,9 @@
</tr>
</if>
<tr>
<td colspan=40 >线下打款:{$payed_data.offline_amount}&nbsp&nbsp&nbsp&nbsp线上打款{$payed_data.online_amount}</td>
</tr>
</tbody>
</table>
</div>

@ -424,6 +424,10 @@
</tr> -->
</if>
<tr>
<td colspan=40 >线下打款:{$payed_data.offline_amount}&nbsp&nbsp&nbsp&nbsp线上打款{$payed_data.online_amount}</td>
</tr>
</tbody>
</table>

@ -0,0 +1,274 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="__CSS__/base.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/common.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css" media="all">
<link rel="stylesheet" type="text/css" href="__CSS__/default_color.css" media="all">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__STATIC__/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"charset="UTF-8"></script>
<script src="__STATIC__/juicer-min.js" type="text/javascript"></script>
<script src="__STATIC__/table2excel.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px 10px 150px 10px;
/* width: 960px; */
margin: auto;
}
/* .tabcon1711 table{
width: 480px;
} */
table{
margin: auto;
}
tr{
border-bottom: dotted 1px #c7c7c7;
}
.hidebox{
display: none;
}
.r{
width: 300px;
}
.l{
width: 180px;
}
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;
height: 35px;
height: 28px;
border-radius: 3px;
font-size: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 35px;
line-height: 28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height: 26px;
line-height: 26px;
font-size: 12px;
}
.select2-results__option[aria-selected] {
font-size: 12px;
}
.input-list, .i_list {
float: left;
margin: 0;
}
#statementShow td{
line-height: 1.5;
padding: 8px 0;
}
</style>
<body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
海南万盟天下科技有限公司
</div> -->
<div class="data_list box_mt" style="margin-top: 10px;">
<div class="">
<table id="exporttable" <if condition="$is_export">style="display:none"</if>>
<!-- 表头 -->
<thead>
<tr>
<th>产品类型</th>
<th>原包名</th>
<th>现包名</th>
<th>比例等级标准</th>
<th>cp合作方</th>
<th>下游内团</th>
<th>下游外团</th>
<th>下游外团分发</th>
<th>聚合方</th>
</tr>
</thead>
<tbody id="statementShow">
<if condition = "empty($data)">
<tr>
<td colspan="50" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<foreach name="data" item="data" key="akey">
<tr>
<td rowspan="{$data['row']}">{$data['game_type']|default='无'}</td>
<td rowspan="{$data['data'][0]['row']}">{$data['data'][0]['original_package_name']|default='无'}</td>
<td rowspan="{$data['data'][0]['game_data'][0]['row']|default=1}">{$data['data'][0]['game_data'][0]['game_name']|default='无'}</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0]['turnover']|default='无阶梯'}</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][3]|default='0.00'}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][0]|default='0.00'}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][1]|default='0.00'}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][2]|default='0.00'}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][4]|default='0.00'}%</td>
</tr>
<foreach name="data['data'][0]['game_data'][0]['ratio_data']" item="ratio_data" key="rkey">
<if condition="$rkey gt 0">
<tr>
<td>{$ratio_data['turnover']|default='无阶梯'}</td>
<td>{$ratio_data[3]|default='0.00'}%</td>
<td>{$ratio_data[0]|default='0.00'}%</td>
<td>{$ratio_data[1]|default='0.00'}%</td>
<td>{$ratio_data[2]|default='0.00'}%</td>
<td>{$ratio_data[4]|default='0.00'}%</td>
</tr>
</if>
</foreach>
<foreach name="data['data'][0]['game_data']" item="game_data" key="gkey">
<if condition="$gkey gt 0">
<tr>
<td rowspan="{$game_data['row']}">{$game_data['game_name']}</td>
</tr>
<foreach name="game_data['ratio_data']" item="game_data_other" key="okey">
<tr>
<td>{$game_data_other['turnover']|default='无阶梯'}</td>
<td>{$game_data_other['3']|default='0.00'}%</td>
<td>{$game_data_other['0']|default='0.00'}%</td>
<td>{$game_data_other['1']|default='0.00'}%</td>
<td>{$game_data_other['2']|default='0.00'}%</td>
<td>{$game_data_other['4']|default='0.00'}%</td>
</tr>
</foreach>
</if>
</foreach>
<foreach name="data['data']" item="sun_data" key="skey">
<if condition="$skey gt 0">
<tr>
<td rowspan="{$sun_data['row']}">{$sun_data['original_package_name']|default='无'}</td>
<td rowspan="{$sun_data['game_data'][0]['row']}">{$sun_data['game_data'][0]['game_name']|default='无'}</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['turnover']|default='无阶梯'}</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['3']|default='0.00'}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['0']|default='0.00'}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['1']|default='0.00'}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['2']|default='0.00'}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['4']|default='0.00'}%</td>
</tr>
<foreach name="sun_data['game_data'][0]['ratio_data']" item="game_datas" key="gkey">
<if condition="$gkey gt 0">
<tr>
<td>{$game_datas['turnover']|default='无阶梯'}</td>
<td>{$game_datas['3']|default='0.00'}%</td>
<td>{$game_datas['0']|default='0.00'}%</td>
<td>{$game_datas['1']|default='0.00'}%</td>
<td>{$game_datas['2']|default='0.00'}%</td>
<td>{$game_datas['4']|default='0.00'}%</td>
</tr>
</if>
</foreach>
<foreach name="sun_data['game_data']" item="game_datas" key="gkey">
<if condition="$gkey gt 0">
<tr>
<td rowspan="{$game_datas['row']}">{$game_datas['game_name']|default='无'}</td>
<td >{$game_datas['ratio_data'][0]['turnover']|default='无阶梯'}</td>
<td >{$game_datas['ratio_data'][0][3]|default='0.00'}%</td>
<td >{$game_datas['ratio_data'][0][0]|default='0.00'}%</td>
<td >{$game_datas['ratio_data'][0][1]|default='0.00'}%</td>
<td >{$game_datas['ratio_data'][0][2]|default='0.00'}%</td>
<td >{$game_datas['ratio_data'][0][4]|default='0.00'}%</td>
</tr>
<volist name="game_datas['ratio_data']" id="game_data_others" key="otherskey">
<if condition="$otherskey-1 gt 0">
<tr>
<td>{$game_data_others['turnover']|default='无阶梯'}</td>
<td>{$game_data_others['3']|default='0.00'}%</td>
<td>{$game_data_others['0']|default='0.00'}%</td>
<td>{$game_data_others['1']|default='0.00'}%</td>
<td>{$game_data_others['2']|default='0.00'}%</td>
<td>{$game_data_others['4']|default='0.00'}%</td>
</tr>
</if>
</volist>
</if>
</foreach>
</if>
</foreach>
</foreach>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
{$_page|default=''}
</div>
</body>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
console.log(1);
<if condition="$is_export">
console.log(1);
$(function(){
$("#exporttable").table2excel({
filename: "{$title}.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
</if>
</script>
</block>

@ -0,0 +1,293 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link rel="stylesheet" href="__CSS__/pro_promote.css" type="text/css" />
<script src="__STATIC__/jquery.form.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script type="text/javascript" src="__STATIC__/layer3/layer.js"></script>
<script src="__STATIC__/table2excel.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.butnbox {padding:10px 0 10px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:28px;line-height:28px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
.layui-layer-title {
text-align: center;
height: 80px;
line-height: 80px;
font-weight: 600;
font-size: 18px;
}
.data_list table td{
line-height: 2;
}
.layui-layer-title {
text-align: center;
height: 42px;
line-height: 42px;
font-weight: 400;
font-size: 14px;
}
.tooltip {
position: relative;
/* display: block; */
/* color: #056dae; */
}
.tooltip .tooltiptext {
display: none;
width: 100%;
background-color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 10px 5px 5px;
position: absolute;
z-index: 1;
bottom: 80%;
left: 0;
border: #000 solid 1px;
line-height: 20px;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
color: #333;
display: block;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">海南万盟天下产品分成比例体系</h3>
<!-- <p class="description_text" id="order_url">仅当汇总单审批通过的单子才允许进行打款</p>-->
</div>
<body>
<!-- <div style="width: 100%;line-height: 100px;font-size: 25px;font-weight: 600;text-align: center;">
海南万盟天下科技有限公司
</div> -->
<div class="data_list box_mt" style="margin-top: 10px;">
<div class="">
<table id="exporttable" <if condition="$is_export">style="display:none"</if>>
<!-- 表头 -->
<thead>
<tr>
<th rowspan="2">产品类型</th>
<th rowspan="2">原包名</th>
<th rowspan="2">现包名</th>
<th rowspan="2">比例等级标准</th>
<th colspan="5">分成比例</th>
</tr>
<tr>
<th>cp合作方</th>
<th>下游内团</th>
<th>下游外团</th>
<th>下游外团分发</th>
<th>聚合方</th>
</tr>
</thead>
<tbody id="statementShow">
<if condition = "empty($data)">
<tr>
<td colspan="50" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<foreach name="data" item="data" key="akey">
<tr>
<td rowspan="{$data['row']}">{$data['game_type']|default='无'}</td>
<td rowspan="{$data['data'][0]['row']}">{$data['data'][0]['original_package_name']|default='无'}</td>
<td rowspan="{$data['data'][0]['game_data'][0]['row']|default=1}">{$data['data'][0]['game_data'][0]['game_name']|default='无'}</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0]['turnover']|default='无阶梯'}</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][3]|floatval}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][0]|floatval}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][1]|floatval}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][2]|floatval}%</td>
<td>{$data['data'][0]['game_data'][0]['ratio_data'][0][4]|floatval}%</td>
</tr>
<foreach name="data['data'][0]['game_data'][0]['ratio_data']" item="ratio_data" key="rkey">
<if condition="$rkey gt 0">
<tr>
<td>{$ratio_data['turnover']|default='无阶梯'}</td>
<td>{$ratio_data[3]|floatval}%</td>
<td>{$ratio_data[0]|floatval}%</td>
<td>{$ratio_data[1]|floatval}%</td>
<td>{$ratio_data[2]|floatval}%</td>
<td>{$ratio_data[4]|floatval}%</td>
</tr>
</if>
</foreach>
<foreach name="data['data'][0]['game_data']" item="game_data" key="gkey">
<if condition="$gkey gt 0">
<tr>
<td rowspan="{$game_data['row']}">{$game_data['game_name']}</td>
</tr>
<foreach name="game_data['ratio_data']" item="game_data_other" key="okey">
<tr>
<td>{$game_data_other['turnover']|default='无阶梯'}</td>
<td>{$game_data_other['3']|floatval}%</td>
<td>{$game_data_other['0']|floatval}%</td>
<td>{$game_data_other['1']|floatval}%</td>
<td>{$game_data_other['2']|floatval}%</td>
<td>{$game_data_other['4']|floatval}%</td>
</tr>
</foreach>
</if>
</foreach>
<foreach name="data['data']" item="sun_data" key="skey">
<if condition="$skey gt 0">
<tr>
<td rowspan="{$sun_data['row']}">{$sun_data['original_package_name']|default='无'}</td>
<td rowspan="{$sun_data['game_data'][0]['row']}">{$sun_data['game_data'][0]['game_name']|default='无'}</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['turnover']|default='无阶梯'}</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['3']|floatval}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['0']|floatval}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['1']|floatval}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['2']|floatval}%</td>
<td>{$sun_data['game_data'][0]['ratio_data'][0]['4']|floatval}%</td>
</tr>
<foreach name="sun_data['game_data'][0]['ratio_data']" item="game_datas" key="gkey">
<if condition="$gkey gt 0">
<tr>
<td>{$game_datas['turnover']|default='无阶梯'}</td>
<td>{$game_datas['3']|floatval}%</td>
<td>{$game_datas['0']|floatval}%</td>
<td>{$game_datas['1']|floatval}%</td>
<td>{$game_datas['2']|floatval}%</td>
<td>{$game_datas['4']|floatval}%</td>
</tr>
</if>
</foreach>
<foreach name="sun_data['game_data']" item="game_datas" key="gkey">
<if condition="$gkey gt 0">
<tr>
<td rowspan="{$game_datas['row']}">{$game_datas['game_name']|default='无'}</td>
<td >{$game_datas['ratio_data'][0]['turnover']|default='无阶梯'}</td>
<td >{$game_datas['ratio_data'][0][3]|floatval}%</td>
<td >{$game_datas['ratio_data'][0][0]|floatval}%</td>
<td >{$game_datas['ratio_data'][0][1]|floatval}%</td>
<td >{$game_datas['ratio_data'][0][2]|floatval}%</td>
<td >{$game_datas['ratio_data'][0][4]|floatval}%</td>
</tr>
<volist name="game_datas['ratio_data']" id="game_data_others" key="otherskey">
<if condition="$otherskey-1 gt 0">
<tr>
<td>{$game_data_others['turnover']|default='无阶梯'}</td>
<td>{$game_data_others['3']|floatval}%</td>
<td>{$game_data_others['0']|floatval}%</td>
<td>{$game_data_others['1']|floatval}%</td>
<td>{$game_data_others['2']|floatval}%</td>
<td>{$game_data_others['4']|floatval}%</td>
</tr>
</if>
</volist>
</if>
</foreach>
</if>
</foreach>
</foreach>
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
{$_page|default=''}
</div>
</body>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '
<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">
';
</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript">
</script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
</script>
<script type="text/javascript">
highlight_subnav("{:U('CompanySystemRatio/index')}");
<if condition="$is_export">
console.log(1);
$(function(){
$("#exporttable").table2excel({
filename: "{$title}.xls", // do include extension
preserveColors: false // set to true if you want background colors and font colors preserved
});
});
</if>
</script>
</block>
</html>

@ -39,10 +39,17 @@
<input type="hidden" name="game_appid" value="{:generate_game_appid()}">
</td>
</tr>
<tr>
<td class="l">游戏原包名称:</td>
<td class="r" >
<input type="text" class="txt " name="original_package_name" value="{$data['original_package_name']}" readonly = 'true' placeholder="请输入游戏原包名称">
</td>
</tr>
<tr>
<td class="l">游戏类型:</td>
<td class="r">
<select id="game_type_id" name="game_type_id" disabled="true" style="background:#e7e7e7">
<select id="game_type_id" name="game_type_id">
<volist name=":get_game_type_all()" id="vo">
<if condition="$vo[id] eq $data[game_type_id]">
<option value="{$vo.id}" selected>{$vo.type_name}</option>
@ -173,33 +180,56 @@
</td>
</tr>
<empty name='show_status'>
<tr>
<td class="l" >一句话简介:</td>
<td class="r" colspan="3">
<input type="text" class="txt " name="features" value="{$data['features']}" placeholder="输入一句话简介">
</td>
</tr>
<else/>
<tr>
<td class="l" >一句话简介:</td>
<td class="r" >
<input type="text" class="txt " name="features" value="{$data['features']}" placeholder="输入一句话简介">
</td>
</tr>
<tr>
<td class="l" >游戏开发商:</td>
<td class="r" >
<input type="text" class="txt " name="dev_name" value="{$data['dev_name']}" placeholder="输入开发商名称">
</td>
</tr>
</empty>
<tr>
<td class="l" >游戏简介:</td>
<td class="r" colspan="3">
<input type="text" class="txt " name="features" value="{$data['features']}" readonly = "readonly" style="background:#e7e7e7">
</td>
</tr>
<else/>
<tr>
<td class="l" >游戏简介:</td>
<td class="l" >合作方:</td>
<td class="r" >
<input type="text" class="txt " name="features" value="{$data['features']}" readonly = "readonly" style="background:#e7e7e7">
<select id="partner_id" name="partner_id">
<option value="">请选择合作方</option>
<volist name=":getPartnerList()" id="vo">
<option value="{$vo.id}"
<eq name="data.partner_id" value="$vo.id"> selected </eq>>{$vo.partner}
</option>
</volist>
</select>
</td>
</tr>
<tr>
<td class="l" >游戏开发商:</td>
<td class="r" >
<input type="text" class="txt " name="dev_name" value="{$data['dev_name']}" readonly = "readonly" style="background:#e7e7e7">
<td class="l">游戏简介</td>
<td class="r">
<textarea name="introduction" class="txt_area">{$data['introduction']}</textarea>
</td>
</tr>
</empty>
<tr>
<td class="l">详细介绍</td>
<td class="l">游戏资料中心</td>
<td class="r">
<textarea name="introduction" class="txt_area" readonly = "readonly" style="background:#e7e7e7"></textarea>
<textarea name="detail_content" class="txt_area">{$data['detail_content']}</textarea>
{:hook('adminArticleEdit', array('name'=>'detail_content','value'=>$field['value']))}
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo" >游戏图标</td>
<td class="r">
@ -264,6 +294,15 @@
<span class="notice-text">(尺寸210*350px)上传游戏的截图信息,此处截图在游戏详情页显示</span>
</td>
</tr>
<tr class="picbox">
<td class="l noticeinfo">落地页图片</td>
<td class="r">
{:hook('UploadImages', array('name'=>'flooring_page_imgs','value'=>$data['flooring_page_imgs']))}
<span class="notice-text">(尺寸210*350px)上传游戏的截图信息,此处截图在游戏详情页显示</span>
</td>
</tr>
</tbody>
</table>
</div>

@ -72,7 +72,7 @@
<tr>
<td class="l noticeinfo">补链后渠道</td>
<td class="r table_radio">
<select id="prmoote_id_to" name="prmoote_id_to" class="select_gallery">
<select id="promote_id_to" name="promote_id_to" class="select_gallery">
<option value="">下拉选择</option>
<option value="-1">{:C('OFFICIEL_CHANNEL')}</option>
<volist name=":get_promote_list()" id="vo">
@ -152,7 +152,7 @@ $(".select_gallery").select2();
//导航高亮
highlight_subnav('{:U('Mend/lists')}');
Think.setValue("prmoote_id_to", {$data.promote_id|default = "''"});
Think.setValue("promote_id_to", {$data.promote_id|default = "''"});
$('#submit').click(function(){
$('#form').submit();
});

@ -65,7 +65,9 @@
<empty name ="list_data">
<td colspan="9" class="text-center">aOh! 暂时还没有内容!</td>
<else />
<?php $mends = getShiftingMends(array_column($list_data, 'id'));?>
<volist name="list_data" id="data">
<?php $mend = $mends[$data['id']] ?? null; ?>
<tr>
<td>
<if condition="$show_data_power eq true ">
@ -96,12 +98,11 @@
</if></td>
<td>
<if condition="getIsTask($data['id']) eq 0 ">
<a style="width:100%;text-align:center" href="{:U('Mend/edit?id='.$data['id'])}">补链</a>
<else/>
<a style="width:100%;text-align:center;color: #f00;" href="{:U('Mend/shiftInfo?id='.getIsTask($data['id']))}">补链中</a>
</if>
<?php if (is_null($mend)):?>
<a style="width:100%;text-align:center" href="{:U('Mend/edit?id='.$data['id'])}">补链</a>
<?php else:?>
<a style="width:100%;text-align:center;color: #f00;" href="{:U('Mend/shiftInfo?id='.$mend['id'])}">补链中</a>
<?php endif;?>
</td>
</tr>
</volist>

@ -75,6 +75,7 @@
<th style="width:400px;">备注</th>
<th>切分时间</th>
<th>补链时间</th>
<th>处理状态</th>
<th>操作人员</th>
</tr>
</thead>
@ -115,6 +116,7 @@
</td>
<td>{$data.order_time}</td>
<td>{$data.create_time}</td>
<td>{$data.status}</td>
<td>{$data.op_account}</td>
</tr>
</volist>

@ -57,20 +57,20 @@
<tr>
<td class="l noticeinfo">用户账号</td>
<td class="r table_radio">
<input name="account" value="{$data['account']}" disabled readonly type="text" class="">
<input name="account" value="{$data['user_account']}" disabled readonly type="text" class="">
</td>
</tr>
<tr>
<td class="l noticeinfo">修改前渠道</td>
<td class="r table_radio">
<input name="old_promote_id" value="{:get_promote_name($data['from_promote_id'])}" disabled readonly type="text" class="">
<input name="old_promote_id" value="{$data['promote_account']}" disabled readonly type="text" class="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">补链后渠道</td>
<td class="r table_radio">
<input name="old_promote_id" value="{:get_promote_name($data['to_promote_id'])}" disabled readonly type="text" class="">
<input name="old_promote_id" value="{$data['promote_account_to']}" disabled readonly type="text" class="">
<span class="notice-text"></span>
</td>
</tr>
@ -102,7 +102,7 @@
<div class="form-item cf">
<button class="submit_btn mlspacing" id="submit" data-id="{$data.id}">
<button class="submit_btn mlspacing" id="submit" data-id="{$data.task_id}">
取消补链
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >

@ -348,6 +348,22 @@
</td>
</tr>
<?php endif;?>
<?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="shift_over_apply" class="withdraw_done" <if condition="$data['shift_over_apply'] eq 1">checked="checked"</if>> 开启
</label >
<label >
<input type="radio" value="0" name="shift_over_apply" class="withdraw_done" <if condition="$data['shift_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" >

@ -140,6 +140,21 @@
</div>
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="ali_user" class="search-input" value="{:I('ali_user')}" placeholder="请输入支付宝真实姓名">&nbsp;
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="ali_account" class="search-input" value="{:I('ali_account')}" placeholder="请输入支付宝登录账号">&nbsp;
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="bank_address" class="search-input" value="{:I('bank_address')}" placeholder="请输入账户名">&nbsp;
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="settlement_contact" class="search-input" value="{:I('settlement_contact')}" placeholder="请输入联系结算人">&nbsp;
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="contact_phone" class="search-input" value="{:I('contact_phone')}" placeholder="请输入联系电话">&nbsp;
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('PromoteCompany/lists','model='.$model['name'].'&row='.I('row'),false)}">搜索</a>

@ -88,6 +88,9 @@
<div class="input-list">
<input type="text" name="text" style="width: 200px" class="" placeholder="快速搜索" value="{:I('text')}"/>&nbsp;
</div>
<div class="input-list">
<input type="text" name="num" style="width: 200px" class="" placeholder="序号" value="{:I('num')}"/>&nbsp;
</div>
<input type="hidden" name="sortBy" value="" class="sortBy">

@ -108,13 +108,17 @@
<th ><a class="paixu" data-order='retention_day15'>15日留存 <?=$order_column=='retention_day15'?($order_type=='desc'?'▼':'▲'):$noOrder?></a></th>
<th ><a class="paixu" data-order='retention_day30'>30日留存 <?=$order_column=='retention_day30'?($order_type=='desc'?'▼':'▲'):$noOrder?></a></th>
<th ><a class="paixu" data-order='retention_day60'>60日留存 <?=$order_column=='retention_day60'?($order_type=='desc'?'▼':'▲'):$noOrder?></a></th>
<th ><a class="paixu" data-order='retention_day90'>90日留存 <?=$order_column=='retention_day90'?($order_type=='desc'?'▼':'▲'):$noOrder?></a></th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name="data" >
<tr>
<td colspan="13" class="text-center"><?= $error ? '<span style="color: #ff0000;">' . $error . '</span>': 'aOh! 暂时还没有内容!' ?></td>
<td colspan="15" class="text-center"><?= $error ? '<span style="color: #ff0000;">' . $error . '</span>': 'aOh! 暂时还没有内容!' ?></td>
</tr>
<else />
<volist name="data" id="vo">
@ -135,6 +139,8 @@
<td>{$vo['retention_day7']}%</td>
<td>{$vo['retention_day15']}%</td>
<td>{$vo['retention_day30']}%</td>
<td>{$vo['retention_day60']}%</td>
<td>{$vo['retention_day90']}%</td>
<?php else:?>
<td>--</td>
<td>--</td>
@ -145,6 +151,8 @@
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<td>--</td>
<?php endif;?>
</tr>
</volist>

@ -86,20 +86,18 @@
<th>充值金额</th>
<th>活跃用户</th>
<th>LTV1</th>
<th>LTV2</th>
<th>LTV3</th>
<th>LTV4</th>
<th>LTV5</th>
<th>LTV6</th>
<th>LTV7</th>
<th>LTV14</th>
<th>LTV30</th>
<th>LTV60</th>
<th>LTV90</th>
<th>LTV180</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name ="data">
<tr><td colspan="12" class="text-center">aOh! 暂时还没有内容!</td></tr>
<tr><td colspan="10" class="text-center">aOh! 暂时还没有内容!</td></tr>
<else/>
<volist name="data" id="vo">
<tr>
@ -107,14 +105,12 @@
<td>{$vo.total_amt}</td>
<td>{$vo.user_count}</td>
<td>{$vo.ltv_1}</td>
<td>{$vo.ltv_2}</td>
<td>{$vo.ltv_3}</td>
<td>{$vo.ltv_4}</td>
<td>{$vo.ltv_5}</td>
<td>{$vo.ltv_6}</td>
<td>{$vo.ltv_7}</td>
<td>{$vo.ltv_14}</td>
<td>{$vo.ltv_30}</td>
<td>{$vo.ltv_60}</td>
<td>{$vo.ltv_90}</td>
<td>{$vo.ltv_180}</td>
</tr>
</volist>
</empty>
@ -176,8 +172,8 @@ $(function(){
if(interval < 0 || start == ''){
layer.msg('请选择搜索时间');
return false;
}else if(interval>90){
layer.msg('请选择90日内的时间段');
}else if(interval>180){
layer.msg('请选择180日内的时间段');
return false;
}

@ -2,6 +2,7 @@
namespace Base\Repository;
use Base\Service\PromoteService;
use Base\Tool\Registry;
class GameRepository
@ -68,7 +69,7 @@ class GameRepository
return $gameIds;
}
public function getUserRegisterCount($baseGame, $date, $deviceType = 0)
public function getUserRegisterCount($baseGame, $date, $deviceType = 0, $promote = null)
{
$gameIds = $this->getGameIdsByBaseGame($baseGame, $deviceType);
$timeBegin = strtotime($date . ' 00:00:00');
@ -76,17 +77,25 @@ class GameRepository
$subCondition = [
'game_id' => ['in', $gameIds],
'_string' => 'tab_user.id=tab_user_play_info.user_id'
'_string' => 'tab_user_play.user_id=tab_user_play_info.user_id'
];
$subSql = M('user_play_info', 'tab_')->field('1')->where($subCondition)->select(false);
return M('user', 'tab_')->where([
'register_time' => ['between', [$timeBegin, $timeEnd]],
'_string' => 'exists (' . $subSql . ')'
$sqlStr = 'exists (' . $subSql . ')';
if ($promote) {
$promoteService = new PromoteService();
$sqlStr .= ' and promote_id in (' . $promoteService->subInSql($promote) . ')';
}
return M('user_play', 'tab_')->where([
// 'register_time' => ['between', [$timeBegin, $timeEnd]],
'create_time' => ['between', [$timeBegin, $timeEnd]],
'_string' => $sqlStr
])->count();
}
public function getUserRetentionCount($baseGame, $date, $day, $deviceType = 0)
public function getUserRetentionCount($baseGame, $date, $day, $deviceType = 0, $promote = null)
{
$gameIds = $this->getGameIdsByBaseGame($baseGame, $deviceType);
@ -96,14 +105,21 @@ class GameRepository
$subCondition = [
'game_id' => ['in', $gameIds],
'_string' => 'tab_user.id=tab_user_play_info.user_id',
'_string' => 'tab_user_play.user_id=tab_user_play_info.user_id',
'play_time' => ['egt', $retentionTime],
];
$subSql = M('user_play_info', 'tab_')->field('1')->where($subCondition)->select(false);
return M('user', 'tab_')->where([
'register_time' => ['between', [$timeBegin, $timeEnd]],
'_string' => 'exists (' . $subSql . ')'
$sqlStr = 'exists (' . $subSql . ')';
if ($promote) {
$promoteService = new PromoteService();
$sqlStr .= ' and promote_id in (' . $promoteService->subInSql($promote) . ')';
}
return M('user_play', 'tab_')->where([
// 'register_time' => ['between', [$timeBegin, $timeEnd]],
'create_time' => ['between', [$timeBegin, $timeEnd]],
'_string' => $sqlStr
])->count();
}
}

@ -565,4 +565,35 @@ class UserRepository
->find();
return $item['count'];
}
public function getUserRetention($baseGameId, $dateRange, $deviceType, $promote = null, $dayList = [60, 90])
{
$begin = $dateRange[0];
$end = $dateRange[1];
$repository = new GameRepository();
$baseGame = M('base_game', 'tab_')->where(['id' => $baseGameId])->find();
$beginDate = strtotime($begin);
$endDate = strtotime($end);
$dayTime = 24 * 3600;
$records = [];
for ($date = $beginDate; $date <= $endDate; $date = $date + $dayTime) {
$dateStr = date('Y-m-d', $date);
$userRegisterCount = $repository->getUserRegisterCount($baseGame, $dateStr, $deviceType, $promote);
$retentionRates = [];
foreach ($dayList as $day) {
$retentionCount = $repository->getUserRetentionCount($baseGame, $dateStr, $day, $deviceType, $promote);
$retentionRates[$day] = $userRegisterCount == 0 ? '--' : round($retentionCount / $userRegisterCount * 100, 2);
}
$records[$dateStr] = [
'date' => $dateStr,
'register_count' => $userRegisterCount,
'retention_rate' => $retentionRates,
];
}
return $records;
}
}

@ -0,0 +1,101 @@
<?php
namespace Base\Service;
class MendService
{
public static $statusList = [
0 => '处理中',
1 => '处理成功',
2 => '处理失败',
];
public function getStatusText($status)
{
return self::$statusList[$status] ?? '未知';
}
public function addMendTask($params, $permPromote = null, $handlePromote = null)
{
$userId = $params['user_id'] ?? 0;
$remark = $params['remark'] ?? '';
$orderTime = $params['order_time'] ?? '';
$toPromoteId = $params['promote_id_to'] ?? '';
$promoteService = new PromoteService();
if ($toPromoteId == -1) {
$toPromoteId = 0;
}
if ($toPromoteId === '') {
throw new \Exception('请选择需要变更的渠道');
}
$user = M('user', 'tab_')->where(['id' => $userId])->find();
if (!$user) {
throw new \Exception('用户不存在');
}
if ($user['promote_id'] == $toPromoteId) {
throw new \Exception('没有变更数据');
}
if ($orderTime == '') {
throw new \Exception('没有订单日期');
}
if ($permPromote) {
$levelColumn = 'level'. $permPromote['level'] . '_id';
$promote = M('promote', 'tab_')->where(['id' => $user['promote_id']])->where([$levelColumn => $permPromote['id']])->find();
if (!$promote) {
throw new \Exception('所属推广员异常');
}
}
if ($this->checkOrderTime(strtotime($orderTime))) {
throw new \Exception('仅能补链本周数据,请重新选择补链时间');
}
if ($this->checkPromote(strtotime($orderTime), $user['account'])) {
throw new \Exception('在订单日期内含有多个推广员,无法补链');
}
$data = [
'from_promote_id' => $user['promote_id'],
'to_promote_id' => $toPromoteId,
'order_time' => $orderTime,
'type' => 2,
'shift_ids' => [$userId],
'creator_type' => $handlePromote ? 1 : 0,
'creator_id' => $handlePromote ? $handlePromote['id'] : $_SESSION["onethink_admin"]["user_auth"]["uid"]
];
if(!empty($params['remark'])){
$data['remark'] = $params['remark'];
}
$result = $promoteService->addShiftTask($data);
if (!$result['status']) {
throw new \Exception($result['msg']);
}
}
private function checkOrderTime($orderTime)
{
$sdefaultDate = date('Y-m-d');
$first = 1; //周一开始
$w = date('w',strtotime($sdefaultDate));
$checktime = strtotime("$sdefaultDate -" . ($w ? $w - $first : 6) .' days'); //本周开始时间
if($orderTime >= $checktime){
//在本周允许换绑
return false;
}
return true;
}
private function checkPromote($orderTime, $account)
{
$res = M('Spend','tab_')->field('promote_id')->where(['pay_time' => array('EGT', $orderTime), 'user_account' => $account])->group('promote_id')->select();
if(count($res)>1) {
return true;
}
return false;
}
}

@ -134,11 +134,6 @@ class PromoteService {
];
}
$isFuture = false;
if (strtotime($orderTime) > strtotime(date('Y-m-d 23:59:59'))) {
$isFuture = true;
}
$data = [
'from_promote_id' => $fromPromoteId,
'to_promote_id' => $toPromoteId,
@ -154,6 +149,10 @@ class PromoteService {
];
if (M('shift_task', 'sys_')->add($data)) {
if ($type == 2) {
$data['id'] = M()->getLastInsID();
$this->addMendsByTask($data);
}
return [
'status' => true,
'msg'=>'迁移任务创建成功'
@ -166,6 +165,49 @@ class PromoteService {
}
}
public function addMendsByTask($task)
{
$userIds = json_decode($task['shift_ids'], true);
$users = M('user', 'tab_')->field(['id', 'account', 'nickname'])->where(['id' => ['in', $userIds]])->select();
$users = index_by_column('id', $users);
$toPromote = M('promote','tab_')->field(['id', 'account'])->where(['id' => $task['to_promote_id']])->find();
$fromPromote = M('promote','tab_')->field(['id', 'account'])->where(['id' => $task['from_promote_id']])->find();
$creator = null;
$opAccount = '';
if ($task['creator_type'] == 1) {
$creator = M('promote', 'tab_')->where(['id' => $task['creator_id']])->find();
$opAccount = $creator ? $creator['account'] : '';
} else {
$creator = M('ucenter_member', 'sys_')->where(['id' => $task['creator_id']])->find();
$opAccount = $creator ? $creator['username'] : '';
}
$mends = [];
foreach ($userIds as $userId) {
$user = $users[$userId];
$mends[] = [
'task_id' => $task['id'],
'user_id' => $userId,
'user_account' => $user['account'],
'user_nickname' => $user['nickname'],
'promote_id' => $fromPromote ? $fromPromote['id'] : 0,
'promote_account' => $fromPromote ? $fromPromote['account'] : C('OFFICIEL_CHANNEL'),
'promote_id_to' => $toPromote ? $toPromote['id'] : 0,
'promote_account_to' => $toPromote ? $toPromote['account'] : C('OFFICIEL_CHANNEL'),
'remark' => $task['remark'] == '' ? ($task['creator_type'] == 0 ? '后台补链' : '玩家迁移') : $task['remark'],
'order_time' => $task['order_time'],
'create_time' => time(),
'pay_amount' => 0,
'op_id' => $task['creator_id'],
'op_account' => $opAccount,
'op_type' => $task['creator_type'],
'bind_type' => 1,
];
}
M('mend', 'tab_')->addAll($mends);
}
public function shiftPromote($task)
{
$model = new Model();
@ -309,17 +351,6 @@ class PromoteService {
$fromPromoteId = $task['from_promote_id'];
$orderTime = $task['order_time'];
$shiftIds = json_decode($task['shift_ids'], true) ?? [];
$remark = $task['remark'] ?? '';
$creator = null;
$opAccount = '';
if ($task['creator_type'] == 1) {
$creator = M('promote', 'tab_')->where(['id' => $task['creator_id']])->find();
$opAccount = $creator ? $creator['account'] : '';
} else {
$creator = M('ucenter_member', 'sys_')->where(['id' => $task['creator_id']])->find();
$opAccount = $creator ? $creator['username'] : '';
}
$toPromote = M('promote', 'tab_')->where(['id' => $toPromoteId])->find();
$fromPromote = M('promote', 'tab_')->where(['id' => $fromPromoteId])->find();
@ -357,26 +388,17 @@ class PromoteService {
$formConpany = M('promote_company', 'tab_')->field(['company_name', 'company_belong'])->where(['id' => $fromPromote['company_id']])->find();
$toConpany = M('promote_company', 'tab_')->field(['company_name', 'company_belong'])->where(['id' => $toPromote['company_id']])->find();
$belongs = PromoteCompanyService::$belongs;
$mends = [];
$model = new Model();
$model->startTrans();
$hasError = false;
foreach ($users as $item) {
$amount = isset($payAmountRows[$item['id']]) ? round(floatval($payAmountRows[$item['id']]['pay_amount']), 2) : 0;
$mends[] = [
'user_id' => $item['id'],
'user_account' => $item['account'],
'user_nickname' => $item['nickname'],
'promote_id' => $fromPromote['id'],
'promote_account' => $fromPromote['account'],
'promote_id_to' => $toPromote['id'],
'promote_account_to' => $toPromote['account'],
'remark' => $remark == '' ? ($task['creator_type'] == 0 ? '后台补链' : '玩家迁移') : $remark,
'order_time' => $orderTime,
'create_time' => time(),
'pay_amount' => $amount,
'op_id' => $creator ? $creator['id'] : 0,
'op_account' => $opAccount,
'op_type' => $task['creator_type'],
'bind_type' => 1,
];
$status = M('mend', 'tab_')->where(['task_id' => $task['id'], 'user_id' => $item['id']])->save(['status' => 1, 'pay_amount' => $amount, 'update_time' => time()]);
if (!$status) {
$hasError = true;
}
if ($amount > 500) {
$userWord = '玩家账号' . $item['account'];
$fromWord = $fromPromote['account'] . ($formConpany ? '(' . $belongs[$formConpany['company_belong']] . '-' . $formConpany['company_name'] : '');
@ -395,20 +417,16 @@ class PromoteService {
}
}
if ($hasError) {
$model->rollback();
return ['status' => false, 'msg' => '系统异常,修改补链记录失败'];
}
$toTopPromote = $this->getTopPromote($toPromote);
$hasGameIds = $toTopPromote['game_ids'] == '' ? [] : explode(',', $toTopPromote['game_ids']);
$hasNotGameIds = M('game', 'tab_')->where(['game_id' => ['not in', $hasGameIds]])->getField('id', true);
$hasNotGameIds = $hasNotGameIds ?? [];
$model = new Model();
$model->startTrans();
$status = M('mend', 'tab_')->addAll($mends);
if (!$status) {
$model->rollback();
return ['status' => false, 'msg' => '系统异常,添加变更记录失败'];
}
if (count($notices) > 0) {
M('admin_notice', 'tab_')->addAll($notices);
}

@ -28,6 +28,8 @@ class GameResource
240 => LeyouClient::class, // 剑仙诀(苹果版)
247 => LeyouClient::class, // 剑破长空(安卓版)
248 => LeyouClient::class, // 剑破长空(苹果版)
275 => LeyouClient::class, // 一梦仙境(安卓版)
276 => LeyouClient::class, // 一梦仙境(苹果版)
];
public function __construct($game)

@ -146,6 +146,9 @@ class LeyouClient
121249 => ['ref_id' => 121249, 'name' => '私人定制198元激活卡', 'amount' => 198],
121250 => ['ref_id' => 121250, 'name' => '私人定制328元激活卡', 'amount' => 328],
121251 => ['ref_id' => 121251, 'name' => '私人定制648元激活卡', 'amount' => 648],
121228 => ['ref_id' => 121228, 'name' => '1元礼包激活卡', 'amount' => 1],
121229 => ['ref_id' => 121229, 'name' => '6元礼包激活卡', 'amount' => 6],
121230 => ['ref_id' => 121230, 'name' => '30元礼包激活卡', 'amount' => 30],
121252 => ['ref_id' => 121252, 'name' => '68元礼包激活卡', 'amount' => 68],
121253 => ['ref_id' => 121253, 'name' => '98元礼包激活卡', 'amount' => 98],
121254 => ['ref_id' => 121254, 'name' => '128元礼包激活卡', 'amount' => 128],

@ -3057,4 +3057,9 @@ function getAggExceptIds($gameSettings)
}
}
return $exceptIds;
}
function getHideAccount($account)
{
return substr($account, 0, 2) . '******' . substr($account, 8);
}

@ -442,14 +442,19 @@ class BaseController extends HomeController
{
$url = MODULE_NAME . '/' . CONTROLLER_NAME . '/' . ACTION_NAME;
$urlKey = substr(md5($url), 8, 16);
$key = $loginer['id'] . ':' . $urlKey;
$key = 'promote_access_limit:' . $loginer['id'] . ':' . $urlKey;
$check = Redis::exists($key);
if ($check) {
$count = Redis::incr($key);
if ($count > 60) {
Log::write('user_access_limit:' . date('Y-m-d H:i:s') . ' ' . $key . '[' . $url . ']', 'INFO');
$this->assign("ttl",Redis::ttl($key));
$this->display("Index/accessLimit");
Log::write('promote_access_limit:' . date('Y-m-d H:i:s') . ' ' . $key . '[' . $url . ']', 'INFO');
$ttl = Redis::ttl($key);
if ($ttl == -1) {
Redis::incr($key);
Redis::expire($key, 60);
}
$this->assign('ttl', $ttl);
$this->display('Index/accessLimit');
die();
}
} else {

@ -4436,7 +4436,7 @@ public function iosDetailExcelInfo($id,$map) {
$now = date('Y-m-d');
$now = strtotime($now);
$nowTimeEnd = $now + 3600 * 24 - 1;
$spendMap['_string'] = 'today.user_id = uc.user_id and today.game_id = uc.game_id and today.server_id = uc.server_id and today.game_player_id = uc.game_player_id and today.promote_id = uc.promote_id';
$spendMap['_string'] = 'today.user_id = uc.user_id and today.game_id = uc.game_id and today.server_id = uc.server_id and today.game_player_id = uc.game_player_id'; // and today.promote_id = uc.promote_id';
$spendMap['today.pay_status'] = 1;
$spendMap['today.pay_time'] = ['between', [$now, $nowTimeEnd]];

@ -0,0 +1,128 @@
<?php
namespace Home\Controller;
use Base\Service\MendService;
use Base\Service\PromoteService;
/**
* 补链控制器
*/
class MendController extends BaseController
{
protected function _initialize()
{
parent::_initialize();
}
public function index()
{
$page = intval(I('p', 1));
$row = intval(I('row', 10));
$params = I('get.');
$loginer = $this->getLoginPromote();
$promoteService = new PromoteService();
$permPromote = $loginer;
if ($loginer['shift_over_apply'] == 1) {
$permPromote = $promoteService->getTopPromote($loginer);
}
$map = ['op_type' => 1, '_string' => '1=1'];
if(isset($params['account'])) {
$map['user_account']= ['like', '%' . $params['account'] . '%'];
}
if(!empty($params['promote_id'])) {
$map['promote_id']= $params['promote_id'];
}
if(!empty($params['promote_id_to'])) {
$map['promote_id_to'] = $params['promote_id_to'];
}
if(!empty($params['op_id'])) {
$map['op_id'] = $params['op_id'];
}
if (!empty($params['time_start'])) {
$map['order_time'] = ['egt', strtotime($params['time_start'])];
}
if (!empty($params['time_end'])) {
$map['order_time'] = ['elt', strtotime($params['time_end']) + 86399];
}
$subInSql = $promoteService->subInSql($permPromote);
$map['_string'] .= ' and (promote_id in (' . $subInSql . ') or promote_id_to in (' . $subInSql . '))';
$records = M('mend', 'tab_')->where($map)->order('create_time desc')->page($page, $row)->select();
$count = M('mend', 'tab_')->where($map)->count();
$mendService = new MendService();
foreach ($records as $key => $record) {
$record['status_text'] = $mendService->getStatusText($record['status']);
$records[$key] = $record;
}
$page = set_pagination($count, $row, $params);
if ($page) {
$this->assign('_page', $page);
}
$levelColumn = 'level'. $permPromote['level'] . '_id';
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $permPromote['id']])->select();
$this->assign('promotes', $promotes);
$this->assign('count', $count);
$this->assign('records', $records);
$this->meta_title = '补链记录';
$this->display();
}
public function add()
{
$userId = I('user_id', 0);
$user = M('user', 'tab_')->where(['id' => $userId])->find();
if (!$user) {
return $this->error('用户不存在');
}
$loginer = $this->getLoginPromote();
$permPromote = $loginer;
$promoteService = new PromoteService();
if ($loginer['shift_over_apply'] == 1) {
$permPromote = $promoteService->getTopPromote($loginer);
}
$levelColumn = 'level'. $permPromote['level'] . '_id';
$promote = M('promote', 'tab_')->where(['id' => $user['promote_id']])->where([$levelColumn => $permPromote['id']])->find();
if (!$promote) {
return $this->error('所属推广员异常');
}
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $permPromote['id']])->select();
$this->meta_title = '玩家补链';
$this->assign('user', $user);
$this->assign('promotes', $promotes);
$this->display();
}
public function save()
{
$params = I('post.');
$loginer = $this->getLoginPromote();
$permPromote = $loginer;
$promoteService = new PromoteService();
if ($loginer['shift_over_apply'] == 1) {
$permPromote = $promoteService->getTopPromote($loginer);
}
$service = new MendService();
try {
$service->addMendTask($params, $permPromote, $loginer);
$this->ajaxReturn(['status' => 1, 'msg' => '补链申请成功']);
} catch (\Exception $e) {
$this->ajaxReturn(['status' => 0, 'msg' => $e->getMessage()]);
}
}
}

@ -341,7 +341,7 @@ class QueryController extends BaseController
$list['new_login_time'] = date('Y-m-d H:i:s', $newLoginData['login_time']);
$list['new_login_ip'] = $newLoginData['login_ip'];
$list['account'] = substr($list['account'], 0, 2) . '******' . substr($list['account'], 8);
$list['account'] = getHideAccount($list['account']);
if(!empty($list['device_number'])) {
$list['device_number'] = encryption($list['device_number']);
}
@ -1681,7 +1681,7 @@ class QueryController extends BaseController
return $levelPromote;
}
private function getQueryPromote($levelPromote)
private function getQueryPromote($levelPromote, \Closure $whenNotSearch = null)
{
$queryPromote = null;
$promote = $this->getLoginPromote();
@ -1693,6 +1693,11 @@ class QueryController extends BaseController
}
if ($queryPromoteId == 0) {
$queryPromote = $this->getLoginPromote();
if ($whenNotSearch) {
$queryPromote = $whenNotSearch();
} else {
$queryPromote = $this->getLoginPromote();
}
} else {
$queryPromote = M('promote', 'tab_')->where(['id' => $queryPromoteId])->find();
}
@ -1717,9 +1722,17 @@ class QueryController extends BaseController
$sortName = trim(I('sort_name', ''));
$sort = intval(I('sort', 1));
$promote = $this->getLoginPromote();
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$queryPromote = $this->getQueryPromote($levelPromote, function() use ($promote) {
if ($promote['shift_over_apply'] == 1) {
$promoteService = new PromoteService();
return $promoteService->getTopPromote($promote);
} else {
return $promote;
}
});
$promoteService = new PromoteService();
$subInSql = $promoteService->subInSql($queryPromote);
@ -1786,6 +1799,7 @@ class QueryController extends BaseController
}
$columns = [
'role.user_id',
'user_account',
'role.promote_account',
'role.game_name',
@ -1876,7 +1890,6 @@ class QueryController extends BaseController
$this->assign('unique_user_count', $uniqueCountRow['user_count']);
$this->assign('unique_count', $uniqueCountRow['count']);
$this->assign('sort', $sort);
$this->assign('setdate', date('Y-m-d', $nowTime));
$this->assign('games', $games);
$this->assign('records', $records);
$this->assign('pagination', $pagination);
@ -1980,8 +1993,8 @@ class QueryController extends BaseController
$map['s.pay_time'] = ['between', [$begTime, $endTime - 1]];
$fieldS = "sum(s.pay_amount) recharge_cost, count(*) recharge_count, s.user_id, s.user_account, s.promote_id, s.promote_account, s.game_name, s.sdk_version, s.server_name, SUBSTRING_INDEX(GROUP_CONCAT(s.game_player_name order by s.id desc), ',', 1) as game_player_name";
$fieldUser = 'u.register_time, u.login_time';
$spendMap['_string'] = 'today.user_id = s.user_id and today.game_id = s.game_id and today.server_id = s.server_id and today.game_player_id = s.game_player_id and today.promote_id = s.promote_id';
$spendMap['_string'] = 'today.user_id = s.user_id and today.game_id = s.game_id and today.server_id = s.server_id and today.game_player_id = s.game_player_id'; // and today.promote_id = s.promote_id';
$spendMap['today.pay_status'] = 1;
$spendMap['today.pay_time'] = ['between', [$nowTime, $nowTimeEnd]];

@ -133,7 +133,7 @@
</div>
</div>
<div class="grade">14.48K个评分</div>
<div class="grade">14,480个评分</div>
</div>
<div class="evaluate-box" style="display: none">
<span>#{$game['recommend_level']}</span>
@ -219,7 +219,7 @@
<div style="width: 0;"></div>
</div>
</div>
<div class="mark">14.48K个评分</div>
<div class="mark">14,480个评分</div>
</div>
</div>
</div>

@ -0,0 +1,168 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/platform.css" rel="stylesheet">
<style>
.trunk-list .table3 {width: 100%;}
.table3 tr td{border: 1px solid #E0E7EF;}
.pagenation{line-height: 6.5vh;}
.pagenation>div {text-align: right;}
.trunk-list .table3 tr {height: 4.2vh;}
.table_scroll {width:100%;table-layout:fixed;}
.table_scroll tr td {border:none;border-right:1px solid #E0E7EF;}
.table_scroll tr td:last-child{border-right:none;}
.table_scroll tr+tr td {border-top:1px solid #E0E7EF;}
.btn {cursor: pointer;}
</style>
</block>
<block name="body">
<div class="page-search normal_list promoteCoin-shift-search">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>玩家补链</span></div>
</div>
<img src="__IMG__/20180207/icon_normal_yve.png"><span class="title_main">玩家补链</span>
</div>
<div class="trunk-content article">
<div class="trunk-list" style="padding-top:33px;">
<form id="form" action="{:U('save')}" method="post">
<input type="hidden" name="user_id" value="<?=$user['id']?>">
<table class="table2">
<tbody>
<tr>
<td class="l"><span class="req">*</span>用户账号:</td>
<td class="r">
<input type="text" class="name txt" disabled value="<?=getHideAccount($user['account'])?>">
</td>
</tr>
<tr>
<td class="l"><span class="req">*</span>修改前推广员:</td>
<td class="r">
<input type="text" class="name txt" disabled value="<?=$user['promote_account']?>">
</td>
</tr>
<tr>
<td class="l"><span class="req">*</span>补链后推广员:</td>
<td class="r">
<select name="promote_id_to" class="reselect select_gallery" style="width: 220px;" >
<option value="">请选择推广账号</option>
<?php foreach($promotes as $promote):?>
<option value="<?=$promote['id']?>"><?=$promote['account']?></option>
<?php endforeach;?>
</select>
</td>
</tr>
<tr>
<td class="l"><span class="req">*</span>订单日期:</td>
<td class="r">
<input id="shift-order-time" type="text" autocomplete="off" class="name txt" name="order_time" placeholder="订单日期"" value="" style="width: 199px;">
</td>
</tr>
<tr>
<td class="l">备注:</td>
<td class="r">
<textarea name="remark" id="" cols="30" rows="10" class="name txt" style="padding: 10px"></textarea>
</td>
</tr>
<tr>
<td class="l"></td>
<td class="r">
<button type="button" class="tjbnt btn" onclick="check()" >确认</button>
<button type="button" style="background: #E5E5E5; color: #8B8CA0;" class="tjbnt btn" onclick="window.history.back();" >返回</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</block>
<block name="script">
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
$(function(){
$("#promote_id").change();
$("#promote_child").change();
$(".select_gallery").select2();
$('#shift-order-time').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true,
scrollMonth:false,
scrollTime:false,
scrollInput:false
})
});
function addParamsToUrl(url, params)
{
var pos = url.indexOf('.html')
url = url.substring(0, pos)
for (var i in params) {
url += '/' + i + '/' + params[i]
}
url += '.html'
return url
}
function submit() {
var userId = $('[name=user_id]').val()
var toPromoteId = $('[name=promote_id_to]').val()
var remark = $('[name=remark]').val()
var orderTime = $('[name=order_time]').val()
$.ajax({
type:"POST",
url:"{:U('save')}",
data: {
user_id: userId,
remark: remark,
promote_id_to: toPromoteId,
order_time: orderTime,
},
success:function(res){
if(res.status==1){
layer.msg(res.msg);
setTimeout(function(){
window.location.href = "{:U('Mend/index')}";
}, 1500);
} else {
layer.msg(res.msg);
}
}
})
}
function check() {
data = validation();
if (data.status != 1) {
layer.msg(data.msg, {icon: 2});
return false;
} else {
submit();
}
}
function validation() {
var json_data = "";
var limits = parseInt("{$loginer['balance_coin']|default=0}");
if ($('[name=promote_id_to]').val() == '') {
return json_data = {'status': 0, 'msg': '请选择补链后推广员'}
}
if ($('#shift-order-time').val() == '') {
return json_data = {'status': 0, 'msg': '请选择订单日期'}
}
return json_data = {'status': 1, 'msg': '成功'};
}
</script>
</block>

@ -0,0 +1,179 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/data.css" rel="stylesheet">
<link href="__CSS__/20180207/manager.css" rel="stylesheet">
<link href="__CSS__/20180207/finance.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.css?v=1.2" rel="stylesheet">
</block>
<block name="body">
<div class="page-search normal_list query-register-search jssearch" style="font-size: small;">
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:<span>数据管理></span><span>补链记录</span></div>
</div>
<img src="__IMG__/20180207/icon_zhuce.png">
<span class="title_main">补链记录</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<!-- <form action="{:U('Query/viewRole',array('row'=>I('get.row'),'id'=>I('get.id')))}" method="post" enctype="multipart/form-data">-->
<div class="form-group normal_space fl">
<input type="text" name="account" class="txt normal_txt" placeholder="请输入玩家账号"
value="{:I('account')}">
</div>
<div class="form-group normal_space fl">
<select id="promote_id" name="promote_id" class="reselect select_gallery">
<option value="">补链前推广员</option>
<volist name="promotes" id="vo">
<option value="{$vo.id}" title="{$vo.account}">{$vo.account}</option>
</volist>
</select>
</div>
<div class="form-group normal_space fl">
<select id="promote_id_to" name="promote_id_to" class="reselect select_gallery">
<option value="">补链后推广员</option>
<volist name="promotes" id="vo">
<option value="{$vo.id}" title="{$vo.account}">{$vo.account}</option>
</volist>
</select>
</div>
<div class="form-group normal_space fl">
<select id="op_id" name="op_id" class="reselect select_gallery">
<option value="">操作人员</option>
<volist name="promotes" id="vo">
<option value="{$vo.id}" title="{$vo.account}">{$vo.account}</option>
</volist>
</select>
</div>
<div class="form-group normal_space fl">
<label class="form-title select-title" style="position: relative;">起止时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="time_start" placeholder="开始时间" value="{:I('time_start')}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="time_end" placeholder="结束时间" value="{:I('time_end')}">
</div>
</div>
<div class="form-group normal_space fl">
<input type="submit" class="submit" id='submit' url="{:U('Mend/index',array('model'=>$model['name']),false)}"
value="查询">
</div>
<!-- </form>-->
</div>
</div>
<div class="page-list query-register-list">
<div class="trunk-content article">
<div class="trunk-list list_normal" style="">
<table class="table normal_table">
<tr class="odd">
<th>玩家账号</th>
<th>补链前推广账号</th>
<th>补链前归属金额</th>
<th>补链后推广账号</th>
<th>备注</th>
<th>切分时间</th>
<th>补链时间</th>
<th>状态</th>
<th>操作人员</th>
</tr>
<empty name="records">
<tr class="num2">
<td colspan="7" style="text-align: center;height: 45vh;">
<img src="__IMG__/20180207/icon_wushujv2.png"/>
<p style="line-height: 40px;color: #A5A5A5;">暂无数据</p>
</td>
</tr>
<else/>
<volist name="records" id="vo">
<tr class="num2">
<td><?=getHideAccount($vo['user_account'])?></td>
<td>{$vo.promote_account}</td>
<td>{$vo.pay_amount}</td>
<td>{$vo.promote_account_to}</td>
<td>{$vo.remark}</td>
<td>{$vo.order_time|date='Y-m-d H:i:s',###}</td>
<td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
<td>{$vo.status_text}</td>
<td>{$vo.op_account}</td>
</tr>
</volist>
</empty>
</table>
</div>
<div class="pagenation clearfix">
{$_page}
</div>
</div>
</div>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
$().ready(function () {
setValue('promote_id', {$Think.request.promote_id |default = '""'});
setValue('promote_id_to', {$Think.request.promote_id_to |default = '""'});
setValue('op_id', {$Think.request.op_id |default = '""'});
setValue('row', '{:I("get.row",10)}');
var date = "{$setdate}";
$('#sdate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$('#edate').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left',
scrollMonth: false,
scrollTime: false,
scrollInput: false,
endDate: date
});
$(".select_gallery").select2();
$('#submit').click(function () {
var sdate = $('#sdate').val();
var edate = $('#edate').val();
if (Date.parse(sdate) > Date.parse(edate)) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
var url = $(this).attr('url');
console.log(url);
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
query = query.replace(/^&/g, '');
if (url.indexOf('?') > 0) {
url += '&' + query;
} else {
url += '?' + query;
}
window.location.href = url;
});
});
</script>
</block>

@ -89,6 +89,7 @@
<a href="{:U('Query/iosDownLoadData')}" class="<?=is_active_class(['Query'], ['iosDownLoadData'])?>">IOS下载数统计</a>
<a href="{:U('Query/userretention')}" class="<?=is_active_class(['Query'], ['userretention'])?>">用户留存率</a>
<a href="{:U('Query/gameData')}" class="<?=is_active_class(['Query'], ['gameData'])?>">游戏分区数据汇总</a>
<a href="{:U('Mend/index')}" class="<?=is_active_class(['Mend'], ['index', 'add'])?>">补链记录</a>
</div>
<?php endif;?>
<?php if ($canViewUserRecharge && $loginer['level'] == 1) :?>

@ -157,6 +157,7 @@
<i class="iconfont iconsort"></i>
</if>
</th>
<th>操作</th>
</tr>
<empty name="records">
<tr><td colspan="8" style="text-align: center;height: 45vh;"><img src="__IMG__/20180207/icon_wushujv2.png"/><p style="line-height: 40px;color: #A5A5A5;">暂无数据</p></td></tr>
@ -179,6 +180,8 @@
<td>{$record.role_name}</td>
<td>{$record.role_level}</td>
<td>{$record.create_time}</td>
<td><a href="{:U('Mend/add',array('user_id'=>$record['user_id']))}" style="cursor: pointer"
class="chakan">补链</a></td>
</tr>
</volist>
</empty>

@ -1261,7 +1261,7 @@ class PaymentController extends BaseController
}
$count = M("pay_statement_info","tab_")->field("sum(final_statement_money) statement_money")->where("id in ({$ids})")->find();
$paymentInfo = D("Admin/TransferMerchant")->getUnderPaymentInfo();
$paymentInfo = D("Admin/TransferMerchant")->getStatementPaymentInfo();
$this->getAccountMoney();
// dd($CompanyInfo);

Loading…
Cancel
Save