Merge branch 'dev' of 47.111.118.107:wmtx/platform into dev

master
ELF 5 years ago
commit de81412aef

@ -3,6 +3,7 @@
namespace Admin\Controller;
use User\Api\UserApi as UserApi;
use Common\Api\GameApi;
use Callback\Controller\BaseController;
/**
* 后台首页控制器
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
@ -17,7 +18,20 @@ class RepairController extends ThinkController {
$result=$game->game_pay_notify($param,1);
}
$spend = M('Spend',"tab_");
if($result == "success"){
$auth = session('user_auth');
// 补单记录
M('repair_pay', 'tab_')->add([
'admin_id' => $auth['uid'],
'admin_name' => $auth['username'],
'pay_order_number' => $orderNo,
'ip' => get_client_ip(),
'tab' => 'spend',
'create_time' => time(),
'type' => 1 // 补单
]);
$rr = $spend->where(array('pay_order_number'=>$orderNo))->save(array('pay_game_status'=>1));
$this->ajaxReturn(array('status'=>1,'msg'=>'补单成功'));
}else{
@ -97,6 +111,107 @@ class RepairController extends ThinkController {
}
/**
* 游戏充值补单
*/
public function noticePayed($orderNo, $second, $type) {
$auth = session('user_auth');
if (IS_AJAX) {
if ($type != 'spend' && $type != 'deposit') {
$this->ajaxReturn(['status'=>0,'msg'=>'参数有误']);
}
$tab = $type;
if (!$orderNo || !$second) {
$this->ajaxReturn(['status'=>0,'msg'=>'参数不足']);
}
$r = D('Member')->check_sc_pwd($second);
if (!$r) {
$this->ajaxReturn(['status'=>0,'msg'=>'二级密码错误']);
}
M($tab, 'tab_')->startTrans();
$order = M($tab, 'tab_')->where(['pay_order_number' => $orderNo])->find();
if ($order['pay_status'] == 1) {
M($tab, 'tab_')->rollback();
$this->ajaxReturn(['status'=>0,'msg'=>'支付成功,无需补单']);
}
$r = M($tab, 'tab_')->where([
'pay_order_number' => $orderNo,
'pay_status' => 0
])->save([
'pay_status' => 1
]);
if ($r) {
$cpFlag = 0; // 0 通知cp失败 1 成功
// 通知cp
if ($tab == 'spend') {
$param['out_trade_no'] = $orderNo;
$game = new GameApi();
$result=$game->game_pay_notify($param,1);
$spend = M($tab, "tab_");
if($result == "success"){
$rr = $spend->where(array('pay_order_number'=>$orderNo))->save(array('pay_game_status'=>1));
if ($rr) {
$cpFlag = 1;
M('spend', 'tab_')->commit();
} else {
M($tab, 'tab_')->rollback();
$this->ajaxReturn(array('status'=>1,'msg'=>'补单失败.'));
}
}else{
M($tab, 'tab_')->commit();
}
} else { // deposit
M('spend', 'tab_')->commit();
}
// 通知到账记录
M('repair_pay', 'tab_')->add([
'admin_id' => $auth['uid'],
'admin_name' => $auth['username'],
'pay_order_number' => $orderNo,
'ip' => get_client_ip(),
'tab' => $tab,
'create_time' => time(),
'type' => 0
]);
if ($tab == 'spend' && $cpFlag === 1) {
// 补单记录
M('repair_pay', 'tab_')->add([
'admin_id' => $auth['uid'],
'admin_name' => $auth['username'],
'pay_order_number' => $orderNo,
'ip' => get_client_ip(),
'tab' => $tab,
'create_time' => time(),
'type' => 1
]);
}
// todo: 分红 上级奖励等
if ($tab == 'spend' && $cpFlag == 0) {
$this->ajaxReturn(['status'=>0,'msg'=>'充值补单成功通知CP失败']);
}
$this->ajaxReturn(['status'=>0,'msg'=>'充值补单成功!']);
} else {
M('spend', 'tab_')->rollback();
$this->ajaxReturn(['status'=>0,'msg'=>'补单失败,请重试']);
}
}
}
/**
* 平台币充值补单
*/
public function platform($orderNo) {
if (IS_AJAX) {
$payOrderNumber = I('request.pay_order_number');
}
}
}

@ -132,4 +132,13 @@ class SpendController extends ThinkController
$this->display();
}
/**
* 充值补单功能
*/
public function order_repair() {
if (IS_AJAX) {
}
}
}

@ -127,6 +127,7 @@
</a>
</th>
<th>订单状态</th>
<th>操作</th>
</tr>
</thead>
@ -168,6 +169,16 @@
{:get_info_status($data['pay_status'],9)}
</if>
</td>
<td style="text-indent:0;">
<br />
<if condition="$data['pay_status'] eq 0">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>
</td>
</tr>
</volist>
</empty>
@ -397,5 +408,36 @@
// minimumResultsForSearch: Infinity, // 永久隐藏搜索框
// });
}
// 充值补单
$(".pay_repair").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
var pwd2 = prompt("请输入二级密码");
if (!pwd2) {
alert("二级密码不能为空");
return ;
}
$.ajax({
type: 'post',
url: url,
data: {orderNo: data, second: pwd2, type: 'deposit'},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},
});
});
</script>
</block>

@ -234,8 +234,15 @@
<span>补单</span>
</if>
<br />
<if condition="$data['pay_game_status'] eq 0 and $data['pay_status'] eq 0">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>
</td>
</tr>
</volist>
</empty>
@ -429,6 +436,37 @@
});
});
// 充值补单
$(".pay_repair").click(function () {
url = $(this).attr('href-hhh');
data = $(this).attr('href-data');
var pwd2 = prompt("请输入二级密码");
if (!pwd2) {
alert("二级密码不能为空");
return ;
}
$.ajax({
type: 'post',
url: url,
data: {orderNo: data, second: pwd2, type: 'spend'},
success: function (e) {
if (e.status == 1) {
layer.msg(e.msg, {icon: 1});
setTimeout(function () {
location.reload();
}, 1500);
} else {
if (e.msg) {
var tip_msg = e.msg;
} else {
var tip_msg = e.info ? e.info : "补单失败";
}
layer.msg(tip_msg, {icon: 2});
}
},
});
});
$(".d_list").find(".drop-down11").hover(function () {
$(this).find(".nav-list").removeClass("hidden");
}, function () {

Loading…
Cancel
Save