|
|
|
@ -269,14 +269,14 @@ class WithdrawModel extends Model{
|
|
|
|
|
$notInGameIds = [-1];
|
|
|
|
|
foreach ($promoteGameRatios as $promoteGameRatio) {
|
|
|
|
|
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
|
|
|
|
|
$ratio = $promoteGameRatio['ratio'];
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true);
|
|
|
|
|
if (!empty($gameIds)) {
|
|
|
|
|
foreach ($gameIds as $gameId) {
|
|
|
|
|
$spendWhere['game_id'] = $gameId;
|
|
|
|
|
$notInGameIds[] = $gameId;
|
|
|
|
|
$ratio = $promoteGameRatio['ratio'];
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
|
|
|
|
|
->where($spendWhere)
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
@ -396,12 +396,12 @@ class WithdrawModel extends Model{
|
|
|
|
|
$gameRatios = [];
|
|
|
|
|
foreach ($promoteGameRatios as $promoteGameRatio) {
|
|
|
|
|
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true);
|
|
|
|
|
if (!empty($gameIds)) {
|
|
|
|
|
foreach ($gameIds as $gameId) {
|
|
|
|
|
$spendWhere['game_id'] = $gameId;
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$spendMap['game_id'] = $gameId;
|
|
|
|
|
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
|
|
|
|
|
->where($spendMap)
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
@ -487,12 +487,12 @@ class WithdrawModel extends Model{
|
|
|
|
|
$balance = 0;
|
|
|
|
|
foreach ($promoteGameRatios as $promoteGameRatio) {
|
|
|
|
|
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true);
|
|
|
|
|
if (!empty($gameIds)) {
|
|
|
|
|
foreach ($gameIds as $gameId) {
|
|
|
|
|
$spendMap['game_id'] = $gameId;
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
|
|
|
|
|
->where($spendMap)
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
@ -548,14 +548,14 @@ class WithdrawModel extends Model{
|
|
|
|
|
$notInGameIds = [-1];
|
|
|
|
|
foreach ($promoteGameRatios as $promoteGameRatio) {
|
|
|
|
|
if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
|
|
|
|
|
$ratio = $promoteGameRatio['ratio'];
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true);
|
|
|
|
|
if (!empty($gameIds)) {
|
|
|
|
|
foreach ($gameIds as $gameId) {
|
|
|
|
|
$spendWhere['game_id'] = $gameId;
|
|
|
|
|
$notInGameIds[] = $gameId;
|
|
|
|
|
$ratio = $promoteGameRatio['ratio'];
|
|
|
|
|
$promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true);
|
|
|
|
|
$turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']);
|
|
|
|
|
$sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
|
|
|
|
|
->where($spendWhere)
|
|
|
|
|
->find()['sum_amount'];
|
|
|
|
|