diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php
index d34964caf..59f7e8482 100644
--- a/Application/Admin/Common/function.php
+++ b/Application/Admin/Common/function.php
@@ -724,7 +724,7 @@ function getAllGameList($groupByRelation = false)
 {
     $field = 'id, game_name, relation_game_id, relation_game_name';
     if ($groupByRelation) {
-        $games = M('game', 'tab_')->field($field)->group('relation_game_id')->select();
+        $games = M('game', 'tab_')->field($field)->where('id = relation_game_id')->group('relation_game_id')->select();
     } else {
         $games = M('game', 'tab_')->field($field)->select();
     }
diff --git a/Application/Admin/Controller/AjaxController.class.php b/Application/Admin/Controller/AjaxController.class.php
index d837eafe7..79ff49961 100644
--- a/Application/Admin/Controller/AjaxController.class.php
+++ b/Application/Admin/Controller/AjaxController.class.php
@@ -295,11 +295,14 @@ class AjaxController extends ThinkController{
             $data['game_ratio'] = $handleStatementData;
             $data['company_name'] = $second_party_info['partner'];
             $data['mobile_phone'] = $second_party_info['link_phone'];
+            $data['bank_card'] = $second_party_info['bank_account'];
+            $data['account_openin'] = $second_party_info['opening_bank'];
             $data['settlement_type'] = $second_party_info['settlement_type'];
             $data['address'] = $second_party_info['address'];
             $data['real_name'] = $second_party_info['link_man'];
             $data['bank_account_name'] = $second_party_info['bank_account_name'];
             $data['settlement_type_value'] = $getStatementData['settlement_type'];
+            $data['settlement_type_value'] = $getStatementData['settlement_type'];
 
             $data['invoice_item'] = $second_party_info['invoice_item'];
             $data['invoice_type'] = $second_party_info['invoice_type'];
diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php
index 0d08c400c..eb9d9ec52 100644
--- a/Application/Admin/Controller/PromoteGameRatioController.class.php
+++ b/Application/Admin/Controller/PromoteGameRatioController.class.php
@@ -64,7 +64,7 @@ class PromoteGameRatioController extends ThinkController
             $promoteIds = array_column($promoteGameRatios, 'promote_id');
             $gameIds = array_column($promoteGameRatios, 'game_id');
             $promoteFiled = 'id, account, mobile_phone, create_time, status, ver_status';
-            $gameFiled = 'id, game_name, ratio';
+            $gameFiled = 'id, relation_game_name, ratio';
             $promotes = M('promote', 'tab_')->where(array('id' => ['in', $promoteIds]))->getField($promoteFiled, true);
             $games = M('game', 'tab_')->where(array('id' => ['in', $gameIds]))->getField($gameFiled, true);
 
@@ -103,7 +103,7 @@ class PromoteGameRatioController extends ThinkController
                     $thisPromoteVerStatus = getPromoteVerStatus($promotes[$thisPromoteId]['ver_status'], 2);
                 }
                 if ($issetGame) {
-                    $thisGameName = $games[$thisGameId]['game_name'];
+                    $thisGameName = $games[$thisGameId]['relation_game_name'];
                     $thisGameRatio = $games[$thisGameId]['ratio'];
                     $thisGameRatio = ($thisGameRatio ?? '0.00') . '%';
                 }
@@ -161,7 +161,7 @@ class PromoteGameRatioController extends ThinkController
         $this->assign('group', $group);
         $this->assign('records', $records);
         $this->assign('count', $count);
-        $this->assign('gameList', getAllGameList());
+        $this->assign('gameList', getAllGameList(true));
         $this->assign('promoteList', getPromoteByLevel(1));
         $this->assign('statusList', self::$statusList);
         $this->assign('reviewRule', $reviewRule);
@@ -326,7 +326,7 @@ class PromoteGameRatioController extends ThinkController
                 $this->assign('lastRatio', $lastRatio);
             }
 
-            $this->assign('gameList', getAllGameList());
+            $this->assign('gameList', getAllGameList(true));
             $this->assign('promoteList', getPromoteByLevel(1));
             $this->meta_title = $metaTitle;
             $this->display();
@@ -389,8 +389,11 @@ class PromoteGameRatioController extends ThinkController
                             $promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true);
                             $promoteIds[] = $promoteId;
 
+                            $gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true);
+                            $gameIds = $gameIds ?? [-1];
+
                             $spendMap['promote_id'] = ['in', $promoteIds];
