diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index 6691814c6..032f38167 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -88,4 +88,11 @@ class ConsoleController extends Think { } } } + + /* public function generatePromoteUserLoginCount() + { + $promotes = M('user_login_record')->where('1=1')->limit(10, 20)->select(); + M('user_login_record', 'tab_')->field(['count(DISTINCT user_id) as count', 'promote_id', 'FROM_UNIXTIME(login_time,"%Y-%m-%d") day']) + ->where(['promote_id' => ['in', $ids]])->group('promote_id, day')->select(); + } */ } diff --git a/Application/Admin/Event/SourceEvent.class.php b/Application/Admin/Event/SourceEvent.class.php index 3264c60f0..992eba2a1 100644 --- a/Application/Admin/Event/SourceEvent.class.php +++ b/Application/Admin/Event/SourceEvent.class.php @@ -10,9 +10,6 @@ namespace Admin\Event; use Think\Controller; use Base\Service\GameSourceService; -use Base\Tool\PlistParser; -use Base\Tool\ApkParser; - /** * 后台首页控制器 * @@ -23,42 +20,23 @@ class SourceEvent extends Controller public function add_source() { - $data = $_REQUEST; - $data['file_size'] = round($data['file_size'] / pow(1024, 2), 2) . "MB"; - $data['file_url'] = $data['file_url'] . "/" . $data['file_name']; - $data['sdk_version'] = $data['file_type']; + $params = $_REQUEST; + $data = []; + $data['game_id'] = $params['game_id']; + $data['game_name'] = $params['game_name']; + $data['file_name'] = $params['file_name']; + $data['file_size'] = round($params['file_size'] / pow(1024, 2), 2) . "MB"; + $data['file_url'] = ''; + $data['sdk_version'] = $params['file_type']; $data['op_id'] = UID; $data['op_account'] = session("user_auth.username"); $data['create_time'] = NOW_TIME; - $remark = str_replace(array("\r\n", "\r", "\n"), "@@@", $_POST['remark']); + $remark = str_replace(array("\r\n", "\r", "\n"), "@@@", $params['remark']); $data['remark'] = json_encode(explode('@@@', $remark)); $data['source_version'] = 0; - $version = ''; - $packageName = ''; - if ($data['file_type'] == 1) { - $parser = new ApkParser(); - $parser->open($data['file_url']); - $version = $parser->getVersionName(); - $packageName = $parser->getPackage(); - } elseif($data['file_type'] == 2) { - $parser = new PlistParser(); - $parser->openFromIpa($data['file_url'], PlistParser::PREG_INFO_PLIST); - $result = $parser->getResult(); - $version = $result['CFBundleShortVersionString']; - $packageName = $result['CFBundleIdentifier']; - } - $data['version'] = $version; - $data['bao_name'] = $packageName; - $game = M('game', 'tab_')->where(['id' => $data['game_id']])->find(); - $gameSourceService = new GameSourceService(); - $result = $gameSourceService->sourcePack($data, $game); - if (!$result['status']) { - $this->error('添加失败' , U('GameSource/lists', ['type' => $data['type']])); - } - $data['plist_url'] = $result['data']['plistUrl']; - $data['org_plist_url'] = $result['data']['orgPlistUrl']; - $data['file_url'] = $result['data']['fileUrl']; - $data['original_url'] = $result['data']['originalUrl']; + $data['bao_name'] = $params['bao_name']; + $data['version'] = $params['version']; + $data['file_type'] = $params['file_type']; if (M('game_source', 'tab_')->add($data)) { //原包打包 $this->update_game_size($data); diff --git a/Application/Admin/View/GameSource/add.html b/Application/Admin/View/GameSource/add.html index aeabae76f..430134974 100644 --- a/Application/Admin/View/GameSource/add.html +++ b/Application/Admin/View/GameSource/add.html @@ -95,7 +95,7 @@