Merge branch 'feature/promote' of 47.111.118.107:/srv/git/platform into feature/promote

master
ELF 5 years ago
commit e853fc1c3e

@ -58,9 +58,9 @@ class MendController extends ThinkController {
public function edit($id = null)
{
// $promoteService = new PromoteService();
if (IS_POST) {
$promoteService = new PromoteService();
if ($_POST['prmoote_id_to'] == -1){
$_POST['prmoote_id_to'] = 0;
}
@ -70,44 +70,27 @@ class MendController extends ThinkController {
if ($_POST['promote_id'] == $_POST['prmoote_id_to']) {
$this->error('没有变更数据');
}
if ($_POST['order_time'] == '') {
$this->error('没有订单日期');
}
$create = $_REQUEST;
dump($create);
$map['id'] = $create['user_id'];
$map_['user_id'] = $create['user_id'];
$data['promote_id'] = $create['prmoote_id_to'];
$data['promote_account'] = get_promote_name($create['prmoote_id_to']);
// 加入补链时间
$data['rebind_time'] = $create['rebind_time'];
dump($data);
$user_data = $data;
$promote = M('promote', 'tab_')->where(array("id"=>I('prmoote_id_to')))->find();
if ($promote['parent_id'] != "0") {
$ppromote = M('promote', 'tab_')->where(array("id"=>$promote['parent_id']))->find();
$user_data['parent_id']=$ppromote['id'];
$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']],
);
if(!empty($create['remark'])){
$params['remark'] = $create['remark'];
}
$res = $promoteService->addShiftTask($params);
if($res['status']){
$this->success('补链成功', U('lists'), 2);
}else{
$user_data['parent_id'] = 0;
$this->error($res['msg']);
}
$user_data['parent_name']=get_promote_name($user_data['parent_id']);
// $user = M('user', 'tab_')->where($map)->save($user_data);
// $user_ = M('UserPlay', 'tab_')->where($map_)->save($data);
// $puser_ = M('UserPlayInfo', 'tab_')->where($map_)->save($data);
// $spend = M('Spend', 'tab_')->where($map_)->where(array('is_check'=>array('in','1,2')))->save($data);// spend只改未对账的数据
// $depost = M('Deposit', 'tab_')->where($map_)->save($data);
// $Bind_spend = M('Bind_spend', 'tab_')->where($map_)->save($data);
// $create['user_account'] = get_user_account($create['user_id']);
// $create['promote_account'] = get_promote_name($create['promote_id']);
// $create['promote_id_to'] = $create['prmoote_id_to'];
// $create['promote_account_to'] = get_promote_name($create['prmoote_id_to']);
// $create['create_time'] = time();
// $create['op_id'] = UID;
// $create['op_account'] = session('user_auth.username');
// $create['bind_type'] = $create['bind_type'];
// $mend = M('mend', 'tab_')->add($create);
// if ($mend) {
// $this->success('补链成功', U('lists'), 2);
// }
} else {
$user = A('User', 'Event');
$user_data = $user->user_entity($id);
@ -123,6 +106,30 @@ class MendController extends ThinkController {
$this->display();
}
}
//补链详情
public function shiftInfo()
{
$id = I('id');
$info = M("shift_task")->where("id = {$id} and status = 0")->find();
if(empty($info)){
$this->error("补链不存在或已处理");
}
$info['user_id'] = json_decode($info['shift_ids'])[0];
$info['order_time'] = date("Y-m-d",$info['order_time']);
$this->assign('data',$info);
$this->display();
}
//取消补链
public function cancelShift()
{
$id = I('id');
$status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]);
if ($status) {
$this->success('取消补链成功', U('lists'), 2);
} else {
$this->error("取消失败,或补链已生效",U('lists'));
}
}
}

@ -84,6 +84,13 @@
</td>
</tr>
<tr>
<td class="l noticeinfo">订单日期:</td>
<td class="r table_radio">
<input type="text" name="order_time" class="date" value="{:I('order_time')}" placeholder="订单日期" />
</td>
</tr>
<tr>
<td class="l noticeinfo">换绑类型</td>
<td class="r table_radio">
@ -159,7 +166,6 @@ Think.setValue("prmoote_id_to", {$data.promote_id|default = "''"});
$('#submit').click(function(){
$('#form').submit();
});
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd hh:ii',