-                            $spendMap['game_id'] = $promoteGameRatio['game_id'];
+                            $spendMap['game_id'] = ['in', $gameIds];
                             if ($promoteGameRatio['end_time'] > 0) {
                                 $spendMap['pay_time'] = ['between', [$promoteGameRatio['begin_time'], $promoteGameRatio['end_time'] + 3600 * 24 - 1]];
                             } else {
diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php
index 4bc33ad8f..c1e27199c 100644
--- a/Application/Admin/Controller/QueryController.class.php
+++ b/Application/Admin/Controller/QueryController.class.php
@@ -1470,14 +1470,17 @@ class QueryController extends ThinkController
         }
 
         if ($_REQUEST['device']) {
-            $map['game_name'] = ['like','%'.$_REQUEST['device'].'%'];
-        }
+//            $map['tab_spend.sdk_version'] = $_REQUEST['device'];
+            $spendMap['tab_spend.sdk_version'] = $_REQUEST['device'];
 
+        }
+        $spendMap['tab_spend.pay_status'] = 1;
         //获取spend表中的数据,同时根据会长id进行group分类
         $data = M('Spend','tab_')
-            ->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,game_name,SUBSTRING_INDEX(`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id ")
+            ->field("FROM_UNIXTIME(pay_time,'%Y-%m') as my_time,sum(pay_amount) as pay_amount,game_id,tab_spend.game_name,SUBSTRING_INDEX(tab_spend.`game_name`,\"(\",1) as game_names,promote_id,promote_account,company_relation,company_belong,CASE WHEN SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1)='' THEN promote_id ELSE SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,\"/\",2),\"/\",-1) END as root_id,tab_game.ratio ")
             ->join("left join tab_promote on promote_id = tab_promote.id")
-            ->where(['pay_status'=>1])
+            ->join("left join tab_game on tab_game.id=tab_spend.game_id")
+            ->where($spendMap)
             ->group("my_time,game_names,root_id")
             ->order("my_time Desc")
             ->select(false);
@@ -1493,7 +1496,7 @@ class QueryController extends ThinkController
 
         //关联表获取会长账号名
         $data = M()->table('('.$data.') as a')
-            ->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,tab_ratio.ratio as ratio,turnover_ratio")
+            ->field("my_time,pay_amount,a.game_id,game_name,game_names,a.promote_id,a.promote_account,a.company_relation,a.company_belong,CASE WHEN root_id is null THEN 0 ELSE root_id END as root_id,CASE WHEN account is null THEN '官方渠道' ELSE account END as account,tab_ratio.ratio as ratio,turnover_ratio,a.ratio as game_ratio")
             ->join("left join tab_promote on root_id = tab_promote.id")
             ->join("left join tab_promote_game_ratio as tab_ratio on tab_ratio.game_id = a.game_id and tab_ratio.promote_id=root_id")
 //            ->join("left join tab_cp_game_ratio as game_ratio on game_ratio.game_id = a.game_id")
@@ -1520,10 +1523,9 @@ class QueryController extends ThinkController
             if ($value['ratio']) {
                 $data[$key]['downstream'] = $value['pay_amount'] * ($value['ratio']*0.01);
             } else {
-                $data[$key]['downstream'] = $value['pay_amount'] * 0;
+                $data[$key]['downstream'] = $value['pay_amount'] * ($value['game_ratio']*0.01);
             }
 
-
             $value['turnover_ratio'] = json_decode($value['turnover_ratio'],true);
 
 //            dd($value);
diff --git a/Application/Admin/Model/WithdrawModel.class.php b/Application/Admin/Model/WithdrawModel.class.php
index ea73951c1..dbd374981 100644
--- a/Application/Admin/Model/WithdrawModel.class.php
+++ b/Application/Admin/Model/WithdrawModel.class.php
@@ -268,37 +268,42 @@ class WithdrawModel extends Model{
             $balance = 0;
             $notInGameIds = [-1];
             foreach ($promoteGameRatios as $promoteGameRatio) {
-                $spendWhere['game_id'] = $promoteGameRatio['game_id'];
                 if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
-                    $notInGameIds[] = $promoteGameRatio['game_id'];
                     $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'];
-                    $sumAmount = $sumAmount ?? 0;
-                    foreach ($turnoverRatios as $turnoverRatio) {
-                        if ($sumAmount >= $turnoverRatio['turnover']) {
-                            $ratio = $turnoverRatio['ratio'];
-                            break;
+                    $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;
+                            $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
+                                ->where($spendWhere)
+                                ->find()['sum_amount'];
+                            $sumAmount = $sumAmount ?? 0;
+                            foreach ($turnoverRatios as $turnoverRatio) {
+                                if ($sumAmount >= $turnoverRatio['turnover']) {
+                                    $ratio = $turnoverRatio['ratio'];
+                                    break;
+                                }
+                            }
+
+                            $thisBalance = $spendModel->field("sum(pay_amount * {$ratio}) as balance")
+                                ->where($spendWhere)
+                                ->find()['balance'];
+                            $thisBalance = $thisBalance ?? 0;
+                            $balance = bcadd($balance, $thisBalance, 2);
+
+                            $gameRatios[$gameId] = [];
+                            $gameRatios[$gameId][] = [
+                                'selle_ratio' => $ratio,
+                                'default_ratio' => $promoteGameRatio['ratio'],
+                                'sum_amount' => $sumAmount,
+                                'begin_time' => $beginTime,
+                                'end_time' => $endTime,
+                            ];
                         }
                     }
-
-                    $thisBalance = $spendModel->field("sum(pay_amount * {$ratio}) as balance")
-                        ->where($spendWhere)
-                        ->find()['balance'];
-                    $thisBalance = $thisBalance ?? 0;
-                    $balance = bcadd($balance, $thisBalance, 2);
-
-                    $gameRatios[$promoteGameRatio['game_id']] = [];
-                    $gameRatios[$promoteGameRatio['game_id']][] = [
-                        'selle_ratio' => $ratio,
-                        'default_ratio' => $promoteGameRatio['ratio'],
-                        'sum_amount' => $sumAmount,
-                        'begin_time' => $beginTime,
-                        'end_time' => $endTime,
-                    ];
                 }
             }
 
@@ -391,33 +396,38 @@ 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)) {
-                $spendMap['game_id'] = $promoteGameRatio['game_id'];
                 $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'];
-                $sumAmount = $sumAmount ?? 0;
-                $ratio = 0;
-                foreach ($turnoverRatios as $turnoverRatio) {
-                    if ($sumAmount >= $turnoverRatio['turnover']) {
-                        $ratio = $turnoverRatio['ratio'];
-                        break;
-                    }
-                }
+                $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;
+                        $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
+                            ->where($spendMap)
+                            ->find()['sum_amount'];
+                        $sumAmount = $sumAmount ?? 0;
+                        $ratio = 0;
+                        foreach ($turnoverRatios as $turnoverRatio) {
+                            if ($sumAmount >= $turnoverRatio['turnover']) {
+                                $ratio = $turnoverRatio['ratio'];
+                                break;
+                            }
+                        }
 
-                if ($ratio > 0) {
-                    $ratio = bcsub($ratio, $promoteGameRatio['ratio'], 2);
-                    $thisBalance = bcdiv(bcmul($sumAmount, $ratio, 2), 100, 2);
-                    $balance = bcadd($balance, $thisBalance, 2);
-
-                    $gameRatios[$promoteGameRatio['game_id']][] = [
-                        'selle_ratio' => $ratio,
-                        'default_ratio' => $promoteGameRatio['ratio'],
-                        'sum_amount' => $sumAmount,
-                        'begin_time' => date('Y-m-d', $settlementBeginTime),
-                        'end_time' => date('Y-m-d', $settlementEndTime),
-                    ];
+                        if ($ratio > 0) {
+                            $ratio = bcsub($ratio, $promoteGameRatio['ratio'], 2);
+                            $thisBalance = bcdiv(bcmul($sumAmount, $ratio, 2), 100, 2);
+                            $balance = bcadd($balance, $thisBalance, 2);
+
+                            $gameRatios[$gameId][] = [
+                                'selle_ratio' => $ratio,
+                                'default_ratio' => $promoteGameRatio['ratio'],
+                                'sum_amount' => $sumAmount,
+                                'begin_time' => date('Y-m-d', $settlementBeginTime),
+                                'end_time' => date('Y-m-d', $settlementEndTime),
+                            ];
+                        }
+                    }
                 }
             }
         }
@@ -477,25 +487,30 @@ 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)) {
-                $spendMap['game_id'] = $promoteGameRatio['game_id'];
                 $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'];
-                $sumAmount = $sumAmount ?? 0;
-                $ratio = 0;
-                foreach ($turnoverRatios as $turnoverRatio) {
-                    if ($sumAmount >= $turnoverRatio['turnover']) {
-                        $ratio = $turnoverRatio['ratio'];
-                        break;
-                    }
-                }
+                $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;
+                        $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
+                            ->where($spendMap)
+                            ->find()['sum_amount'];
+                        $sumAmount = $sumAmount ?? 0;
+                        $ratio = 0;
+                        foreach ($turnoverRatios as $turnoverRatio) {
+                            if ($sumAmount >= $turnoverRatio['turnover']) {
+                                $ratio = $turnoverRatio['ratio'];
+                                break;
+                            }
+                        }
 
-                if ($ratio > 0) {
-                    $ratio = bcsub($ratio, $promoteGameRatio['ratio'], 2);
-                    $thisBalance = bcdiv(bcmul($sumAmount, $ratio, 2), 100, 2);
-                    $balance = bcadd($balance, $thisBalance, 2);
+                        if ($ratio > 0) {
+                            $ratio = bcsub($ratio, $promoteGameRatio['ratio'], 2);
+                            $thisBalance = bcdiv(bcmul($sumAmount, $ratio, 2), 100, 2);
+                            $balance = bcadd($balance, $thisBalance, 2);
+                        }
+                    }
                 }
             }
         }
@@ -532,28 +547,33 @@ class WithdrawModel extends Model{
             $balance = 0;
             $notInGameIds = [-1];
             foreach ($promoteGameRatios as $promoteGameRatio) {
-                $spendWhere['game_id'] = $promoteGameRatio['game_id'];
                 if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) {
-                    $notInGameIds[] = $promoteGameRatio['game_id'];
                     $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'];
-                    $sumAmount = $sumAmount ?? 0;
-                    foreach ($turnoverRatios as $turnoverRatio) {
-                        if ($sumAmount >= $turnoverRatio['turnover']) {
-                            $ratio = $turnoverRatio['ratio'];
-                            break;
+                    $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;
+                            $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount")
+                                ->where($spendWhere)
+                                ->find()['sum_amount'];
+                            $sumAmount = $sumAmount ?? 0;
+                            foreach ($turnoverRatios as $turnoverRatio) {
+                                if ($sumAmount >= $turnoverRatio['turnover']) {
+                                    $ratio = $turnoverRatio['ratio'];
+                                    break;
+                                }
+                            }
+
+                            $thisBalance = $spendModel->field("sum(pay_amount * {$ratio}) as balance")
+                                ->where($spendWhere)
+                                ->find()['balance'];
+                            $thisBalance = $thisBalance ?? 0;
+                            $balance = bcadd($balance, $thisBalance, 2);
                         }
                     }
-
-                    $thisBalance = $spendModel->field("sum(pay_amount * {$ratio}) as balance")
-                        ->where($spendWhere)
-                        ->find()['balance'];
-                    $thisBalance = $thisBalance ?? 0;
-                    $balance = bcadd($balance, $thisBalance, 2);
                 }
             }
 
diff --git a/Application/Admin/View/PromoteGameRatio/applyRatio.html b/Application/Admin/View/PromoteGameRatio/applyRatio.html
index 7d14a96be..a75a45d7a 100644
--- a/Application/Admin/View/PromoteGameRatio/applyRatio.html
+++ b/Application/Admin/View/PromoteGameRatio/applyRatio.html
@@ -105,11 +105,11 @@
                   <option value="">游戏名称</option>
                   <empty name="record">
                     <volist name="gameList" id="vo">
-                      <option value="{$vo.id}">{$vo.game_name}</option>
+                      <option value="{$vo.id}">{$vo.relation_game_name}</option>
                     </volist>
                     <else/>
                     <volist name="gameList" id="vo">
-                      <option value="{$vo.id}" <if condition="$vo['id'] eq $record['game_id']">selected</if> >{$vo.game_name}</option>
+                      <option value="{$vo.id}" <if condition="$vo['id'] eq $record['game_id']">selected</if> >{$vo.relation_game_name}</option>
                     </volist>
                   </empty>
                 </select>
diff --git a/Application/Admin/View/Query/marketList.html b/Application/Admin/View/Query/marketList.html
index 61ab31b83..0f240b493 100644
--- a/Application/Admin/View/Query/marketList.html
+++ b/Application/Admin/View/Query/marketList.html
@@ -111,8 +111,8 @@
             <div class="input-list input-list-game search_label_rehab">
                 <select name="device" class="select_gallery">
                     <option value="">设备类型</option>
-                    <option value="安卓版">安卓</option>
-                    <option value="苹果版">IOS</option>
+                    <option value="1">安卓</option>
+                    <option value="2">IOS</option>
                 </select>
             </div>
             <input type="hidden" name="" value="" class="sortBy">
diff --git a/Application/Admin/View/StatementMangement/createDownstreamOrder.html b/Application/Admin/View/StatementMangement/createDownstreamOrder.html
index 359783339..8bc59c8a6 100644
--- a/Application/Admin/View/StatementMangement/createDownstreamOrder.html
+++ b/Application/Admin/View/StatementMangement/createDownstreamOrder.html
@@ -211,6 +211,7 @@
 
     //搜索功能
     $("#ext_field").change(function(){
+      key = 0;
       var ext_field = $("#ext_field").val();
       console.log(ext_field);
       $("tbody").empty();
@@ -259,7 +260,7 @@
               console.log(data)
               for (var i in data){
                 if (data[i].company_id) {
-                  add += "<option company_id='" + data[i].company_id + "'  value='" + data[i].company_id + "' " + ('selected') + ">" + data[i].company_name + "</option>"
+                  add += "<option company_id='" + data[i].company_id + "'  value='" + data[i].company_name + "' " + ('selected') + ">" + data[i].company_name + "</option>"
                 }
               }
               $("#company_name").empty();
@@ -334,6 +335,7 @@
 
     //搜索功能
     $("#company_name").change(function(){
+      key = 0;
       var ext_field = $("#company_name option:selected").attr('company_id');
       console.log(ext_field);
       $("tbody").empty();
diff --git a/Application/Admin/View/StatementMangement/edit.html b/Application/Admin/View/StatementMangement/edit.html
index 320dd2449..d3367b8a6 100644
--- a/Application/Admin/View/StatementMangement/edit.html
+++ b/Application/Admin/View/StatementMangement/edit.html
@@ -52,7 +52,7 @@
       </div>
       <div class="input-list input-list-promote search_label_rehab" style="width: 50%">
         银行账号:
-        <input type="text" readonly id="bank_card" name="bank_card" class="" value="" placeholder="银行账号"  style="width: 50%"/>
+        <input type="text" id="bank_card" name="bank_card" class="" value="" placeholder="银行账号"  style="width: 50%"/>
       </div>
 
       <div class="input-list input-list-promote search_label_rehab" style="width: 50%">
@@ -204,7 +204,7 @@
         success:function(data){
           console.log($("#company_name option:selected").attr('company-type'))
 
-          $("#company_name").val(data.data.company_name);
+          $("#company_name").append("<option value='"+data.data.company_name+"' selected='selected'>"+data.data.company_name+"</option>");
           $("#settlement_type").text(data.data.settlement_type);
           $("#bank_card").val(data.data.bank_card);
           $("#account_openin").val(data.data.account_openin);
diff --git a/Application/Admin/View/StatementMangement/lists.html b/Application/Admin/View/StatementMangement/lists.html
index b63d1f763..59a5b90fd 100644
--- a/Application/Admin/View/StatementMangement/lists.html
+++ b/Application/Admin/View/StatementMangement/lists.html
@@ -139,7 +139,7 @@
                                 </td>
                             </tr>
                         </volist>
-                        <tr><td>合计</td><td colspan="10">公司对账金额合计:{$sum[0]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp对账金额合计:{$sum[1]}</td></tr>
+                        <tr><td>合计</td><td colspan="10">公司对账金额合计:{$sum[1]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp对账金额合计:{$sum[0]}</td></tr>
                     </notemtpy>
                     </tbody>
                 </table>
diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php
index e774ef468..fd93d3863 100644
--- a/Application/Common/Common/extend.php
+++ b/Application/Common/Common/extend.php
@@ -1106,6 +1106,10 @@ function getGameSelleRatioByPromote($promoteId = null, $gameId = null)
     $promoteId = intval($promoteId);
     $gameId = intval($gameId);
     $promote = M('promote', 'tab_')->find($promoteId);
+    $gameId = M('game', 'tab_')->where(array('id' => $gameId))->getField('relation_game_id');
+    if (empty($gameId)) {
+        return false;
+    }
 
     if (empty($promote)) {
         return false;
diff --git a/Data/update.sql b/Data/update.sql
index 580b72df0..54f3bea9e 100644
--- a/Data/update.sql
+++ b/Data/update.sql
@@ -1098,3 +1098,11 @@ CREATE TABLE `sys_document_pop_rules` (
   `operater_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作者ID',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+-- 2020-01-14
+-- cxj
+ALTER TABLE `tab_promote_game_ratio`
+MODIFY COLUMN `turnover_ratio` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '流水分成比例' AFTER `last_ratio_status`,
+MODIFY COLUMN `last_turnover_ratio` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '上次流水分成比例';
+
+UPDATE tab_spend SET selle_ratio = 0.00 where selle_ratio is null
\ No newline at end of file