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