@ -80,7 +80,14 @@
<else/>
{:get_promote_name($data['promote_id'])}
</if></td>
<td><a style="width:100%;text-align:center" href="{:U('Mend/edit?id='.$data['id'])}">补链</a></td>
<td>
<if condition="getIsTask($data['id']) eq 0 ">
<a style="width:100%;text-align:center" href="{:U('Mend/edit?id='.$data['id'])}">补链</a>
<else/>
<a style="width:100%;text-align:center;color: #f00;" href="{:U('Mend/shiftInfo?id='.getIsTask($data['id']))}">补链中</a>
</if>
</td>
</tr>
</volist>
</empty>

@ -0,0 +1,173 @@
<extend name="Public/base" />
<block name="body">
<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>
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.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;}
.tabcon1711 .select2-container--default .select2-selection--single{
font-size: 12px;
color: #555;
vertical-align: middle;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-webkit-transition: border linear .2s, box-shadow linear .2s;
-moz-transition: border linear .2s, box-shadow linear .2s;
-o-transition: border linear .2s, box-shadow linear .2s;
transition: border linear .2s, box-shadow linear .2s;height:30px;}
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__rendered {line-height: 30px;}
.tabcon1711 .select2-container--default .select2-selection--single .select2-selection__arrow {height:30px;}
.tabcon1711 .select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.tabcon1711 .select2-results__option[aria-selected] {font-size:12px;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">推广补链查看</h3>
<p class="description_text">说明:此处功能用于修改玩家所属推广渠道的功能。</p>
</div>
<div class="tab-content tabcon1711">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="l noticeinfo">用户账号</td>
<td class="r table_radio">
<input name="account" value="{:get_promote_name($data['promote_id'])}" 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="">
<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="">
<span class="notice-text"></span>
</td>
</tr>
<tr>
<td class="l noticeinfo">订单日期:</td>
<td class="r table_radio">
<input type="text" readonly value="{$data['order_time']}" placeholder="订单日期" />
</td>
</tr>
<tr>
<td class="l noticeinfo">换绑类型</td>
<td class="r table_radio">
<input name="bind_type" value="1" type="radio">In
<input name="bind_type" value="2" type="radio">Out
</td>
</tr>
<tr>
<td class="l noticeinfo">备注</td>
<td class="r table_radio">
<textarea name="remark" readonly class="txt_area1">{$data['remark']}</textarea>
<span class="notice-text"></span>
</td>
</tr>
</tbody>
</table>
<div class="form-item cf">
<button class="submit_btn mlspacing" id="submit" data-id="{$data.id}">
取消补链
</button>
<a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" >
返回
</a>
</div>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Mend/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">
var start = $("#bind_time").val();
$('#bind_time').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true
});
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
//导航高亮
highlight_subnav('{:U('Mend/lists')}');
Think.setValue("prmoote_id_to", {$data.promote_id|default = "''"});
$('#submit').click(function(){
//获取id
var taskid = $(this).data("id");
window.location.href = "{:U('Mend/cancelShift')}"+"&id="+taskid;
});
$(function(){
$('.time').datetimepicker({
format: 'yyyy-mm-dd hh:ii',
language:"zh-CN",
minView:2,
autoclose:true
});
$('.date').datetimepicker({
format: 'yyyy-mm-dd',
language:"zh-CN",
minView:2,
autoclose:true
});
showTab();
});
</script>
</block>

@ -2836,3 +2836,23 @@ function index_by_column($column, $items)
}
return $records;
}
/**
* [获取用户是否补链中]
* @param integer $user_id [description]
* @return bool
*/
function getIsTask($user_id){
$shift = M("shift_task");
$map=array(
"status"=>0,
"shift_ids"=>array("LIKE","%\"{$user_id}\"%")
);
$shiftres = $shift->field("id")->where($map)->find();
if(empty($shiftres)){
return 0;
}else{
return $shiftres['id'];
}
}

