|
|
|
@ -252,7 +252,7 @@ class WithdrawModel extends Model{
|
|
|
|
|
|
|
|
|
|
$promoteGameRatioMap['status'] = 1;
|
|
|
|
|
$promoteGameRatioMap['promote_id'] = $promote['id'];
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status')
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
|
|
|
|
|
->where($promoteGameRatioMap)
|
|
|
|
|
->order('update_time desc')
|
|
|
|
|
->select();
|
|
|
|
@ -278,15 +278,13 @@ class WithdrawModel extends Model{
|
|
|
|
|
->where($spendWhere)
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
|
$sumAmount = $sumAmount ?? 0;
|
|
|
|
|
if ($promoteGameRatio['interval_closed_status'] == 1) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
|
|
|
|
|
if ($sumAmount >= $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
} else {
|
|
|
|
|
if ($sumAmount > $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
@ -369,7 +367,7 @@ class WithdrawModel extends Model{
|
|
|
|
|
{
|
|
|
|
|
$promoteGameRatioMap['status'] = 1;
|
|
|
|
|
$promoteGameRatioMap['promote_id'] = $promote['id'];
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status')
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
|
|
|
|
|
->where($promoteGameRatioMap)
|
|
|
|
|
->order('update_time desc')
|
|
|
|
|
->select();
|
|
|
|
@ -408,15 +406,13 @@ class WithdrawModel extends Model{
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
|
$sumAmount = $sumAmount ?? 0;
|
|
|
|
|
$ratio = 0;
|
|
|
|
|
if ($promoteGameRatio['interval_closed_status'] == 1) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
|
|
|
|
|
if ($sumAmount >= $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
} else {
|
|
|
|
|
if ($sumAmount > $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
@ -475,7 +471,7 @@ class WithdrawModel extends Model{
|
|
|
|
|
{
|
|
|
|
|
$promoteGameRatioMap['status'] = 1;
|
|
|
|
|
$promoteGameRatioMap['promote_id'] = $promote['id'];
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status')
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
|
|
|
|
|
->where($promoteGameRatioMap)
|
|
|
|
|
->order('update_time desc')
|
|
|
|
|
->select();
|
|
|
|
@ -503,15 +499,13 @@ class WithdrawModel extends Model{
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
|
$sumAmount = $sumAmount ?? 0;
|
|
|
|
|
$ratio = 0;
|
|
|
|
|
if ($promoteGameRatio['interval_closed_status'] == 1) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
|
|
|
|
|
if ($sumAmount >= $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
} else {
|
|
|
|
|
if ($sumAmount > $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
@ -545,7 +539,7 @@ class WithdrawModel extends Model{
|
|
|
|
|
|
|
|
|
|
$promoteGameRatioMap['status'] = 1;
|
|
|
|
|
$promoteGameRatioMap['promote_id'] = $promote['id'];
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time, interval_closed_status')
|
|
|
|
|
$promoteGameRatios = D('promote_game_ratio')->field('game_id, ratio, turnover_ratio, begin_time, end_time')
|
|
|
|
|
->where($promoteGameRatioMap)
|
|
|
|
|
->order('update_time desc')
|
|
|
|
|
->select();
|
|
|
|
@ -569,15 +563,13 @@ class WithdrawModel extends Model{
|
|
|
|
|
->where($spendWhere)
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
|
$sumAmount = $sumAmount ?? 0;
|
|
|
|
|
if ($promoteGameRatio['interval_closed_status'] == 1) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
if (empty($turnoverRatio['interval_closed_status']) || $turnoverRatio['interval_closed_status'] == 1) {
|
|
|
|
|
if ($sumAmount >= $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
foreach ($turnoverRatios as $turnoverRatio) {
|
|
|
|
|
} else {
|
|
|
|
|
if ($sumAmount > $turnoverRatio['turnover']) {
|
|
|
|
|
$ratio = $turnoverRatio['ratio'];
|
|
|
|
|
break;
|
|
|
|
|