|
|
|
@ -98,9 +98,10 @@ class PartnerController extends ThinkController
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
// dd($cp_game_ratio_map);
|
|
|
|
|
$parseGameRadiores = array();
|
|
|
|
|
$parseGameRadiores = array();//合作方分成比例
|
|
|
|
|
foreach ($gameradiores as $key =>$val) {
|
|
|
|
|
$val['row'] = 1;
|
|
|
|
|
$val['my_ratio'] = 100 - $val['ratio'];
|
|
|
|
|
if ($val['begin_total_amount'] == 0) {
|
|
|
|
|
$val['name'] = '默认比例';
|
|
|
|
|
if (isset($parseGameRadiores[$val['game_id']])) {
|
|
|
|
@ -115,11 +116,18 @@ class PartnerController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
$parseGameRadiores[$val['game_id']][] = $val;
|
|
|
|
|
}
|
|
|
|
|
// dd($parseGameRadiores);
|
|
|
|
|
$myGameRadiores = $parseGameRadiores;//我方分成比例
|
|
|
|
|
foreach ($myGameRadiores as $key => &$val) {
|
|
|
|
|
foreach ($val as $k => &$v) {
|
|
|
|
|
$v['ratio'] = 100 - $v['ratio'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$parseGames = array();
|
|
|
|
|
|
|
|
|
|
foreach ($games as $key =>$val) {
|
|
|
|
|
$val['game_ratio'] = $parseGameRadiores[$val['id']];
|
|
|
|
|
$val['my_game_ratio'] = $myGameRadiores[$val['id']];
|
|
|
|
|
if(array_key_exists($val['id'],$parseGameRadiores)){//游戏有比例
|
|
|
|
|
$row2 = array_sum(array_column($val['game_ratio'], 'row')) ;
|
|
|
|
|
$val['row'] = empty($row2) ? 1: $row2;
|
|
|
|
|