Merge pull request 'feature/platform_coin' (#658) from feature/platform_coin into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/658
master
廖金灵 3 years ago
commit b068dccc5e

@ -345,9 +345,7 @@ class PromoteCoinController extends ThinkController
// $map['id'] = array('lt',1); // $map['id'] = array('lt',1);
// } // }
setPowerPromoteIds($map,'promote_id'); setPowerPromoteIds($map,'promote_id');
$data = D("CoinPayOrder")->lists($_GET["p"], $map, 'id desc');
$data = D("CoinPayOrder")->lists($_GET["p"], $map, $order);
// dump($data);
//执行查询 //执行查询
// parent::order_lists("CoinPayOrder",$_GET["p"],$extend); // parent::order_lists("CoinPayOrder",$_GET["p"],$extend);
$this->meta_title = '线下充值审核列表'; $this->meta_title = '线下充值审核列表';
@ -382,7 +380,7 @@ class PromoteCoinController extends ThinkController
for ($i = 0; $i < $count; $i++) { for ($i = 0; $i < $count; $i++) {
$this->doOfflineAgree($ids[$i]); $this->doOfflineAgree($ids[$i]);
} }
$this->success("批量通过成功"); $this->success("审核通过成功");
# code... # code...
} }
@ -398,7 +396,7 @@ class PromoteCoinController extends ThinkController
for ($i = 0; $i < $count; $i++) { for ($i = 0; $i < $count; $i++) {
$this->orderReject($ids[$i]); $this->orderReject($ids[$i]);
} }
$this->success("批量拒绝成功"); $this->success("审核拒绝成功");
# code... # code...
} }
@ -411,7 +409,7 @@ class PromoteCoinController extends ThinkController
} }
// //
$balance_map['promote_id'] = $order['promote_id']; $balance_map['promote_id'] = $order['promote_id'];
$balance_map['game_id'] = 0; $balance_map['game_id'] = $order['game_id'];
$balance = M('promote_balance_coin', 'tab_')->where($balance_map)->find(); $balance = M('promote_balance_coin', 'tab_')->where($balance_map)->find();
$this->balance_coin_update($order, $balance);//更新汇总 $this->balance_coin_update($order, $balance);//更新汇总
$this->coin_record_add($order, $balance); //添加流水 $this->coin_record_add($order, $balance); //添加流水
@ -460,6 +458,8 @@ class PromoteCoinController extends ThinkController
$data['balance_coin'] = $balance['num'] + $order['coin_num']; $data['balance_coin'] = $balance['num'] + $order['coin_num'];
$data['remark'] = $order['remark']; $data['remark'] = $order['remark'];
$data['create_time'] = time(); $data['create_time'] = time();
$data['game_id'] = $order['game_id'];
$data['description'] = '线下充值'; $data['description'] = '线下充值';
M('promote_coin_record', 'tab_')->data($data)->add(); M('promote_coin_record', 'tab_')->data($data)->add();
} }
@ -469,11 +469,11 @@ class PromoteCoinController extends ThinkController
{ {
if (!empty($balance)) { if (!empty($balance)) {
$map['promote_id'] = $order['promote_id']; $map['promote_id'] = $order['promote_id'];
$map['game_id'] = 0; $map['game_id'] = $order['game_id'];
M('promote_balance_coin', 'tab_')->where($map)->setInc('num', $order['coin_num']); M('promote_balance_coin', 'tab_')->where($map)->setInc('num', $order['coin_num']);
} else { } else {
$balance['promote_id'] = $order['promote_id']; $balance['promote_id'] = $order['promote_id'];
$balance['game_id'] = 0; $balance['game_id'] = $order['game_id'];
$balance['num'] = $order['coin_num']; $balance['num'] = $order['coin_num'];
M('promote_balance_coin', 'tab_')->data($balance)->add(); M('promote_balance_coin', 'tab_')->data($balance)->add();
} }

@ -34,12 +34,6 @@
</div> </div>
<div class="cf top_nav_list"> <div class="cf top_nav_list">
<div class="fl button_list">
<div class="tools">
<a class="ajax-post " onclick="loadicon()" target-form="ids" url="{:U('PromoteCoin/offlineAgree')}"><span class="button_icon button_icon12"></span>审核通过</a>
<a class="ajax-post " onclick="loadicon()" target-form="ids" url="{:U('PromoteCoin/offlineReject')}"><span class="button_icon button_icon9"></span>审核不通过</a>
</div>
</div>
<!-- 高级搜索 --> <!-- 高级搜索 -->
<div class="jssearch fl cf search_list"> <div class="jssearch fl cf search_list">
<div class="input-list search-title-box"> <div class="input-list search-title-box">
@ -87,17 +81,16 @@
<!-- 表头 --> <!-- 表头 -->
<thead> <thead>
<tr> <tr>
<th class=""> <th>订单号</th>
<input class="check-all" type="checkbox" name="ids[]">
</th>
<th>充值账号</th> <th>充值账号</th>
<th>游戏名称</th>
<th>提交时间</th> <th>提交时间</th>
<th>平台币数量</th> <th>充值绑币数量</th>
<th>优惠值</th>
<th>付款金额</th> <th>付款金额</th>
<th>汇入银行</th> <th>订单号</th>
<th>支付凭证</th>
<th>备注</th> <th>备注</th>
<th>审核状态</th> <th>审核状态</th>
@ -112,12 +105,19 @@
<else/> <else/>
<volist name="list_data" id="data"> <volist name="list_data" id="data">
<tr> <tr>
<td><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td> <td>{$data.order_number}</td>
<td>{$data.promote_account}</td> <td>{$data.promote_account}</td>
<if condition="$data.game_id eq 0 ">
<td>通用</td>
<else />
<td>{:get_gamename($data['game_id'])}</td>
</if>
<td>{:set_show_time($data['create_time'])}</td> <td>{:set_show_time($data['create_time'])}</td>
<td>{$data.coin_num}</td> <td>{$data.coin_num}</td>
<td>{$data.real_amount}</td> <td>{$data.discount}%</td>
<td>— —</td> <td>{$data.pay_amount}</td>
<td>{$data.pay_order_number}</td> <td>{$data.pay_order_number}</td>
<td>{$data.remark}</td> <td>{$data.remark}</td>
<td> <td>

@ -42,6 +42,18 @@
<span class="datainfo">{$data['promote_account']}</span> <span class="datainfo">{$data['promote_account']}</span>
</td> </td>
</tr> </tr>
<tr>
<td class="l">游戏名称:</td>
<td class="r">
<if condition="$data.game_id eq 0 ">
<span class="datainfo">通用</span>
<else />
<span class="datainfo">{:get_gamename($data['game_id'])}</span>
</if>
</td>
</tr>
<tr> <tr>
<td class="l">平台币数量:</td> <td class="l">平台币数量:</td>
<td class="r"> <td class="r">
@ -49,19 +61,19 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">购买金额</td> <td class="l">优惠值</td>
<td class="r"> <td class="r">
<span class="datainfo">{$data['real_amount']}</span> <span class="datainfo">{$data['discount']}%</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">汇入银行:</td> <td class="l">实付金额:</td>
<td class="r"> <td class="r">
<span class="datainfo">--</span> <span class="datainfo">{$data['pay_amount']}</span>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="l">支付凭证</td> <td class="l">订单号</td>
<td class="r"> <td class="r">
<span class="datainfo">{$data['pay_order_number']}</span> <span class="datainfo">{$data['pay_order_number']}</span>
</td> </td>
@ -112,11 +124,12 @@
charset="UTF-8"></script> charset="UTF-8"></script>
<script type="text/javascript"> <script type="text/javascript">
//导航高亮 //导航高亮
highlight_subnav("{:U('PromoteCoin/offlineList')}"); highlight_subnav("{:U('offlineList')}");
Think.setValue("prmoote_id_to", "{$data.promote_id |default= 0}"); Think.setValue("prmoote_id_to", "{$data.promote_id |default= 0}");
$('#submit').click(function () { $('#submit').click(function () {
$('#form').submit(); $('#form').submit();
}); });
var backurl = "{:U('PromoteCoin/offlineList')}";
$("#agree").on("click",function(){ $("#agree").on("click",function(){
var id = $(this).parents(".new_submit").data("id"); var id = $(this).parents(".new_submit").data("id");
var url= "{:U('PromoteCoin/offlineAgree')}"+"&ids[]="+id; var url= "{:U('PromoteCoin/offlineAgree')}"+"&ids[]="+id;
@ -126,7 +139,7 @@
icon: 1, icon: 1,
time: 1000 //2秒关闭如果不配置默认是3秒 time: 1000 //2秒关闭如果不配置默认是3秒
}, function(){ }, function(){
window.location.reload() window.location.href = backurl;
}); });
} }
}); });
@ -140,7 +153,7 @@
icon: 1, icon: 1,
time: 1000 //2秒关闭如果不配置默认是3秒 time: 1000 //2秒关闭如果不配置默认是3秒
}, function(){ }, function(){
window.location.reload() window.location.href = backurl;
}); });
} }
}); });

