master
ELF 5 years ago
parent 381a2e0a67
commit 689cc08b69

@ -1 +1 @@
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":0,"active":0,"player":0,"money":0},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]}
{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":21},{"time":"17:00","count":10},{"time":"18:00","count":7},{"time":"19:00","count":11},{"time":"20:00","count":11},{"time":"21:00","count":8},{"time":"22:00","count":11},{"time":"23:00","count":10}],"sum":{"news":89,"active":2506,"player":378,"money":33093},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":851},{"time":"17:00","count":280},{"time":"18:00","count":142},{"time":"19:00","count":105},{"time":"20:00","count":81},{"time":"21:00","count":143},{"time":"22:00","count":420},{"time":"23:00","count":484}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":179},{"time":"17:00","count":54},{"time":"18:00","count":28},{"time":"19:00","count":24},{"time":"20:00","count":14},{"time":"21:00","count":12},{"time":"22:00","count":27},{"time":"23:00","count":40}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":"15639.00"},{"time":"17:00","count":"5328.00"},{"time":"18:00","count":"5490.00"},{"time":"19:00","count":"1178.00"},{"time":"20:00","count":"1274.00"},{"time":"21:00","count":"484.00"},{"time":"22:00","count":"2327.00"},{"time":"23:00","count":"1373.00"}]}

@ -155,6 +155,11 @@ class PromoteService {
}
public function shiftPromote($task)
{
}
public function shiftChildPromote($task)
{
$model = new Model();
$model->startTrans();
@ -162,19 +167,14 @@ class PromoteService {
$coinRecordService = new PromoteCoinRecordService();
$promoteCoinService = new PromoteCoinService();
$toPromoteId = $task['to_promote_id'];
$fromPromoteId = $task['from_promote_id'];
$balanceCoinMode = $task['balance_coin_mode'];
$toPromote = D('promote')->where(['id' => $toPromoteId])->find();
$fromPromote = D('promote')->where(['id' => $fromPromoteId])->find();
$toPromote = M('promote', 'tab_')->where(['id' => $task['to_promote_id']])->find();
$fromPromote = M('promote', 'tab_')->where(['id' => $task['from_promote_id']])->find();
$topPromote = $this->getTopPromote($fromPromote);
$status = $this->shiftRemoveCoin($fromPromote, $topPromote, $task);
// 测试
// $model->rollback();
if (!$status) {
$model->rollback();
return ['status' => false, 'msg' => '系统异常2'];

@ -0,0 +1,17 @@
<?php
namespace Home\Controller;
use OT\DataDictionary;
use User\Api\PromoteApi;
use Base\Repository\PromoteRepository;
use Base\Repository\SpendRepository;
use Base\Repository\UserRepository;
/**
* 财务管理
*/
class FinanceController extends BaseController
{
}

@ -909,7 +909,6 @@ class PromoteController extends BaseController
list($records, $pagination, $count) = $this->paginate($query);
$ids = array_column($records, 'id');
$parentIds = array_column($records, 'parent_id');
$countList = [];
$playerList = [];
@ -920,10 +919,10 @@ class PromoteController extends BaseController
$playerList = M('user_play', 'tab_')->field(['count(*)' => 'count', 'promote_id' => 'promote_id'])->where(['promote_id' => ['in', $ids]])->group('promote_id')->select();
$shiftList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 1, 'promote_id' => ['in', $ids]])->group('from_promote_id')->select();
$shiftPlayerList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 2, 'promote_id' => ['in', $ids]])->group('from_promote_id')->select();
$countList = array_column($countList, 'parent_id');
$playerList = array_column($playerList, 'promote_id');
$shiftList = array_column($shiftList, 'from_promote_id');
$shiftPlayerList = array_column($shiftPlayerList, 'from_promote_id');
$hasChildList = array_column($countList, 'parent_id');
$hasPlayerList = array_column($playerList, 'promote_id');
$hasShiftList = array_column($shiftList, 'from_promote_id');
$hasShiftPlayerList = array_column($shiftPlayerList, 'from_promote_id');
}
if ($promoteType == 0) {
@ -935,10 +934,10 @@ class PromoteController extends BaseController
}
$this->assign('promoteTypeName', $promoteTypeName);
$this->assign('countList', $countList);
$this->assign('playerList', $playerList);
$this->assign('shiftList', $shiftList);
$this->assign('shiftPlayerList', $shiftPlayerList);
$this->assign('hasChildList', $hasChildList);
$this->assign('hasPlayerList', $hasPlayerList);
$this->assign('hasShiftList', $hasShiftList);
$this->assign('hasShiftPlayerList', $hasShiftPlayerList);
$this->assign('count', $count);
$this->assign('pagination', $pagination);
$this->assign('records', $records);
@ -2262,6 +2261,26 @@ class PromoteController extends BaseController
$this->display();
}
}
public function getSubPromotes()
{
$level = I('level', 0);
$promoteId = I('promote_id', 0);
$promote = $this->getLoginPromote();
if ($promoteId > 0) {
$promote = M('promote', 'tab_')->where(['id' => $promoteId])->find();
}
$map = ['chain' => ['like', $promote['chain'] . $promote['id'] . '/%']];
if ($level > 0) {
$map['level'] = $level;
}
$promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where($map)->select();
$this->ajaxReturn([
'status' => 1,
'msg' => '成功',
'data' => ['promotes' => $promotes]
]);
}
}

@ -13,7 +13,8 @@
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix">
<form action="{:U('Promote/mychlid',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<form action="{:U('Promote/children',array('row'=>I('get.row')))}" method="post" enctype="multipart/form-data">
<input type="hidden" name="promote_type" value="{:I('promote_type', 0)}">
<div class="form-group fl normal_space">
<a href="{:U('Promote/addPromote', ['promote_type' => I('promote_type', 0)])}" class="submit btn"><i class="add_qudao"></i><span>添加{$promoteTypeName}</span></a>
</div>
@ -137,9 +138,6 @@
<div class="form-item">
<select name="to_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广账号</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
</volist>
</select>
</div>
</div>
@ -175,10 +173,7 @@
<label>转移至推广账号</label>
<div class="form-item">
<select name="to_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广账号</option>
<volist name="subPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
</volist>
<option value="0">请选择推广账号</option>
</select>
</div>
</div>
@ -205,6 +200,30 @@
$(function(){
$(".select_gallery").select2();
var promoteType = $('input[name=promote_type]').val()
var level = 0
if (promoteType == 0) {
level = 2
} else if (promoteType == 1) {
level = 3
} else if (promoteType == 2) {
level = 4
}
$.ajax({
url: "{:U('Promote/getSubPromotes')}",
data: {level: level},
type: 'post',
dataType: 'json',
success: function(response) {
var options = '<option value="0">请选择推广账号</option>'
for (var i in response.data.promotes) {
var promote = response.data.promotes[i]
options += '<option value="' + promote.id + '">' + promote.account + '(' + promote.real_name + ')' + '</option>'
}
$('select[name=to_promote_id]').html(options)
}
})
$('#shift-player-order-time').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
@ -378,6 +397,7 @@ $(function(){
})
}
})
$('.shift-player-btn').on({
click: function() {

Loading…
Cancel
Save