Merge branch 'release' of 47.111.118.107:wmtx/platform into feature/promote_all_check

master
zhengyongxing 5 years ago
commit f93ab7fd95

@ -918,6 +918,7 @@ class ArticleController extends AdminController {
if ($_POST['type'] == 1 ) {
$_POST['pop_time'] = strtotime($_POST['pop_time']);
}
if ($id) {
$pop_rules_model = M('document_pop_rules');//M('$this->$model_name','tab_');
$res = $pop_rules_model->where(['id'=>$id])->save($_POST);
@ -943,11 +944,49 @@ class ArticleController extends AdminController {
if (!$rule) {
return $this->error('记录不存在');
}
if (empty($rule['document_route'])) {
$doc = "当前无文档";
}else {
$document_route_arr = explode("/", $rule['document_route']);
$doc = $document_route_arr[2];
}
$this->assign("doc", $doc);
$rule['pop_time'] = $rule['type'] == 1 ? date("Y-m-d", $rule['pop_time']) : $rule['pop_time'];
$this->assign('rule', $rule);
}
}
$this->display('pop_rule_edit');
}
public function uploadDoc() {
$id = $_REQUEST['id'];
if(@is_uploaded_file($_FILES['file']['tmp_name'])){
$upfile = $_FILES["file"];
$name = $upfile["name"];
$type = $upfile["type"];
$size = $upfile["size"];
$tmp_name = $upfile["tmp_name"];
$savePath = $_SERVER['DOCUMENT_ROOT'].__ROOT__.'/Uploads/Documents/';
if (is_dir($savePath)) {
move_uploaded_file($tmp_name,$savePath.$name);
}else {
mkdir($savePath, 0777, true);
move_uploaded_file($tmp_name,$savePath.$name);
}
$file_name = $savePath.$name;
$error=$upfile["error"];//上传后系统返回的值
$data['document_route'] = 'Uploads/Documents/'.$name;
$updateres = M('document_pop_rules')->where(['id' => $id])->save($data);
if ($updateres) {
$backData['code'] = 10000;
$backData['filename'] = $name;
}else {
$backData['code'] = 10001;
}
$this->ajaxReturn(json_encode($backData,TRUE));
}
}
}

