diff --git a/Application/Admin/Controller/OldCountController.class.php b/Application/Admin/Controller/OldCountController.class.php index b9bde1856..1ba51b2b5 100644 --- a/Application/Admin/Controller/OldCountController.class.php +++ b/Application/Admin/Controller/OldCountController.class.php @@ -9,6 +9,24 @@ namespace Admin\Controller; */ class OldCountController extends \Think\Controller { + + public function changeCompanyGameidToPromoteGameid() + { + //默认设为 + $Promote = M("Promote","tab_"); + $PromoteCompany = M("promote_company","tab_"); + $p_res = $PromoteCompany->field("id,game_ids")->select(); + + foreach ($p_res as $k => $v) { + if(!empty($v['game_ids'])){ + $savedata =["company_id"=>$v['id'] ]; + $savedata['game_ids'] = $this->changeRelationGameidToGameid($v['game_ids']); + $Promote->save($savedata); + } + } + echo "changeCompanyGameidToPromoteGameid success"; + } + /** * 公会关系及游戏迁移 * 1. 迁移 公会company_relation到公司 @@ -50,6 +68,16 @@ class OldCountController extends \Think\Controller return implode(",",array_column($rid,'relation_game_id')); } } + protected function changeRelationGameidToGameid($ids,$type=false) + { + $rid = M('game', 'tab_')->field('id')->where(["relation_game_id"=>["in",$ids]])->select(); + if($type){ + return array_column($rid,'id'); + }else{ + return implode(",",array_column($rid,'id')); + } + + } /** * 优化旧表数值,新表需要将 开票税点及渠道费 * 100