@ -364,14 +364,12 @@ class FinanceController extends BaseController
}
if (isset($_GET['status']) && $_GET['status'] !== '') {
$status = intval($_GET['status']);
if (!isset(FinanceController::$withdrawStatus[$status])) {
if (!isset(FinanceController::$withdrawStatus[$status])) {
$this->error('参数异常');
}
$map['status'] = $status;
}
}
$data = $model->field('id,widthdraw_number,create_time,settlement_end_time,sum_money,status,respond')
->where($map)
@ -485,4 +483,48 @@ class FinanceController extends BaseController
$this->assign('modelList', $modelList);
$this->display();
}
//结算单
public function settlementOrder()
{
//是否是会长
$this->purview();
//验证安全密码
$metaTitle = '结算单';
$modelList = ['财务管理', '提现记录', $metaTitle];
$this->verifyPasswordView($modelList);
$model = M('withdraw', 'tab_');
$withdrawId = intval(I('get.id', 0));
if ($withdrawId == 0) {
$this->error('参数异常');
}
$withdraw = $model->find($withdrawId);
if (empty($withdraw) || $withdraw['promote_id'] != $this->loginPromote['id']) {
$this->error('参数异常');
}
$withdraw['create_time'] = date('Y-m-d H:i:s', $withdraw['create_time']);
$withdraw['settlement_end_time'] = date('Y-m-d H:i:s', $withdraw['settlement_end_time']);
$withdraw['status'] = FinanceController::$withdrawStatus[$withdraw['status']];
$map['withdraw_id'] = $withdrawId;
$data = M('spend', 'tab_')
->field('game_name,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income')
->where($map)
->group('game_id')
->order('game_id')
->select();
if (!empty($data)) {
foreach ($data as &$list) {
$list['income'] = bcdiv($list['income'], 100, 2);
}
}
$this->assign('withdraw', $withdraw);
$this->assign('listData', $data);
$this->assign('promoteData', $this->loginPromote);
$this->assign('meta_title', $metaTitle);
$this->assign('modelList', $modelList);
$this->display();
}
}

@ -0,0 +1,200 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/20180207/platform.css" rel="stylesheet">
<link href="__CSS__/detailed.css" rel="stylesheet">
<link href="__STATIC__/icons_alibaba/iconfont.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;
}
.detailed-content-box {
width: 350px;
}
</style>
</block>
<block name="body">
<div class="page-search normal_list charge-agentPay-search">
<div style="position: absolute;margin-top: -25px;color: #6a7082;">
<span class="back-btn" style="cursor: pointer;"><i class="iconfont iconreply"></i> 返回</span>
</div>
<div class="trunk-title">
<div class="location">
<div class="location-container">当前位置:
<volist name="modelList" id="vo" key="k">
<?php if ($k == count($modelList)) {
echo "<span>$vo</span>";
} else {
echo "<span>$vo></span>";
}?>
</volist>
</div>
</div>
<span class="title_main">订单信息</span>
</div>
<div class="trunk-content article">
<div class="trunk-search clearfix" style="display: grid;">
<div class="tab detailed-box">
<label class="detailed-title detailed-label">提现订单号:</label>
<div class="detailed-content-box">
<span>{$withdraw.widthdraw_number}</span>
</div>
<label class="detailed-title detailed-label">申请时间:</label>
<div class="detailed-content-box">
<span>{$withdraw.create_time}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">会长账号:</label>
<div class="detailed-content-box">
<span>{$withdraw.promote_account}</span>
</div>
<label class="detailed-title detailed-label">结算截止时间:</label>
<div class="detailed-content-box">
<span>{$withdraw.settlement_end_time}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">状态:</label>
<div class="detailed-content-box">
<span>{$withdraw.status}</span>
</div>
<label class="detailed-title detailed-label">收款人:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_account}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">开户行:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_name}</span>
</div>
<label class="detailed-title detailed-label">银行账号:</label>
<div class="detailed-content-box">
<span>{$promoteData.bank_card}</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">收益金额:</label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">奖惩金额:</label>
<div class="detailed-content-box">
<span>0.00</span>
</div>
</div>
<div class="tab detailed-box">
<label class="detailed-title detailed-label">实际提现金额:</label>
<div class="detailed-content-box">
<span>
<if condition="$withdraw.status eq -1">
0.00
<else/>
{$withdraw.sum_money}
</if>
<span style="color: red;">(实际提现金额=提现金额+奖惩金额)</span>
</span>
</div>
</div>
</div>
</div>
<div class="trunk-title">
<span class="title_main">结算汇总</span>
</div>
<div class="trunk-content article">
<div class="tabcon trunk-list">
<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>
<if condition="true eq empty($listData) or $withdraw.status eq -1">
<tr class="num2">
<td colspan="99" 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="listData" id="vo">
<tr class="num2">
<td>{$vo.game_name}</td>
<td>{$vo.pay_amount_all}</td>
<if condition="$vo.pay_way neq -1 and $vo.pay_way neq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<td>{$vo.income}</td>
</tr>
</volist>
</if>
</table>
</div>
</div>
<div class="detailed-br"></div>
</div>
</block>
<block name="script">
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js"></script>
<script type="text/javascript" src="__JS__/20170831/select2.min.js"></script>
<script type="text/javascript">
$('.back-btn').on('click', function () {
location.href = "{:U('withdrawRecord')}";
});
</script>
</block>

