Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
020dd802d6 | ||
|
|
50d131aa75 | ||
|
|
bcf604dc0a |
@@ -682,6 +682,38 @@ class Agent Extends Common{
|
|||||||
die(json_encode(['code'=>0,'msg'=>$lang['rebate_cannot_lower_agent'].' '.$childMaxRebateRate.'%']));
|
die(json_encode(['code'=>0,'msg'=>$lang['rebate_cannot_lower_agent'].' '.$childMaxRebateRate.'%']));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// —— 时序风险检测 ——
|
||||||
|
// 洗码率/返水率/占成率在「下注未结算」期间被修改,结算(openingBet)会按新值参与代理分账,
|
||||||
|
// 导致本局佣金与下注时预期不符。仅当上述费率确有变化、且该代理下级存在未结算注单时,要求二次确认。
|
||||||
|
// 限红(limit_*)不参与结算、赔率(price_*)代理端只读,故不在检测范围。
|
||||||
|
$confirm_pending = Request::instance()->post('confirm_pending');
|
||||||
|
$rateChanged = (
|
||||||
|
abs($agent_ximalv - (float)$user['agent_ximalv']) > 0.001 ||
|
||||||
|
abs($agent_ximalv_dt - (float)$user['agent_ximalv_dt']) > 0.001 ||
|
||||||
|
abs($agent_ximalv_nn - (float)$user['agent_ximalv_nn']) > 0.001 ||
|
||||||
|
abs($agent_ximalv_tc - (float)$user['agent_ximalv_tc']) > 0.001 ||
|
||||||
|
abs($agent_cs - (float)$user['agent_cs']) > 0.001 ||
|
||||||
|
abs((float)$rebate_rate - (float)$user['rebate_rate']) > 0.001
|
||||||
|
);
|
||||||
|
if($rateChanged && !$confirm_pending){
|
||||||
|
// bet 表位于 DB2 连接(与 Report 模块一致);下级注单路径匹配沿用全站约定的两段 LIKE。
|
||||||
|
// create_time 限定近 1 小时,规避历史异常残留的 is_end=0 注单造成的误报。
|
||||||
|
$pendingCount = Db::connect('DB2')->name('bet')
|
||||||
|
->where('is_end', 0)
|
||||||
|
->where('create_time', '>=', time() - 3600)
|
||||||
|
->where(function($q) use ($user_id){
|
||||||
|
$q->where('agent_parent_id_path', 'like', '%,'.$user_id.',%')
|
||||||
|
->whereOr('agent_parent_id_path', 'like', $user_id.',%');
|
||||||
|
})
|
||||||
|
->count();
|
||||||
|
if($pendingCount > 0){
|
||||||
|
die(json_encode([
|
||||||
|
'code' => 2,
|
||||||
|
'pending' => $pendingCount,
|
||||||
|
'msg' => '该代理下级当前有 '.$pendingCount.' 笔注单尚未结算。本次修改的洗码率 / 返水率 / 占成率将按新值参与这些注单的代理分账,可能使本局佣金与下注时预期不符。确定仍要立即保存吗?',
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 拼装数据创建代理
|
// 拼装数据创建代理
|
||||||
$user_data = array();
|
$user_data = array();
|
||||||
|
|||||||
@@ -760,9 +760,7 @@ class Player Extends Common{
|
|||||||
$user_data['agent_ximalv_nn'] = $agent_ximalv_nn;
|
$user_data['agent_ximalv_nn'] = $agent_ximalv_nn;
|
||||||
$user_data['agent_ximalv_tc'] = $agent_ximalv_tc;
|
$user_data['agent_ximalv_tc'] = $agent_ximalv_tc;
|
||||||
$user_data['manager_id'] = $manager_id;
|
$user_data['manager_id'] = $manager_id;
|
||||||
if ($rebate_rate){
|
$user_data['rebate_rate'] = $rebate_rate ?: 0;
|
||||||
$user_data['rebate_rate'] = $rebate_rate;
|
|
||||||
}
|
|
||||||
$user_data['update_time'] = time();
|
$user_data['update_time'] = time();
|
||||||
$user_data['remarks'] = $remark;
|
$user_data['remarks'] = $remark;
|
||||||
$result = Db::name('user')->where('id',$user_id)->update($user_data);
|
$result = Db::name('user')->where('id',$user_id)->update($user_data);
|
||||||
|
|||||||
@@ -277,6 +277,33 @@
|
|||||||
x_admin_close();
|
x_admin_close();
|
||||||
parent.location.reload();
|
parent.location.reload();
|
||||||
});
|
});
|
||||||
|
} else if (data.code == 2) {
|
||||||
|
// 时序风险:下级有未结算注单,二次确认后带 confirm_pending 重新提交
|
||||||
|
layer.confirm(data.msg, {
|
||||||
|
title: lang.message,
|
||||||
|
btn: ['确定保存', '取消']
|
||||||
|
}, function (idx) {
|
||||||
|
layer.close(idx);
|
||||||
|
query.confirm_pending = 1;
|
||||||
|
$.ajax({
|
||||||
|
url: '/agent/do_edit',
|
||||||
|
data: query,
|
||||||
|
type: 'POST',
|
||||||
|
dataType: 'JSON',
|
||||||
|
success: function (d) {
|
||||||
|
if (d.code == 0) {
|
||||||
|
layer.msg(d.msg);
|
||||||
|
} else if (d.code == 1) {
|
||||||
|
layer.alert(d.msg, {
|
||||||
|
title: lang.message
|
||||||
|
}, function () {
|
||||||
|
x_admin_close();
|
||||||
|
parent.location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -644,13 +644,11 @@
|
|||||||
//query.mobile = $('#mobile').val();
|
//query.mobile = $('#mobile').val();
|
||||||
//query.bet_type = $('#bet_type').val();
|
//query.bet_type = $('#bet_type').val();
|
||||||
query.win_limit = $('#win_limit').val();
|
query.win_limit = $('#win_limit').val();
|
||||||
/*
|
|
||||||
query.agent_commission = $('#agent_commission').val();
|
query.agent_commission = $('#agent_commission').val();
|
||||||
query.agent_commission_dt = $('#agent_commission_dt').val();
|
query.agent_commission_dt = $('#agent_commission_dt').val();
|
||||||
query.agent_commission_nn = $('#agent_commission_nn').val();
|
query.agent_commission_nn = $('#agent_commission_nn').val();
|
||||||
query.agent_commission_tc = $('#agent_commission_tc').val();
|
query.agent_commission_tc = $('#agent_commission_tc').val();
|
||||||
query.agent_commission_tc_banker = $('#agent_commission_tc_banker').val();
|
query.agent_commission_tc_banker = $('#agent_commission_tc_banker').val();
|
||||||
*/
|
|
||||||
query.limit_low = $('#limit_low').val();
|
query.limit_low = $('#limit_low').val();
|
||||||
query.limit_high = $('#limit_high').val();
|
query.limit_high = $('#limit_high').val();
|
||||||
query.limit_low_tie = $('#limit_low_tie').val();
|
query.limit_low_tie = $('#limit_low_tie').val();
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ class Pcapi extends Controller{
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
// CORS headers
|
// CORS headers
|
||||||
$origin = Request::instance()->header('origin');
|
$origin = Request::instance()->header('origin');
|
||||||
$allowed = ['https://ww1.g7g7.top','https://m.g7g7.top','https://m1.g7g7.top','https://m3.g7g7.top','https://p.g7g7.top'];
|
if($origin){
|
||||||
if($origin && in_array($origin, $allowed)){
|
|
||||||
header('Access-Control-Allow-Origin: '.$origin);
|
header('Access-Control-Allow-Origin: '.$origin);
|
||||||
|
} else {
|
||||||
|
header('Access-Control-Allow-Origin: *');
|
||||||
|
}
|
||||||
header('Access-Control-Allow-Headers: token, Origin, X-Requested-With, Content-Type, Accept, Authorization');
|
header('Access-Control-Allow-Headers: token, Origin, X-Requested-With, Content-Type, Accept, Authorization');
|
||||||
header('Access-Control-Allow-Methods: POST,GET,PUT,DELETE,OPTIONS');
|
header('Access-Control-Allow-Methods: POST,GET,PUT,DELETE,OPTIONS');
|
||||||
header('Access-Control-Allow-Credentials: true');
|
|
||||||
}
|
|
||||||
if(Request::instance()->isOptions()){
|
if(Request::instance()->isOptions()){
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user