@ -99,6 +99,7 @@ class CoinOrderController extends BaseController
} }
} }
$this->assign("LV",self::LV); $this->assign("LV",self::LV);
$config = $this->getOfflineConfig();
if(IS_POST){ if(IS_POST){
SafeFilter($_POST); SafeFilter($_POST);
$coin_num = I("coin_num"); $coin_num = I("coin_num");
@ -121,15 +122,22 @@ class CoinOrderController extends BaseController
$data['pay_amount'] = bcadd($coin_num,$free,2); $data['pay_amount'] = bcadd($coin_num,$free,2);
$data['order_status'] = 0; $data['order_status'] = 0;
}else{ }else{
$data['pay_amount'] = $coin_num; if($config['is_open'] != 1) {
$this->ajaxReturn(['status'=>0,'info'=>'配置错误','time'=>1000],"JSON");
}
$data['pay_amount'] = sprintf("%.2f",$coin_num*($config['coin_discount']*10)/100);
$collection_account = I("collection_account",""); $collection_account = I("collection_account","");
$pay_order_number = I("pay_order_number"); $pay_order_number = I("pay_order_number");
/*if($collection_account==''){ $game_id = I("game_id", 0);
$this->ajaxReturn(['status'=>0,'info'=>'请选择汇入银行','time'=>1000],"JSON"); if($game_id < 1){
}*/ $this->ajaxReturn(['status'=>0,'info'=>'请选择游戏','time'=>1000],"JSON");
}
if($pay_order_number==''){ if($pay_order_number==''){
$this->ajaxReturn(['status'=>0,'info'=>'请输入支付凭证','time'=>1000],"JSON"); $this->ajaxReturn(['status'=>0,'info'=>'请输入支付凭证','time'=>1000],"JSON");
} }
$is_order = M("coin_pay_order","tab_") $is_order = M("coin_pay_order","tab_")
->where( ->where(
array('pay_order_number'=>$pay_order_number, array('pay_order_number'=>$pay_order_number,
@ -151,7 +159,9 @@ class CoinOrderController extends BaseController
$data['remark'] = I("remark"); $data['remark'] = I("remark");
$data['voucher_img'] = $res['id']; $data['voucher_img'] = $res['id'];
$data['order_status'] = 2; $data['order_status'] = 2;
$data['pay_way'] = 3; $data['pay_way'] = 5;
$data['game_id'] = $game_id;
$data['discount'] = $config['coin_discount'] * 10;
} }
M("coin_pay_order", 'tab_')->add($data); M("coin_pay_order", 'tab_')->add($data);
recordPromoteLogs('平台币管理','提交充值订单'); recordPromoteLogs('平台币管理','提交充值订单');
@ -163,9 +173,30 @@ class CoinOrderController extends BaseController
$this->assign("account",$account); $this->assign("account",$account);
$this->assign("bank_list",$bank_list); $this->assign("bank_list",$bank_list);
$this->assign("discount","0"); $this->assign("discount","0");
$this->assign("config", $config);
$this->display(); $this->display();
} }
} }
private function getOfflineConfig()
{
$config = M("Kv")->where("`key` like 'offline_platform_coin_%'")->getField('key,value',true);
$pid = session('promote_auth.pid');
$sendArr = [
'is_open'=>0
];
if(isset($config['offline_platform_coin_promote_ids'])){
$promote_ids = explode(',', $config['offline_platform_coin_promote_ids']);
if(in_array($pid, $promote_ids)) {
$sendArr['is_open'] = 1;
}
}
if($sendArr['is_open'] == 1) {
$sendArr['game'] = M('Game', 'tab_')->where("id in ({$config['offline_platform_coin_game_ids']})")->getField('id,game_name');
$sendArr['coin_discount'] = ($config['offline_platform_coin_discount']?:100) / 10;
$sendArr['collection_img_path'] = $config['offline_platform_coin_collection_img_path'];
}
return $sendArr;
}
//订单明细 //订单明细
public function order_detail(){ public function order_detail(){

@ -29,75 +29,106 @@
<a href="{:U('order_add')}" class="current">充值</a> <a href="{:U('order_add')}" class="current">充值</a>
</div> </div>
</div> </div>
<div class="trunk-list"> <if condition="$config['is_open'] == 1 ">
<form id="payform" action="{:U('agent_pay')}" method="post" enctype="multipart/form-data"> <div class="trunk-list">
<table class="table2"> <form id="payform" action="{:U('agent_pay')}" method="post" enctype="multipart/form-data" style="position: relative;">
<tr> <div class="remittance" hidden style="width: 300px;height: 450px;position: absolute;left: 600px;top: 0;">
<td class="l">充值账号:</td> <img style="width: 100%;" src="{$config.collection_img_path}" />
<td class="r"><span >{$account}</span></td> </div>
</tr> <table class="table2">
<tr> <tr>
<td class="l">平台币原价:</td> <td class="l">充值方式:</td>
<td class="r">¥1.00/个</td> <td class="r form-radio jspayradio">
</tr> <!-- <label><input type="radio" value="1" name="pay_type" checked><i class="current"></i><span>在线转账</span></label> -->
<tr> <if condition="$config['is_open'] == 1 ">
<td class="l">购买数量:</td> <label><input type="radio" value="2" name="pay_type" checked><i></i><span>线下转账</span><span class="noticetxt">(需上传截图)</span></label>
<td class="r"><input type="text" class="txt" name="coin_num" autocomplete="off" placeholder="" oninput="this.value=this.value.replace(/[^0-9]+|^0|\d{9}/,'');"> </if>
<span class="noticetxt">平台币</span> </td>
</td> </tr>
</tr> <tr class="remittance" hidden>
<tr> <td class="l">请选择游戏</td>
<td class="l">充值方式:</td> <td class="r">
<td class="r form-radio jspayradio"> <select class="reselect select_gallery" name="game_id">
<label><input type="radio" value="1" name="pay_type" checked><i class="current"></i><span>在线转账</span></label> <option value="">请选择游戏</option>
<!-- <label><input type="radio" value="2" name="pay_type"><i></i><span>线下转账</span><span class="noticetxt">(需上传截图)</span></label> --> <foreach name="config.game" item="vo" >
</td> <option value="{$key}">{$vo}</option>
</tr> </foreach>
<tr> </select>
<td class="l">应付金额:</td> <div id="acountesc"></div>
<td class="r" id="pay_amount"><span>0.00</span> </td>
<input name="discount" value="{$discount}" type="hidden"> </tr>
</td> <tr>
</tr> <td class="l">充值账号:</td>
<tr class="remittance" hidden> <td class="r"><span >{$account}</span></td>
<td class="l">汇入银行:</td> </tr>
<td class="r"> <tr>
<select class="reselect select_gallery" name="collection_account"> <td class="l">平台币原价:</td>
<option value="" title="暂未开放 暂未开放" acountesc="">暂未开放 暂未开放</option> <td class="r">¥1.00/个</td>
<volist name="bank_list" id="bank"> </tr>
<option value="{$bank.bank_account}" title="{$bank.bank}" acountesc="账户名称:{$bank.account_name}<br/>汇入账户:{$bank.bank_account}<br/>开户行:{$bank.bank_name}">{$bank.bank}</option> <if condition="$config.coin_discount neq 10 ">
</volist> <tr class="remittance" hidden>
</select> <td class="l">平台币限时折扣:</td>
<div id="acountesc"></div> <td class="r"><span >{$config.coin_discount}折</span></td>
</td> </tr>
</tr> </if>
<tr class="remittance" hidden> <tr>
<td class="l">支付凭证:</td> <td class="l">购买数量:</td>
<td class="r"><input type="text" class="txt" name="pay_order_number" autocomplete="off" placeholder="请输入支付凭证"></td> <td class="r"><input type="text" class="txt" name="coin_num" autocomplete="off" placeholder="" oninput="this.value=this.value.replace(/[^0-9]+|^0|\d{9}/,'');">
</tr> <span class="noticetxt">平台币</span>
<tr class="remittance" hidden> </td>
<td class="l">支付截图:</td> </tr>
<td class="r"><div class="fallback" id="myid"><input name="voucher_img" type="file" multiple /></div></td> <tr>
</tr> <td class="l">应付金额:</td>
<tr class="remittance" hidden> <td class="r" id="pay_amount"><span>0.00</span>
<td class="l">备注:</td> <input name="discount" value="{$discount}" type="hidden">
<td class="r"> </td>
<textarea name="remark"></textarea> </tr>
</td> <!-- <tr class="remittance" hidden>
</tr> <td class="l">汇入银行:</td>
<tr id="tip"> <td class="r">
<td class="l" colspan="2"> <select class="reselect select_gallery" name="collection_account">
<span class="noticetxt">(手续费说明:每笔交易支付服务商将收取 {$LV}% 手续费最低收取0.1元,上不封顶)</span> <option value="" title="暂未开放 暂未开放" acountesc="">暂未开放 暂未开放</option>
</td> <volist name="bank_list" id="bank">
</tr> <option value="{$bank.bank_account}" title="{$bank.bank}" acountesc="账户名称:{$bank.account_name}<br/>汇入账户:{$bank.bank_account}<br/>开户行:{$bank.bank_name}">{$bank.bank}</option>
<tr> </volist>
<td class="r"> </select>
<button type="button" class="tjbnt btn" onclick="save_model()" >提交</button> <div id="acountesc"></div>
</td> </td>
</tr> </tr> -->
</table>
</form> <tr class="remittance" hidden>
</div> <td class="l">订单号:</td>
<td class="r"><input type="text" class="txt" name="pay_order_number" autocomplete="off" placeholder="请输入订单号"></td>
</tr>
<tr class="remittance" hidden>
<td class="l">支付截图:</td>
<td class="r"><div class="fallback" id="myid"><input name="voucher_img" type="file" multiple /></div></td>
</tr>
<tr class="remittance" hidden>
<td class="l">备注:</td>
<td class="r">
<textarea name="remark"></textarea>
</td>
</tr>
<tr class="remittance" hidden>
<td class="l" colspan="2" style="text-align: center;">
<span class="noticetxt">(特殊说明:折扣购买的平台币不参与结算)</span>
</td>
</tr>
<tr id="tip">
<td class="l" colspan="2">
<span class="noticetxt">(手续费说明:每笔交易支付服务商将收取 {$LV}% 手续费最低收取0.1元,上不封顶)</span>
</td>
</tr>
<tr>
<td class="r">
<button type="button" class="tjbnt btn" onclick="save_model()" >提交</button>
</td>
</tr>
</table>
</form>
</div>
</if>
</div> </div>
</div> </div>
</block> </block>
@ -124,6 +155,13 @@
calculation_money($("input[name=coin_num]").val()); calculation_money($("input[name=coin_num]").val());
} }
}); });
//---begin 直接执行 如需线上取消
$(".remittance").show();
$("#tip").hide();
calculation_money($("input[name=coin_num]").val());
$("input[name='pay_type']").siblings('i').addClass('current');
//----end
$("input[name=coin_num]").bind('input propertychange', function () { $("input[name=coin_num]").bind('input propertychange', function () {
calculation_money($(this).val()); calculation_money($(this).val());
}) })
@ -148,7 +186,11 @@
fee=0.1 fee=0.1
} }
coin_num = fee+parseFloat(coin_num); coin_num = fee+parseFloat(coin_num);
}else{ }else{ //线下打款
var discount = '{$config.coin_discount}';
if(discount < 10) {
coin_num = (discount*10)*coin_num/100;
}
coin_num = parseFloat(coin_num) coin_num = parseFloat(coin_num)
} }
coin_num = coin_num.toFixed(2); coin_num = coin_num.toFixed(2);
@ -183,7 +225,8 @@
}else{ }else{
layer.alert(result.info,function () { layer.alert(result.info,function () {
parent.layer.closeAll(); parent.layer.closeAll();
location.reload(); var url = "{:U('CoinOrder/order_list')}";
location.href = url;
}); });
} }
}else{ }else{

@ -79,6 +79,7 @@
<elseif condition="$order_info.pay_way eq 2"/>微信支付 <elseif condition="$order_info.pay_way eq 2"/>微信支付
<elseif condition="$order_info.pay_way eq 3"/>银联支付 <elseif condition="$order_info.pay_way eq 3"/>银联支付
<elseif condition="$order_info.pay_way eq 4"/>双乾支付宝扫码支付 <elseif condition="$order_info.pay_way eq 4"/>双乾支付宝扫码支付
<elseif condition="$order_info.pay_way eq 5"/>支付宝线下转账
<else /> 未知</if> <else /> 未知</if>
</span> </span>
</div> </div>

@ -73,6 +73,7 @@
<table class="table normal_table"> <table class="table normal_table">
<tr class="odd"> <tr class="odd">
<th>充值订单号</th> <th>充值订单号</th>
<th>游戏名称</th>
<th>充值金额</th> <th>充值金额</th>
<th>优惠值</th> <th>优惠值</th>
<th>平台币数量</th> <th>平台币数量</th>
@ -87,6 +88,11 @@
<volist name="data_list" id="data"> <volist name="data_list" id="data">
<tr> <tr>
<td>{$data.order_number}</td> <td>{$data.order_number}</td>
<if condition="$data.game_id eq 0 ">
<td>通用</td>
<else />
<td>{:get_game_info($data['game_id'])['game_name']}</td>
</if>
<td>{$data.pay_amount}</td> <td>{$data.pay_amount}</td>
<td>{$data.discount}%</td> <td>{$data.discount}%</td>
<td>{$data.coin_num}</td> <td>{$data.coin_num}</td>

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Loading…
Cancel
Save