Merge remote-tracking branch 'origin/release' into release

master
zhengyongxing 5 years ago
commit 75f2d09b10

@ -529,7 +529,7 @@ class FinanceController extends BaseController
if ($withdrawId == 0) {
$this->error('参数异常');
}
$withdraw = $model->field('promote_id,status')->where(array('id' => $withdrawId))->find();
$withdraw = $model->where(array('id' => $withdrawId))->find();
if (empty($withdraw) || $withdraw['promote_id'] != $this->loginPromote['id']) {
$this->error('参数异常');
}
@ -544,7 +544,18 @@ class FinanceController extends BaseController
$parameter['user_account'] = $userAccount;
$parameter['pay_order_number'] = $payOrderNumber;
$map['withdraw_id'] = $withdrawId;
if ($withdraw['settlement_type'] == 3) {
if (empty($withdraw['game_ratio'])) {
$map['_string'] = '1 = 2';
} else {
$gameRatios = json_decode($withdraw['game_ratio'], true);
$gameIds = array_keys($gameRatios);
$map['game_id'] = ['in', $gameIds];
$map['pay_time'] = ['between', [$withdraw['settlement_begin_time'], $withdraw['settlement_end_time']]];
}
} else {
$map['withdraw_id'] = $withdrawId;
}
if (!empty($gameId)) {
$map['game_id'] = $gameId;
}
@ -613,20 +624,40 @@ class FinanceController extends BaseController
if (empty($withdraw) || $withdraw['promote_id'] != $this->loginPromote['id']) {
$this->error('参数异常');
}
$settlementBeginTime = $withdraw['settlement_begin_time'];
$settlementEndTime = $withdraw['settlement_end_time'];
$withdraw['create_time'] = date('Y-m-d H:i:s', $withdraw['create_time']);
$withdraw['settlement_end_time'] = date('Y-m-d H:i:s', $withdraw['settlement_end_time']);
$withdraw['status'] = FinanceController::$withdrawStatus[$withdraw['status']];
$map['withdraw_id'] = $withdrawId;
if (empty($withdraw['game_ratio'])) {
$map['_string'] = '1 = 2';
} else {
$gameRatios = json_decode($withdraw['game_ratio'], true);
$gameIds = array_keys($gameRatios);
$map['game_id'] = ['in', $gameIds];
$map['pay_time'] = ['between', [$settlementBeginTime, $settlementEndTime]];
}
if ($withdraw['settlement_type'] != 3) {
$map['withdraw_id'] = $withdrawId;
}
$data = M('spend', 'tab_')
->field('game_name,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income')
->field('game_id,game_name,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income')
->where($map)
->group('game_id')
->order('game_id')
->select();
if (!empty($data)) {
foreach ($data as &$list) {
$list['income'] = bcdiv($list['income'], 100, 2);
$list['income'] = '0.00';
if (isset($gameRatios[$list['game_id']])) {
foreach ($gameRatios[$list['game_id']] as $gameIncome) {
$income = bcdiv(bcmul($gameIncome['sum_amount'], $gameIncome['selle_ratio'], 2), 100, 2);
$list['income'] = bcadd($list['income'], $income, 2);
}
}
}
}

@ -232,20 +232,20 @@ class PromoteController extends BaseController
$this->assign("rules", $rules);
$this->assign("rules_count", count($rules));
$redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
$cacheKey = "pop:rule:set";
if (!$redis->sIsMember($cacheKey, get_pid())) {
$currentTime = strtotime(date('Y-m-d'));
$weekArray = [7,1,2,3,4,5,6];
$week = $weekArray[date("w")];
$match_rules = M("document_pop_rules")
->field('id')
->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week})")
->order("sort asc, id desc")
->select();
} else {
$match_rules = [];
}
// $redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]);
// $cacheKey = "pop:rule:set";
// if (!$redis->sIsMember($cacheKey, get_pid())) {
// $currentTime = strtotime(date('Y-m-d'));
// $weekArray = [7,1,2,3,4,5,6];
// $week = $weekArray[date("w")];
// $match_rules = M("document_pop_rules")
// ->field('id')
// ->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week})")
// ->order("sort asc, id desc")
// ->select();
// } else {
// $match_rules = [];
// }
$this->assign("match_rules_id", $match_rules ? json_encode(array_column($match_rules, 'id')) : 'null');

@ -325,7 +325,7 @@ class SafeController extends BaseController{
$promoteInfo['personalstatus'] = true;
$promoteInfo['complanystatus'] = false;
}
if(!empty(json_decode($address))) {
if(!empty(json_decode($address)) && count(json_decode($address)) >= 2) {
$addressArr = explode(',', json_decode($address)[0]);
$promoteInfo['addressdata'] = $addressArr;
$this->assign('addr',json_decode($address)[1]);

@ -141,11 +141,11 @@
<th>游戏名称</th>
<th>流水</th>
<th>现金分成基数</th>
<th>现金分成比例</th>
<!-- <th>现金分成比例</th>-->
<th>平台币分成基数</th>
<th>平台币分成比例</th>
<!-- <th>平台币分成比例</th>-->
<th>绑定币分成基数</th>
<th>绑定币分成比例</th>
<!-- <th>绑定币分成比例</th>-->
<th>合作方分成金额</th>
</tr>
<if condition="true eq empty($listData) or $withdraw.status eq -1">
@ -165,19 +165,19 @@
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount_all}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<!-- <td>{$vo.selle_ratio}%</td>-->
<td>{$vo.income}</td>
</tr>
</volist>

@ -134,13 +134,13 @@
<th>玩家账号</th>
<th>订单总额</th>
<th>现金分成基数</th>
<th>现金分成比例</th>
<!-- <th>现金分成比例</th>-->
<th>平台币分成基数</th>
<th>平台币分成比例</th>
<!-- <th>平台币分成比例</th>-->
<th>绑定币分成基数</th>
<th>绑定币分成比例</th>
<!-- <th>绑定币分成比例</th>-->
<th>现金支付通道</th>
<th>收益</th>
<!-- <th>收益</th>-->
<th>订单状态</th>
<th>充值时间</th>
</tr>
@ -164,21 +164,21 @@
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq 0">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<!-- <td>{$vo.selle_ratio}%</td>-->
<if condition="$vo.pay_way eq -1">
<td>{$vo.pay_amount}</td>
<else/>
<td>0</td>
</if>
<td>{$vo.selle_ratio}%</td>
<!-- <td>{$vo.selle_ratio}%</td>-->
<td>{$vo.pay_way_name}</td>
<td>{$vo.income}</td>
<!-- <td>{$vo.income}</td>-->
<td>{$status}</td>
<td>{$vo.pay_time}</td>
</tr>

Loading…
Cancel
Save