master
ELF 4 years ago
parent 55c1b393e1
commit 8440c5d384

@ -3278,3 +3278,13 @@ function array_repeat($array,$keyid="id",$desc=false)
}
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);
}

@ -1,6 +1,8 @@
<?php
namespace Admin\Controller;
use Base\Service\MendService;
use User\Api\UserApi as UserApi;
use Base\Service\PromoteService as PromoteService;
@ -69,7 +71,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 +81,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 +91,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 +116,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 +262,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();
}

@ -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 ">
<?php if (is_null($mend)):?>
<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 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();" >

@ -0,0 +1,93 @@
<?php
namespace Base\Service;
class MendService
{
public static $statusList = [
0 => '处理中',
1 => '处理成功',
2 => '处理失败',
];
public function getStatusText($status)
{
return self::$statusList[$status] ?? '未知';
}
public function addMendTask($params, $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 ($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);
}

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

@ -0,0 +1,110 @@
<?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();
$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];
}
$promoteService = new PromoteService();
$subInSql = $promoteService->subInSql($loginer);
$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'. $loginer['level'] . '_id';
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $loginer['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();
$levelColumn = 'level'. $loginer['level'] . '_id';
$promote = M('promote', 'tab_')->where(['id' => $user['promote_id']])->where([$levelColumn => $loginer['id']])->find();
if (!$promote) {
return $this->error('所属推广员异常');
}
$promotes = M('promote', 'tab_')->field(['id', 'account'])->where([$levelColumn => $loginer['id']])->select();
$this->meta_title = '玩家补链';
$this->assign('user', $user);
$this->assign('promotes', $promotes);
$this->display();
}
public function save()
{
$params = I('post.');
$loginer = $this->getLoginPromote();
$service = new MendService();
try {
$service->addMendTask($params, $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']);
}
@ -1786,6 +1786,7 @@ class QueryController extends BaseController
}
$columns = [
'role.user_id',
'user_account',
'role.promote_account',
'role.game_name',

@ -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('Query/userRoles')}";
}, 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>

Loading…
Cancel
Save