@ -135,8 +135,11 @@
<th>玩家账号</th>
<th>订单总额</th>
<th>现金分成基数</th>
<th>现金分成比例</th>
<th>平台币分成基数</th>
<th>平台币分成比例(直充|内充)</th>
<th>平台币分成比例</th>
<th>绑定币分成基数</th>
<th>绑定币分成比例</th>
<th>现金支付通道</th>
<th>收益</th>
<th>订单状态</th>
@ -157,14 +160,24 @@
<td>{:getSDKTypeName($vo['sdk_version'])}</td>
<td>{$vo.user_account}</td>
<td>{$vo.pay_amount}</td>
<if condition="$vo.pay_way eq -1">
<if condition="$vo.pay_way neq -1 and $vo.pay_way neq 0">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%|{$vo.selle_ratio}%</td>
<td>{$vo.selle_ratio}%</td>
<td>{$vo.pay_way_name}</td>
<td>{$vo.income}</td>
<td>{$status}</td>

@ -98,13 +98,13 @@
</div>
<div class="form-group normal_space">
<label class="form-title select-title" style="position: relative;">充值时间:</label>
<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}">
<input type="text" 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}">
<input type="text" id="edate" class="txt" name="endtime" placeholder="结束时间" value="{$initEndTime}">
</div>
</div>
@ -172,7 +172,7 @@
<td>
<a href="{:U('withdrawDtl', array('id'=>$vo['id']))}">提现明细</a>
<a>汇款证明</a>
<a>结算单</a>
<a href="{:U('settlementOrder', array('id'=>$vo['id']))}">结算单</a>
</td>
</tr>
</volist>

@ -340,6 +340,8 @@ CREATE TABLE `tab_spend_user_count` (
ALTER TABLE `tab_spend` ADD COLUMN `withdraw_id` int(11) NOT NULL DEFAULT 0 COMMENT '提现ID' AFTER `pay_url`;
ALTER TABLE `tab_withdraw` ADD COLUMN `settlement_end_time` int(10) NOT NULL DEFAULT 0 COMMENT '结算截止时间' AFTER `old_promote_account`;
-- 2019-11-07 chenzhi
INSERT INTO `sys_menu` (`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('补链详情', '192', '0', 'Mend/shiftInfo', '0', '', '推广补链', '0', '1');
ALTER TABLE `tab_spend_user_count`
ADD COLUMN `bind_coin_count` decimal(10,2) NULL DEFAULT 0.00 COMMENT '绑定币消耗' AFTER `balance_coin_count`;

Loading…
Cancel
Save