@ -9074,27 +9074,60 @@ class ExportController extends Controller
$map['p.id'] = I('promote_id');
}
$pdlMap = "";
$pdlMap = "";
$weekMap = '';
if ($startTime = I('create_time_start')) {
$startTime = strtotime($startTime);
$pdlMap .= " and pdl.create_time >={$startTime}";
$pdlMap .= " and pdl.create_time >={$startTime}";
$weekMap .= " and register_time >={$startTime}";
}
if ($endTime = I('create_time_end')) {
$endTime = strtotime($endTime) + 86400;
$pdlMap .= " and pdl.create_time < {$endTime}";
$pdlMap .= " and pdl.create_time < {$endTime}";
$weekMap .= " and register_time < {$endTime}";
}
if ($startTime = I('create_time_start')) {
$startTime = strtotime($startTime);
$pdlMap .= " and pdl.create_time >={$startTime}";
$weekMap .= " and register_time >={$startTime}";
}
if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
$xlsData = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2", 'left')
->where($map)
->group('p.id')
->select();
$xlsData = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account')
->where($map)
->select();
if ($xlsData) {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
if (empty($weekMap)) {
$weekMap = " and register_time between $beginThisweek and $endThisweek";
}
foreach ($xlsData as &$item) {
$item['ioscount'] = M('user', 'tab_')->where('device_type = 2 and promote_id = ' . $item['id'])->count();
$item['weekcount'] = M('user', 'tab_')->where("device_type = 2 and promote_id = {$item['id']}" . $weekMap)->count();
$itemCount = M('package_download_log', 'tab_')->alias('pdl')
->field('count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->where("promote_id={$item['id']} $pdlMap")->select();
$item['signcount'] = $itemCount[0]['signcount'] ?? 0;
$item['tfcount'] = $itemCount[0]['tfcount'] ?? 0;
$item['supersigncount'] = $itemCount[0]['supersigncount'] ?? 0;
}
// $promoters = M('promote', 'tab_')->alias('p')->field('p.id, p.level, p.account')->where($map)->select();
// $pids = implode(',', array_column($promoters, 'id'));
// $total[0]['ioscount'] = M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)")->count();
// $total[0]['weekcount'] = M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)" . $weekMap)->count();
// $totalCount = M('package_download_log', 'tab_')->alias('pdl')
// ->field('count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
// ->where("promote_id in ($pids) $pdlMap")->select();
// $total[0]['signcount'] = $totalCount[0]['signcount'] ?? 0;
// $total[0]['tfcount'] = $totalCount[0]['tfcount'] ?? 0;
// $total[0]['supersigncount'] = $totalCount[0]['supersigncount'] ?? 0;
}
} else {
$xlsData = M('promote', 'tab_')->alias('p')
@ -9272,7 +9305,7 @@ class ExportController extends Controller
NULL AS total_complete_count
FROM
sys_member u
LEFT JOIN tab_work_order_info i ON i.creator_id = u.uid
JOIN tab_work_order_info i ON i.creator_id = u.uid
WHERE
u.uid in ({$userids})
GROUP BY u.uid
@ -9295,6 +9328,15 @@ class ExportController extends Controller
GROUP BY t.id
$order");
}
if ($list) {
foreach ($list as &$item)
{
$item['total_create_count'] = $item['total_create_count'] ?? 0;
$item['total_accepted_count'] = $item['total_accepted_count'] ?? 0;
$item['total_handle_count'] = $item['total_handle_count'] ?? 0;
$item['total_complete_count'] = $item['total_complete_count'] ?? 0;
}
}
$xlsName = '工单统计报表';
$xlsCell = array(
array('nickname', "账号"),

@ -1162,34 +1162,68 @@ class StatisticsController extends ThinkController {
$count = M('promote', 'tab_')->alias('p')->where($map)->count();
$pdlMap = "";
$weekMap = '';
if ($startTime = I('create_time_start')) {
$startTime = strtotime($startTime);
$pdlMap .= " and pdl.create_time >={$startTime}";
$weekMap .= " and register_time >={$startTime}";
}
if ($endTime = I('create_time_end')) {
$endTime = strtotime($endTime) + 86400;
$pdlMap .= " and pdl.create_time < {$endTime}";
$weekMap .= " and register_time <= {$endTime}";
}
if ($level == PromoteModel::LEVEL_TEAM_MEMBER) {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
if (empty($weekMap)) {
$weekMap = " and register_time between $beginThisweek and $endThisweek";
}
$list = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2", 'left')
->where($map)
->page($p, $row)
->group('p.id')
->select();
->field('p.id, p.level, p.account')
->where($map)
->page($p, $row)
->select();
$total = M('promote', 'tab_')->alias('p')
->field('count(distinct(u.id)) as iosCount, count(distinct(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
->join("tab_user u on u.promote_id = p.id and u.device_type=2")
->where($map)
->select();
if ($list) {
foreach ($list as &$item) {
$item['ioscount'] = M('user', 'tab_')->where('device_type = 2 and promote_id = ' . $item['id'])->count();
$item['weekcount'] = M('user', 'tab_')->where("device_type = 2 and promote_id = {$item['id']}" . $weekMap)->count();
$itemCount = M('package_download_log', 'tab_')->alias('pdl')
->field('count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->where("promote_id={$item['id']} $pdlMap")->select();
$item['signcount'] = $itemCount[0]['signcount'] ?? 0;
$item['tfcount'] = $itemCount[0]['tfcount'] ?? 0;
$item['supersigncount'] = $itemCount[0]['supersigncount'] ?? 0;
}
$promoters = M('promote', 'tab_')->alias('p')->field('p.id, p.level, p.account')->where($map)->select();
$pids = implode(',', array_column($promoters, 'id'));
$total[0]['ioscount'] = M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)")->count();
$total[0]['weekcount'] = M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)" . $weekMap)->count();
$totalCount = M('package_download_log', 'tab_')->alias('pdl')
->field('count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->where("promote_id in ($pids) $pdlMap")->select();
$total[0]['signcount'] = $totalCount[0]['signcount'] ?? 0;
$total[0]['tfcount'] = $totalCount[0]['tfcount'] ?? 0;
$total[0]['supersigncount'] = $totalCount[0]['supersigncount'] ?? 0;
}
// $list = M('promote', 'tab_')->alias('p')
// ->field('p.id, p.level, p.account, count(u.id) as iosCount, count(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null)) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
// ->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
// ->join("tab_user u on u.promote_id = p.id and u.device_type=2", 'left')
// ->where($map)
// ->page($p, $row)
// ->group('p.id')
// ->select();
// $total = M('promote', 'tab_')->alias('p')
// ->field('count(distinct(u.id)) as iosCount, count(distinct(if (u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
// ->join("tab_package_download_log pdl on pdl.promote_id = p.id $pdlMap", 'left')
// ->join("tab_user u on u.promote_id = p.id and u.device_type=2")
// ->where($map)
// ->select();
} else {
$list = M('promote', 'tab_')->alias('p')
->field('p.id, p.level, p.account, count(if(p2.level = '.($level+1).', 1, null)) as lowerCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
@ -1214,7 +1248,12 @@ class StatisticsController extends ThinkController {
$this->assign('_page', $page);
}
$promoters = M('promote', 'tab_')->field('id, account')->where(array_merge(['level'=>$level], $pid ? ['parent_id'=>$pid] : []))->select();
if ($pid && $level) {
$promoters = M('promote', 'tab_')->field('id, account')->where("level= $level and chain like '{$info['chain']}{$pid}/%'")->select();
} else {
$promoters = M('promote', 'tab_')->field('id, account')->where(array_merge(['level'=>$level], $pid ? ['parent_id'=>$pid] : []))->select();
}
unset($typeArr[0]);
$this->assign('promoters', $promoters);
$this->assign('types', $typeArr);
@ -1250,14 +1289,17 @@ class StatisticsController extends ThinkController {
$map['pdl.type'] = I('type');
}
$weekMap = '';
if ($startTime = I('create_time_start')) {
$startTime = strtotime($startTime);
$map['_string'] .= " and pdl.create_time >={$startTime}";
$weekMap .= " and register_time >={$startTime}";
}
if ($endTime = I('create_time_end')) {
$endTime = strtotime($endTime) + 86400;
$map['_string'] .= " and pdl.create_time < {$endTime}";
$weekMap .= " and register_time <= {$endTime}";
}
$list = M('package_download_log', 'tab_')->alias('pdl')
@ -1270,12 +1312,26 @@ class StatisticsController extends ThinkController {
$beginThisweek = mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y"));
$endThisweek = mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y"));
if (empty($weekMap)) {
$weekMap = " and register_time between $beginThisweek and $endThisweek";
}
$total = M('package_download_log', 'tab_')->alias('pdl')
->field('count(distinct(if(u.device_type=2, 1, null))) as iosCount, count(distinct(if (u.device_type=2 and u.register_time between '. $beginThisweek . ' and ' . $endThisweek .', 1, null))) as weekCount, count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->field('count(if(pdl.type = 1, 1, null)) as signCount, count(if(pdl.type = 2, 1, null)) as tfCount, count(if(pdl.type = 3, 1, null)) as superSignCount')
->join('tab_promote p on p.id = pdl.promote_id')
//->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map)
->select();
$promoters = M('package_download_log', 'tab_')->alias('pdl')
->field('pdl.promote_id')
->join('tab_promote p on p.id = pdl.promote_id')
->join('tab_user u on u.id = pdl.user_id', 'left')
->where($map)
->select();
$pids = implode(',', array_unique(array_filter(array_column($promoters, 'promote_id'))));
$total[0]['ioscount'] = $promoters ? M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)")->count() : 0;
$total[0]['weekcount'] = $promoters ? M('user', 'tab_')->where("device_type = 2 and promote_id in ($pids)" . $weekMap)->count() : 0;
$count = M('package_download_log', 'tab_')->alias('pdl')
->join('tab_promote p on p.id = pdl.promote_id')

@ -403,7 +403,7 @@ class WorkOrderController extends ThinkController
NULL AS total_complete_count
FROM
sys_member u
LEFT JOIN tab_work_order_info i ON i.creator_id = u.uid
JOIN tab_work_order_info i ON i.creator_id = u.uid
WHERE
u.uid in ({$userids})
GROUP BY u.uid

@ -14,6 +14,24 @@
<label>描述</label>
<textarea name="desc" class="" placeholder="描述" >{$rule.desc}</textarea>
</li>
<li>
<label>规则性质</label>
<span class="form_radio"><label><input type="radio" name="belongs" value="1" <?php if ($rule['belongs'] == 1):?>checked<?php endif;?>> 外团</label>
<label><input type="radio" name="belongs" value="2" <?php if ($rule['belongs'] == 2):?>checked<?php endif;?>> 内团</label></span>
<span class="notice-text"></span>
</li>
<li>
<label>上传文档</label>
<input type="file" name="upfile" id="file_doc" style="width:200px"/>
<input type="button" onclick="suba({$rule['id']})" style="background: #3E96C9;color:white;border:none;outline: none;width:70px;height:30px;border-radius: 3px;" value="上传" />
<span class="notice-text" id="aa" style="color:green;margin-left:10px;display: block;">当前文档:{$doc}</span>
<span class="notice-text" id="uploadstatus" style="color:red;margin-left:10px;display: none;">上传成功</span>
<span class="notice-text" id="uploadstatus1" style="color:red;margin-left:10px;display: none;">上传失败,当前文档:{$doc}</span>
</li>
<li>
<label>排序</label>
<input name="sort" type="text" class="txt" placeholder="排序" value="{$rule.sort}" />
@ -65,6 +83,36 @@
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
</script>
<script>
function suba(id) {
var file_excel = $('#file_doc')[0].files[0]
var formData = new FormData();
formData.append("file",file_excel);
formData.append("id",id)
$.ajax({
url:"{:U('Article/uploadDoc')}",
dataType:'json',
type:'POST',
async:false,
data:formData,
processData : false, // 使数据不做处理
contentType : false, // 不要设置Content-Type请求头
success:function(res) {
res = JSON.parse(res)
if (res.code == 10000) {
document.getElementById('uploadstatus').style.display = 'block'
document.getElementById('uploadstatus1').style.display = 'none'
document.getElementById('aa').style.display = 'none'
}else {
document.getElementById('uploadstatus1').style.display = 'block'
document.getElementById('uploadstatus').style.display = 'none'
document.getElementById('aa').style.display = 'none'
}
}
})
}
</script>
<script type="text/javascript">
highlight_subnav('{:U('Article/pop_rules')}');
function checkPopTime(first)
@ -90,7 +138,7 @@
} else if (type_val == 2) {
//$('#li-pop-time').show();
$("#li-pop-time").html('<label>弹窗时间</label><select id="pop_time" name="pop_time" class="select_gallery"><option value="1" <?php if ($rule["pop_time"] == 1):?>selected<?php endif;?>>周一</option><option value="2" <?php if ($rule["pop_time"] == 2):?>selected<?php endif;?> >周二</option><option value="3" <?php if ($rule["pop_time"] == 3):?>selected<?php endif;?> >周三</option><option value="4" <?php if ($rule["pop_time"] == 4):?>selected<?php endif;?> >周四</option><option value="5" <?php if ($rule["pop_time"] == 5):?>selected<?php endif;?> >周五</option><option value="6" <?php if ($rule["pop_time"] == 6):?>selected<?php endif;?> >周六</option><option value="7" <?php if ($rule["pop_time"] == 7):?>selected<?php endif;?> >周日</option></select>');
$("#li-pop-time").html('<label>弹窗时间</label><select id="pop_time" name="pop_time" class="select_gallery"><option value="8" <?php if ($rule["pop_time"] == 8):?>selected<?php endif;?>>每周第一次登陆</option><option value="1" <?php if ($rule["pop_time"] == 1):?>selected<?php endif;?>>周一</option><option value="2" <?php if ($rule["pop_time"] == 2):?>selected<?php endif;?> >周二</option><option value="3" <?php if ($rule["pop_time"] == 3):?>selected<?php endif;?> >周三</option><option value="4" <?php if ($rule["pop_time"] == 4):?>selected<?php endif;?> >周四</option><option value="5" <?php if ($rule["pop_time"] == 5):?>selected<?php endif;?> >周五</option><option value="6" <?php if ($rule["pop_time"] == 6):?>selected<?php endif;?> >周六</option><option value="7" <?php if ($rule["pop_time"] == 7):?>selected<?php endif;?> >周日</option></select>');
}
}
checkPopTime(1);

@ -25,6 +25,46 @@
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.tooltip {
position: relative;
display: inline-block;
color: #056dae;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 250%;
background-color: #fff;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 80%;
left: 0;
margin-left: -70%;
border: #000 solid 1px;
}
.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: #000;
visibility: visible;
line-height: 20px;
}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">
@ -86,7 +126,7 @@
<?php else:?>
<th>iOS用户总数</th>
<th>新增iOS用户总数</th>
<th>TF下载数</th>
<th><div class="tooltip">TF下载数<span class="tooltiptext"><span style="margin-left: -10px">TF下载数(TF下载数/iOS用户总数)</span></span></div></th>
<?php endif;?>
<th>超级签下载数</th>
<th>企业签下载数</th>

@ -118,8 +118,8 @@
<volist name="list_data" id="data">
<tr>
<td>{$data.nickname}</td>
<td>{$data.total_create_count}</td>
<td>{$data.total_accepted_count}</td>
<td><?php echo $data['total_create_count'] ?? 0;?></td>
<td><?php echo $data['total_accepted_count'] ?? 0;?></td>
<td><?php echo $data['total_handle_count'] ?? 0;?></td>
<td><?php echo $data['total_complete_count'] ?? 0;?></td>
</tr>

@ -206,19 +206,15 @@ class DownloadController extends BaseController {
$map['type'] = $type;
}
if ($createTime != '') {
$createTimeRow = explode(' 至 ', $createTime);
$createTimeBegin = 0;
$createTimeEnd = 0;
if (count($createTimeRow) == 2) {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59');
} else {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
}
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24;
$map['create_time'] = ['between', [$begTime, $endTime]];
$conditions = json_encode($map,TRUE);
$addtime = time();
$data = [
@ -248,6 +244,7 @@ class DownloadController extends BaseController {
public function ios_data_export() {
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$localId = $queryPromote['id'];
$map = [];
if ($queryPromote['level'] == 4) {
$map['id'] = $queryPromote['id'];
@ -255,20 +252,19 @@ class DownloadController extends BaseController {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
}
$createTime = I('create_time', '');
if ($createTime != '') {
$createTimeRow = explode(' 至 ', $createTime);
$createTimeBegin = 0;
$createTimeEnd = 0;
if (count($createTimeRow) == 2) {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59');
} else {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
}
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24;
$map['create_time'] = ['between', [$begTime, $endTime]];
$map['pid'] = PID;
if ($localId !== PID) {
$map['localId'] = $localId;
}
$conditions = json_encode($map,TRUE);
$addtime = time();
$data = [
@ -2252,9 +2248,9 @@ public function iosDetailExcelInfo($id,$map) {
}
if (!empty($map['create_time'])) {
$map1['create_time'] = $map['create_time'];
$tfMap['create_time'] = $map['craete_time'];
$superMap['create_time'] = $map['craete_time'];
$companyMap['create_time'] = $map['craete_time'];
$tfMap['create_time'] = $map['create_time'];
$superMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
}
$belongs_president = '';
@ -2271,8 +2267,10 @@ public function iosDetailExcelInfo($id,$map) {
}
if (!empty($map['promote_id'])) {
$promote_id = $map['promote_id'];
$map1['promote_id'] = $map['promote_id'];
}
$rs = M('package_download_log', 'tab_')->field('id,game_id,user_id,type,create_time')->where($map1)->select();
$tfMap['promote_id'] = $promote_id;
$tfMap['type'] = 2;
$TFCounts = M('package_download_log', 'tab_')->where($tfMap)->count();
@ -2343,7 +2341,8 @@ public function iosDetailExcelInfo($id,$map) {
$xlsName ="IOS下载数统计";
$xlsCell = array(
'推广员账号',
'玩家人数',
'IOS用户总数',
'新增IOS用户总数',
'TF下载次数',
'超级签下载次数',
'企业签下载次数',
@ -2357,31 +2356,56 @@ public function iosDetailExcelInfo($id,$map) {
$map1['chain'] = $map['chain'];
}
if (!empty($map['create_time'])) {
$map1['create_time'] = $map['create_time'];
// $map1['create_time'] = $map['create_time'];
$tfMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
$superMap['create_time'] = $map['create_time'];
$allTFMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
$allSuperMap['create_time'] = $map['create_time'];
// $iosTimeMap['register_time'] = $map['create_time'];
$map10['register_time'] = $map['create_time'];
$alliosMap['register_time'] = $map['create_time'];
$allUserMap['register_time'] = $map['create_time'];
$allTFMap['create_time'] = $map['create_time'];
$allSuperMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
$sunday = strtotime('-1 sunday', $map['create_time'][1][1]) + 24 * 3600;
$m['create_time'] = ['between', [$sunday, $map['create_time'][1][1]]];
$iosTimeMap['register_time'] = $m['create_time'];
$alliosMap['register_time'] = $m['create_time'];
}
if (!empty($map['id'])) {
$map1['id'] = $map['id'];
$tfMap['create_time'] = $map['craete_time'];
$superMap['create_time'] = $map['craete_time'];
$companyMap['create_time'] = $map['craete_time'];
$tfMap['create_time'] = $map['create_time'];
$superMap['create_time'] = $map['create_time'];
$companyMap['create_time'] = $map['create_time'];
}
$rs = M('promote', 'tab_')->field(['id'])->where($map1)->select();
$allids = array_column($rs, 'id');
if (!empty($map['localId'])) {
array_push($allids, $map['localId']);
}
array_push($allids, PID);
$allUserMap['promote_id'] = ['in', $allids];
$allUserMap['device_type'] = 2;
$allTFMap['promote_id'] = ['in', $allids];
$allTFMap['type'] = 2;
$allSuperMap['promote_id'] = ['in', $allids];
$allSuperMap['type'] = 3;
$companyMap['promote_id'] = ['in', $allids];
$companyMap['type'] = 1;
$allUsersCounts = M('user', 'tab_')->where($allUserMap)->count();
$allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count();
$allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count();
$allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count();
$alliosMap['promote_id'] = ['in', $allids];
$alliosMap['device_type'] = 2;
$allIosCounts = M('user', 'tab_')->where($alliosMap)->count();
$csvFileName = $xlsName.'.csv';
header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
@ -2395,24 +2419,40 @@ public function iosDetailExcelInfo($id,$map) {
$accessNum = count($rs)?:0 ;
$perSize = 5000;//每次查询的条数
$pages = ceil($accessNum / $perSize);
if ($pages == 0) {
$pages = 1;
}
for($i = 1; $i <= $pages; $i++) {
$data = M('promote', 'tab_')->field(['id'])->where($map1)
->limit(($i-1)*$perSize ,$perSize)->select();
$ids = array_column($data, 'id');
if (in_array($map['localId'], $ids)) {
}else {
}
if ($i == 1) {
array_unshift($ids, PID);
if (!empty($map['localId']) && !in_array($map['localId'], $ids)) {
array_unshift($ids,$map['localId'] );
}
if (!in_array(PID, $ids)) {
array_unshift($ids, PID);
}
}
foreach($ids as $key => $id) {
$promote1 = M('promote', 'tab_')->field('account, level, parent_id, chain')->where(['id' => $id])->select();
$promote = $promote1[0];
$chain = $promote['chain'];
//$csvData['promote_id'] = $id;
if($id == PID) {
$csvData['account'] = $promote['account'].'[自己]';
}else {
$csvData['account'] = $promote['account'];
}
$iosTimeMap['promote_id'] = $id;
$iosTimeMap['device_type'] = 2;
$iosCount = M('user', 'tab_')->where($iosTimeMap)->count();
$tfMap['promote_id'] = $id;
$tfMap['type'] = 2;
$companyMap['promote_id'] = $id;
@ -2422,9 +2462,17 @@ public function iosDetailExcelInfo($id,$map) {
$tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); //企业签下载量
$superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); //超级签下载量
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id])->count();
$map10['promote_id'] = $id;
$map10['device_type'] = 2;
$usersCounts = M('user', 'tab_')->where($map10)->count();
$tfpercent = number_format((intval($tfCounts) / intval($usersCounts)),2,'.','') * 100;
if (intval($usersCounts) == 0) {
$tfpercent = 0;
}
$csvData['userscounts'] = intval($usersCounts);
$csvData['tfcounts'] = intval($tfCounts);
$csvData['ioscount'] = $iosCount;
$csvData['tfcounts'] = intval($tfCounts).'('.$tfpercent.'%)';
$csvData['supercounts'] = intval($superCounts);
$csvData['companycounts'] = intval($companyCounts);
@ -2435,7 +2483,7 @@ public function iosDetailExcelInfo($id,$map) {
}
if ($promote['level'] == 2) {
$parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select();
$csvData['belongs_president'] = $parentPromote['account'];
$csvData['belongs_president'] = $parentPromote[0]['account'];
$csvData['belongs_department'] = $promote['account'];
$csvData['belongs_group'] = "无所属组长";
}
@ -2467,7 +2515,8 @@ public function iosDetailExcelInfo($id,$map) {
}
$allData['account'] = '汇总';
$allData['userscounts'] = $allUsersCounts;
$allData['tfcounts'] = $allTFCounts;
$allData['iosycounts'] = $allIosCounts;
$allData['tfcounts'] = $allTFCounts.'('.(number_format((intval($allTFCounts) / intval($allUsersCounts)),2,'.','') * 100).'%)';
$allData['supercounts'] = $allSuperCounts;
$allData['companycounts'] = $allCompanyCounts;

@ -232,23 +232,64 @@ class PromoteController extends BaseController
$this->assign("rules", $rules);
$this->assign("rules_count", count($rules));
$redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
$cacheKey = "pop:rule:set";
if (!$redis->sIsMember($cacheKey, get_pid())) {
$currentTime = strtotime(date('Y-m-d'));
$weekArray = [7,1,2,3,4,5,6];
$week = $weekArray[date("w")];
$match_rules = M("document_pop_rules")
->field('id')
->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week})")
->order("sort asc, id desc")
->select();
} else {
$promoteBelong = M('promote', 'tab_')->where(['id'=>get_pid()])->getField('company_belong');
if ($promoteBelong == 1 || $promoteBelong == 2) {
$compang_belongs = 1;
}else {
$compang_belongs = 2;
}
$belongs = M("document_pop_rules")
->where(['belongs' => $compang_belongs])->count();
if (intval($belongs) > 0) {
$redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
$cacheKey = "pop:rule:set";
if (!$redis->sIsMember($cacheKey, get_pid())) {
$currentTime = strtotime(date('Y-m-d'));
$weekArray = [7,1,2,3,4,5,6];
$week = $weekArray[date("w")];
$match_rules = M("document_pop_rules")
->field('id,document_route,pop_time')
->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week}) or (type = 2 and pop_time = 8)")
->order("sort asc, id desc")
->select();
} else {
$match_rules = [];
}
}else {
$match_rules = [];
}
// if (intval($promoteBelong) == $belongs_tag) {
// $redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
// $newcacheKey = "pop:newrule:set";
// if (!$redis->sIsMember($newcacheKey, get_pid())) {
// $currentTime = strtotime(date('Y-m-d'));
// $weekArray = [7,1,2,3,4,5,6];
// $week = $weekArray[date("w")];
// $match_newrules = M("document_pop_rules")
// ->field('id')
// ->where(['id' => 2])
// ->order("sort asc, id desc")
// ->select();
// } else {
// $match_newrules = [];
// }
// } else {
// $match_newrules = [];
// }
// $match_newrules_route = M("document_pop_rules")
// ->where(['id' => 2])
// ->getField('document_route');
$this->assign("match_rules_id", $match_rules ? json_encode(array_column($match_rules, 'id')) : 'null');
//$this->assign("match_newrules_id", $match_newrules ? json_encode(array_column($match_newrules, 'id')) : 'null');
$this->assign("match_rules_route", $match_rules ? json_encode(array_column($match_rules, 'document_route')) : 'null');
$this->assign("pop_time1", $match_rules ? json_encode(array_column($match_rules, 'pop_time')) : 'null');
$this->assign("user_count", $user_count);
$this->assign("total_money", $total_money);
@ -276,8 +317,40 @@ class PromoteController extends BaseController
$this->display();
}
public function popRuleDetail($id=0, $p=1, $row=1, $force=false)
public function popRuleDetail($id=0, $p=1, $row=1, $force=false, $pop = false)
{
$promoteBelong = M('promote', 'tab_')->where(['id'=>get_pid()])->getField('company_belong');
if ($promoteBelong == 1 || $promoteBelong == 2) {
$belongs = 1;
}else {
$belongs = 2;
}
$map1['id'] = ['in', $id];
$map1['belongs'] = $belongs;
$result = M("document_pop_rules")->where($map1)->page($p, $row)->select();
if (empty($result)) {
return $this->error("未找到数据", [], true);
}
$count = M("document_pop_rules")->where($map1)->count();
if ($p + 1 <= $count) {
$this->assign("next_page",$p+1);
}
if ($p - 1 >= 0) {
$this->assign("preview_page",$p-1);
}
if ($p + 1 > $count) {
$this->assign("close_btn", true);
}
$this->assign("count", $count);
$this->assign("force", $force);
$this->assign("pop", $pop);
// return $this->success("获取数据成功", $result, true);
//$this->show("<h2 style='text-align: center;'>{$result['title']}</h2>".$result['content']);
$this->assign("rule",$result[0]);
$this->display('pop_rule_detail');
}
public function popNewRuleDetail($id=0, $p=1, $row=1, $force=false) {
$result = M("document_pop_rules")->where("id in ({$id})")->page($p, $row)->select();
if (empty($result)) {
return $this->error("未找到数据", [], true);
@ -297,10 +370,24 @@ class PromoteController extends BaseController
// return $this->success("获取数据成功", $result, true);
//$this->show("<h2 style='text-align: center;'>{$result['title']}</h2>".$result['content']);
$this->assign("rule",$result[0]);
$this->display('pop_rule_detail');
$this->display('pop_newrule_detail');
}
public function popNewRuleFinish()
{
$redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
$cacheKey = "pop:newrule:set";
if ($redis->exists($cacheKey)) {
$redis->sadd($cacheKey, get_pid());
} else {
$redis->sadd($cacheKey, get_pid());
$redis->exprieAt($cacheKey, strtotime('next sunday') + 24*3600);
}
return $this->success("成功", [], true);
}
public function popRuleFinish()
public function popRuleFinish($pop = false)
{
$redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
$cacheKey = "pop:rule:set";
@ -308,7 +395,12 @@ class PromoteController extends BaseController
$redis->sadd($cacheKey, get_pid());
} else {
$redis->sadd($cacheKey, get_pid());
$redis->exprieAt($cacheKey, strtotime(date('Y-m-d')) + 86400);
if ($pop) {
$redis->exprieAt($cacheKey, strtotime('next sunday') + 24*3600);
}else {
$redis->exprieAt($cacheKey, strtotime(date('Y-m-d')) + 86400);
}
}
return $this->success("成功", [], true);
}
@ -2049,7 +2141,7 @@ class PromoteController extends BaseController
$gameId = $_POST['game_id'];
$promoteId = $_POST['promote_id'];
$applyService = new ApplyService();
$applyService->cancelGame($gameId, $promoteId);
$applyService->offlineGame($gameId, $promoteId);
recordPromoteLogs('游戏管理','专服管理下架游戏');
$this->ajaxReturn(['status' => true, 'msg' => '下架成功']);
}

@ -2491,46 +2491,53 @@ class QueryController extends BaseController
}
public function iosDownLoadData() {
$page = intval(I('get.p', 1));
$page = $page ? $page : 1; //默认显示第一页数据arraypage
$row = intval(I('get.row', 10));
$levelPromote = $this->getLevelPromote();
$queryPromote = $this->getQueryPromote($levelPromote);
$localId = $queryPromote['id'];
$loginPromote = $this->getLoginPromote();
$map = [];
if ($queryPromote['level'] == 4) {
$map['id'] = $queryPromote['id'];
}else {
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '/%'];
$map['chain'] = ['like', $queryPromote['chain'] . $queryPromote['id'] . '%'];
}
$createTime = I('create_time', '');
if ($createTime != '') {
$createTimeRow = explode(' 至 ', $createTime);
$createTimeBegin = 0;
$createTimeEnd = 0;
if (count($createTimeRow) == 2) {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59');
} else {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
}
$tfMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$companyMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$superMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$iostime = time();
$sunday = strtotime('-1 sunday', $iostime) + 24 * 3600;
if (I('begtime') && I('endtime')) {
$iostime = strtotime(I('endtime'));
}
$iosTimeMap['register_time'] = ['between', [$sunday, $iostime]];
$createTime = I('create_time', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24;
$tfMap['create_time'] = ['between', [$begTime, $endTime]];
$companyMap['create_time'] = ['between', [$begTime, $endTime]];
$superMap['create_time'] = ['between', [$begTime, $endTime]];
$map10['register_time'] = ['between', [$begTime, $endTime]];
//var_dump($map);die();
$query = M('promote', 'tab_')->field(['id'])->where($map);
list($promotes, $pagination, $count) = $this->paginate($query);
$ids = array_column($promotes, 'id');
if ($page == 1) {
if ($localId !== PID && !in_array($localId, $ids)) {
array_push($ids, $localId);
}
if ($page == 1 && !in_array(PID, $ids)) {
array_push($ids, PID);
}
// var_dump($ids);die();
// $ids = M('promote', 'tab_')->where($map)->getField('id', true);
// $ids[] = $queryPromote['id'];
$allPromote = M('promote', 'tab_')->field(['id'])->where($map)->select();
$allids = array_column($allPromote, 'id');
if ($localId !== PID) {
array_push($allids, $localId);
}
array_push($allids, PID);
$map = [];
$map['tab_package_download_log.promote_id'] = ['in', $ids];
@ -2538,13 +2545,23 @@ class QueryController extends BaseController
// $data = M('package_download_log','tab_')->where($map)->select();
$listData = [];
$allUserMap['promote_id'] = ['in', $allids];
$allUserMap['device_type'] = 2;
$allUserMap['register_time'] = ['between', [$begTime, $endTime]];
$allTFMap['promote_id'] = ['in', $allids];
$allTFMap['type'] = 2;
$allTFMap['create_time'] = ['between', [$begTime, $endTime]];
$allSuperMap['promote_id'] = ['in', $allids];
$allSuperMap['type'] = 3;
$allSuperMap['create_time'] = ['between', [$begTime, $endTime]];
$companyMap['promote_id'] = ['in', $allids];
$companyMap['type'] = 1;
$companyMap['create_time'] = ['between', [$begTime, $endTime]];
$alliosMap['promote_id'] = ['in', $allids];
$alliosMap['device_type'] = 2;
$alliosMap['register_time'] = ['between', [$sunday, $iostime]];
$allUsersCounts = M('user', 'tab_')->where($allUserMap)->count();
$allIosCounts = M('user', 'tab_')->where($alliosMap)->count();
$allTFCounts = M('package_download_log', 'tab_')->where($allTFMap)->count();
$allSuperCounts = M('package_download_log', 'tab_')->where($allSuperMap)->count();
$allCompanyCounts = M('package_download_log', 'tab_')->where($companyMap)->count();
@ -2559,6 +2576,10 @@ class QueryController extends BaseController
}else {
$listData[$key]['account'] = $promote['account'];
}
$iosTimeMap['promote_id'] = $id;
$iosTimeMap['device_type'] = 2;
$iosCount = M('user', 'tab_')->where($iosTimeMap)->count();
$listData[$key]['ioscount'] = $iosCount;
$tfMap['promote_id'] = $id;
$tfMap['type'] = 2;
$companyMap['promote_id'] = $id;
@ -2568,11 +2589,18 @@ class QueryController extends BaseController
$tfCounts = M('package_download_log', 'tab_')->where($tfMap)->count(); //TF下载量
$companyCounts = M('package_download_log', 'tab_')->where($companyMap)->count(); //企业签下载量
$superCounts = M('package_download_log', 'tab_')->where($superMap)->count(); //超级签下载量
$listData[$key]['tfcounts'] = intval($tfCounts);
$listData[$key]['companycounts'] = intval($companyCounts);
$listData[$key]['supercounts'] = intval($superCounts);
$usersCounts = M('user', 'tab_')->where(['promote_id' => $id])->count();
$map10['promote_id'] = $id;
$map10['device_type'] = 2;
$usersCounts = M('user', 'tab_')->where($map10)->count();
$listData[$key]['userscounts'] = intval($usersCounts);
$listData[$key]['tfcounts'] = intval($tfCounts);
$listData[$key]['tfpercent'] = number_format((intval($tfCounts) / intval($usersCounts)),2,'.','') * 100;
if (intval($usersCounts) == 0) {
$listData[$key]['tfpercent'] = 0;
}
if($promote['level'] == 1) {
$listData[$key]['belongs_president'] = $promote['account'];
$listData[$key]['belongs_department'] = "无所属部门长";
@ -2580,7 +2608,7 @@ class QueryController extends BaseController
}
if ($promote['level'] == 2) {
$parentPromote = M('promote', 'tab_')->field('account')->where(['id'=>$promote['parent_id']])->select();
$listData[$key]['belongs_president'] = $parentPromote['account'];
$listData[$key]['belongs_president'] = $parentPromote[0]['account'];
$listData[$key]['belongs_department'] = $promote['account'];
$listData[$key]['belongs_group'] = "无所属组长";
}
@ -2603,13 +2631,21 @@ class QueryController extends BaseController
$listData[$key]['belongs_group'] = $groupAccount;
}
}
$totalpercent = number_format($allTFCounts/$allUsersCounts,2,'.','') * 100;
if ($allUsersCounts == 0) {
$totalpercent = '0';
}
$this->assign('totalpercent', $totalpercent);
$this->assign('listdata', $listData);
$this->assign('totaluserscounts', $allUsersCounts);
$this->assign('totaltfcounts', $allTFCounts);
$this->assign('totalsupercounts', $allSuperCounts);
$this->assign('pagination', $pagination);
$this->assign('totalcompanycounts', $allCompanyCounts);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->assign('allIosCounts', $allIosCounts);
$this->assign('tfpercent', $tfpercent);
$this->display();
}
@ -2618,23 +2654,22 @@ class QueryController extends BaseController
$belongs_president = $_REQUEST['belongs_president'];
$belongs_department = $_REQUEST['belongs_department'];
$belongs_group = $_REQUEST['belongs_group'];
$createTime = I('create_time', '');
if ($createTime != '') {
$createTimeRow = explode(' 至 ', $createTime);
$createTimeBegin = 0;
$createTimeEnd = 0;
if (count($createTimeRow) == 2) {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[1] . ' 23:59:59');
} else {
$createTimeBegin = strtotime($createTimeRow[0] . ' 00:00:00');
$createTimeEnd = strtotime($createTimeRow[0] . ' 23:59:59');
}
$map['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$tfMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$superMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
$companyMap['create_time'] = ['between', [$createTimeBegin, $createTimeEnd]];
}
// $createTime = I('create_time', '');
$nowTime = date('Y-m-d');
$initBegTime = date('Y-m-d', strtotime('-6 day', strtotime($nowTime)));
$initBegTime = empty(I('begtime')) ? $initBegTime : I('begtime');
$initEndTime = $nowTime;
$initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime');
$begTime = strtotime($initBegTime);
$endTime = strtotime($initEndTime);
$endTime += 3600 * 24;
$map['create_time'] = ['between', [$begTime, $endTime]];
$tfMap['create_time'] = ['between', [$begTime, $endTime]];
$superMap['create_time'] = ['between', [$begTime, $endTime]];
$companyMap['create_time'] = ['between', [$begTime, $endTime]];
if(!empty(I('user_account'))) {
$user_id = M('user', 'tab_')->where(['account'=>I('user_account')])->getField('id');
$map['user_id'] = $user_id;
@ -2692,6 +2727,8 @@ class QueryController extends BaseController
$this->assign('belongs_group', $belongs_group);
$this->assign('pagination', $pagination);
$this->assign('datas', $packAges);
$this->assign('initBegTime', $initBegTime);
$this->assign('initEndTime', $initEndTime);
$this->display();
}
}

@ -204,6 +204,7 @@
</empty>
</table>
</div>
<input type="hidden" id = "a" value="{$match_rules_route}">
<div class="pagenation clearfix">
{$_page}
</div>
@ -215,6 +216,15 @@
<script>
var pop_ids = {$match_rules_id};
var match_rules_route ={$match_rules_route};
var pop_time = {$pop_time1};
var pop_time1 = pop_time[0]
if (pop_time1 < 8 ) {
var pop = false;
}else {
var pop = true;
}
console.log(pop_time)
function pop_rulus_content(id, force = false)
{
if (id instanceof Array) {
@ -224,10 +234,45 @@
type: 2,
title: '平台规则',
area:['60%', '80%'],
btn:['下载文档'],
closeBtn: 0,
shadeClose: false,
skin: 'yourclass',
content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force+"&pop="+pop,
yes:function(){window.location.href= match_rules_route[0]},
});
} else {
layer.open({
type: 2,
title: '平台规则',
area:['60%', '80%'],
closeBtn: 0,
shadeClose: false,
skin: 'yourclass',
btn:['下载文档'],
content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force+"&pop="+pop,
end:function(){
return false;
},
yes:function(){window.location.href= match_rules_route[0]},
});
}
}
function pop_newrulus_content(id, force = false)
{
if (id instanceof Array) {
console.log(id)
var index = 0;
layer.open({
type: 2,
closeBtn: 0,
title: '平台规则',
area:['60%', '80%'],
shadeClose: false,
skin: 'yourclass',
content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force
btn:['下载文档'],
content: "{:U('Promote/popNewRuleDetail')}&id="+id+"&force="+force,
yes:function(){window.location.href= match_newrules_route},
});
} else {
layer.open({
@ -237,8 +282,8 @@
closeBtn: 0,
shadeClose: false,
skin: 'yourclass',
//btn:['返回'],
content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force,
btn:['下载文档'],
content: "{:U('Promote/popNewRuleDetail')}&id="+id+"&force="+force,
end:function(){
return false;
}

@ -0,0 +1,123 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>充值查询列表|----软件管理平台</title>
<link href="http://admin.vlcms.com/Public/icon.ico" type="image/x-icon" rel="shortcut icon">
<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__/module.css">
<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 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__/jquery.mousewheel.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
</head>
<style>
html {
min-width:100%;
}
body {
padding: 0px;
}
.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;}
* {
margin: 0;
padding: 0;
}
footer {
background-color: white;
position:fixed;
bottom:0px;
width: 100%;
}
</style>
<body>
<div id="main" class="main" style="min-height: 342px;width: 96%;">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/admin_table.css" media="all">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<h2 style="text-align: center;">{$rule.title}</h2>
<div>{$rule.content}</div>
</div>
</body>
<footer>
<div style="text-align: right;margin-right: 10px;">
<?php if ($close_btn):?>
<a onclick="<?php if ($force):?>checkClose();<?php else:?>parent.layer.closeAll();<?php endif;?>" class="submit btn" style="line-height: 15px"><i class="add_qudao"></i><span>关闭</span></a>
<?php endif;?>
</div>
</footer>
<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>
var isAble = false;
var force = '{$force}';
setTimeout(function (){
isAble = true;
}, 5000);
function checkClose()
{
if (isAble == false) {
layer.msg("请浏览5秒后再点击111");
return false;
} else {
// 查看完成
$.ajax({
url:"{:U('Promote/popNewRuleFinish')}",
method : "POST",
success:function(){
parent.layer.closeAll();
}
});
return true;
}
}
function checkJump(url)
{
if (isAble == false) {
layer.msg("请浏览5秒后再点击");
return false;
} else {
window.location.href = url;
return true;
}
}
</script>
</html>

@ -91,7 +91,7 @@
<script>
var isAble = false;
var force = '{$force}';
var pop = '{$pop}';
setTimeout(function (){
isAble = true;
}, 5000);
@ -106,6 +106,7 @@
$.ajax({
url:"{:U('Promote/popRuleFinish')}",
method : "POST",
data: {'pop':pop},
success:function(){
parent.layer.closeAll();
}

@ -10,6 +10,9 @@
line-height: 34px;
height: 34px;
}
.pointer-hand {
cursor: pointer;
}
</style>
</block>
<block name="body">
@ -25,9 +28,15 @@
<div class="trunk-content article">
<div class="trunk-search clearfix jssearch">
<include file="Public/promote_select" />
<div class="form-group normal_space fr">
<label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
<div class="form-group normal_space fr" style="display: flex;">
<label class="form-title select-title" style="position: relative;">创建时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/iosDownLoadData','model='.$model['name'],false)}"
@ -38,8 +47,9 @@
<table class="table normal_table">
<tr class="odd">
<th>推广员账号</th>
<th>玩家人数</th>
<th>TF下载次数</th>
<th>IOS用户总数</th>
<th>新增IOS用户总数</th>
<th class="pointer-hand" title="TF下载次数/IOS用户总数">TF下载次数</th>
<th>超级签下载次数</th>
<th>企业签下载次数</th>
<th>所属会长</th>
@ -54,7 +64,8 @@
<tr>
<td>{$data.account}</td>
<td>{$data.userscounts}</td>
<td>{$data.tfcounts}</td>
<td>{$data.ioscount}</td>
<td>{$data.tfcounts}({$data.tfpercent}%)</td>
<td>{$data.supercounts}</td>
<td>{$data.companycounts}</td>
<td>{$data.belongs_president}</td>
@ -68,7 +79,8 @@
<tr>
<td>汇总(所有数据)</td>
<td>{$totaluserscounts}</td>
<td>{$totaltfcounts}</td>
<td>{$allIosCounts}</td>
<td>{$totaltfcounts}({$totalpercent}%)</td>
<td>{$totalsupercounts}</td>
<td>{$totalcompanycounts}</td>
<td></td>
@ -99,23 +111,58 @@
</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>
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<script src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script>
setValue('row', '{:I("get.row",10)}');
$(".select_gallery").select2();
var date = "{$setdate}";
console.log(date);
$('#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
});
</script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
//defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
// $('.range-date').flatpickr({
// mode: 'range',
// locale: 'zh',
// dateFormat: "Y-m-d",
// defaultDate: defaultDate,
// })
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();

@ -35,9 +35,19 @@
<option value="3" <if condition="I('type') === '3'">selected</if>>超级签下载</option>
</select>
</div>
<div class="form-group normal_space fr">
<!-- <div class="form-group normal_space fr">
<label>创建时间:</label>
<input type="text" class="txt range-date" name="create_time" placeholder="创建时间" value="{:I('create_time')}" >
</div> -->
<div class="form-group normal_space fr" style="display: flex;">
<label class="form-title select-title" style="position: relative;">创建时间:</label>
<div class="select-time">
<input type="text" readonly id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{$initBegTime}">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" readonly id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
<div class="form-group normal_space">
<input type="submit" class="submit" id='submit' url="{:U('Query/iosDownLoadDetail',['promote_id'=>$promote_id,'belongs_president'=>$belongs_president, 'belongs_department'=>$belongs_department, 'belongs_group'=>$belongs_group])}"
@ -79,7 +89,7 @@
</div>
<div class="pagenation clearfix">
<?php if ($loginer['level'] !== 4) :?>
<a id="sch-btn" data-href="{:U('download/iosdetail_data_export',array_merge(['xlsname'=>'ceshi'],I('get.')))}" class="ajax-get">导出</a>
<a id="sch-btn" data-href="{:U('download/iosdetail_data_export',array_merge(['xlsname'=>'ceshi','begtime'=>$initBegTime,'endtime'=>$initEndTime],I('get.')))}" class="ajax-get">导出</a>
<?php endif ;?>
{$pagination}
</div>
@ -95,22 +105,57 @@
</block>
<block name="script">
<link rel="stylesheet" href="__STATIC__/flatpickr/flatpickr.min.css">
<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 src="__STATIC__/flatpickr/flatpickr.min.js"></script>
<script src="__STATIC__/flatpickr/l10n/zh.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript" src="__JS__/common.js"></script>
<script>
setValue('row', '{:I("get.row",10)}');
$(".select_gallery").select2();
var date = "{$setdate}";
console.log(date);
$('#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
});
</script>
<script type="text/javascript">
$(function() {
setValue('row', '{:I("get.row",10)}');
var defaultDate = $('.range-date').val()
defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
$('.range-date').flatpickr({
mode: 'range',
locale: 'zh',
dateFormat: "Y-m-d",
defaultDate: defaultDate,
})
// var defaultDate = $('.range-date').val()
// defaultDate = defaultDate == '' ? [] : defaultDate.split(' 至 ')
// $('.range-date').flatpickr({
// mode: 'range',
// locale: 'zh',
// dateFormat: "Y-m-d",
// defaultDate: defaultDate,
// })
$('.select_gallery').select2()
var gameId = $('#game-select').val();
var sdkVersion = $('#sdk_version').val();

@ -6,6 +6,7 @@ use User\Api\SuserApi;
use Think\Log;
use Base\Service\ApplyService;
use Base\Tool\TaskClient;
use Base\Facade\Request;
class CommonController extends BaseController {
const USER_NOT_ILLEGAL = -1; //用户名不合法
@ -208,6 +209,8 @@ class CommonController extends BaseController {
}
}
$data = [
'account' => $account,
'password' => think_ucenter_md5($password, UC_AUTH_KEY),
@ -222,8 +225,14 @@ class CommonController extends BaseController {
'parent_name' => get_parent_name($promote_id),
'register_time' => time(),
'check_time' => time(),
];
if (Request::isIOS()) {
$data['device_type'] = 2;
} elseif (Request::isAndroid()) {
$data['device_type'] = 1;
}
if ($game_id) {//关联游戏
$game = M('game', 'tab_')->where(['id' => $game_id])->find();
if ($game) {

@ -7,6 +7,7 @@ use Base\Tool\TaskClient;
use Think\Log;
use Base\Service\GameService;
use Base\Service\PackageDownloadLogService;
use Base\Facade\Request;
class SsgController extends BaseController {
const USER_NOT_ILLEGAL = -1; //用户名不合法
@ -293,8 +294,14 @@ class SsgController extends BaseController {
'parent_name'=>get_parent_name($promote_id),
'register_time'=>time(),
'check_time' => time(),
);
if (Request::isIOS()) {
$data['device_type'] = 2;
} elseif (Request::isAndroid()) {
$data['device_type'] = 1;
}
if ($game_id) {//关联游戏
$game = M('game', 'tab_')->where(['id' => $game_id])->find();
if ($game) {

@ -0,0 +1 @@
Subproject commit 4c40f58e6c0c9afe8a505f404b4df11a98f15653
Loading…
Cancel
Save