diff --git a/Application/Admin/Controller/GameMarginSetController.class.php b/Application/Admin/Controller/GameMarginSetController.class.php index 59a69f13a..1ed16b54f 100644 --- a/Application/Admin/Controller/GameMarginSetController.class.php +++ b/Application/Admin/Controller/GameMarginSetController.class.php @@ -373,14 +373,14 @@ class GameMarginSetController extends Controller { }else{ $ratio = $val['second_ratio']; } - $statement_money = round( $this->adddata[$game]['pay_amount'] * $ratio / 100,2); - $this->adddata[$game]['cp_statement_amount'] = $statement_money; - // $statement_money = round( $this->adddata[$game]['pay_amount'] / $val['pay_amount'] * $val['sum_money'],2); - // if( array_key_exists("cp_statement_amount",$this->adddata[$game]) ){ - // $this->adddata[$game]['cp_statement_amount'] += $statement_money; - // }else{ - // $this->adddata[$game]['cp_statement_amount'] = $statement_money; - // } + + $statement_money = round( $this->adddata[$game]['pay_amount'] / $val['pay_amount'] * $val['sum_money'],2); + if( array_key_exists("cp_statement_amount",$this->adddata[$game]) ){ + $this->adddata[$game]['cp_statement_amount'] += $statement_money; + }else{ + $this->adddata[$game]['cp_statement_amount'] = $statement_money; + } + $this->adddata[$game]['cp_promote_ratio'] = $val['promote_ratio']; $this->adddata[$game]['cp_ratio'] = $ratio; } @@ -393,7 +393,7 @@ class GameMarginSetController extends Controller { { $where = [ "partner_id"=>$company_id, - "_string"=>"original_package_name = '{$OPName}' OR relation_game_name = '{$OPName}'" + "_string"=>"( original_package_name = '{$OPName}' AND select_package_name = 0 ) OR ( relation_game_name = '{$OPName}' AND select_package_name = 1 )" ]; $game = M("Game","tab_")->field("relation_game_name")->where($where)->group("relation_game_name")->select(); if($game){