From f0322578383fb2d52fb265c3cd16a89d7927690a Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 17 Dec 2019 11:30:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0>=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=AE=A1=E7=90=86>=E5=85=85=E5=80=BC=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteGameRatioController.class.php | 19 +++++++++++++++++++ .../Model/PromoteGameRatioModel.class.php | 2 +- Application/Home/Common/function.php | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php index 3e9105e12..ce6b4bba8 100644 --- a/Application/Admin/Controller/PromoteGameRatioController.class.php +++ b/Application/Admin/Controller/PromoteGameRatioController.class.php @@ -6,11 +6,30 @@ use Think\Controller; class PromoteGameRatioController extends ThinkController { + const MODEL_NAME = 'promote_game_ratio'; + public function lists() { $params = I('get.'); $promoteAccount = $params['promote_account'] ?? ''; $gameId = $params['game_id'] ?? 0; $status = $params['status'] ?? ''; + + $map['_string'] = '1 = 1'; + if ($promoteAccount) { + $promoteMap['account'] = $promoteAccount; + $promoteId = M('promote', 'tab_')->where($promoteMap)->getField('id'); + $promoteId = $promoteId ?? 0; + $map['promote_id'] = $promoteId; + } + if ($gameId) { + $map['game_id'] = $gameId; + } + if ($status !== '') { + $map['status'] = $status; + } + + $field = 'create_time, update_time'; + $query = D(self::MODEL_NAME)->getLists(); } } \ No newline at end of file diff --git a/Application/Admin/Model/PromoteGameRatioModel.class.php b/Application/Admin/Model/PromoteGameRatioModel.class.php index 715ec4169..ea16a31f0 100644 --- a/Application/Admin/Model/PromoteGameRatioModel.class.php +++ b/Application/Admin/Model/PromoteGameRatioModel.class.php @@ -2,7 +2,7 @@ namespace Admin\Model; -class PromoteGameRatioModel +class PromoteGameRatioModel extends CommentModel { } \ No newline at end of file diff --git a/Application/Home/Common/function.php b/Application/Home/Common/function.php index 1fb3c1774..d473d7d5c 100644 --- a/Application/Home/Common/function.php +++ b/Application/Home/Common/function.php @@ -1197,4 +1197,19 @@ function promoteCan($promoteId, \Closure $callback) function getChildGameAddPermission($promoteId) { return D('Promote')->where(array('id' => $promoteId))->getField('child_game_permission'); +} + +function gameSearch($relationGameId, $sdkVersion) +{ + $map['_string'] = '1 = 1'; + if ($relationGameId != 0) { + $map['relation_game_id'] = $relationGameId; + } + if ($sdkVersion != 0) { + $map['sdk_version'] = $sdkVersion; + } + $gameIds = M('game', 'tab_')->where($map)->getField('id', true); + $gameIds = $gameIds ?? [-1]; + + return $gameIds; } \ No newline at end of file