From a06b199068de6ac8201b15b22133d5b04af7a07f Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 12 Mar 2020 15:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=90=BD=E5=9C=B0=E9=A1=B5=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PackageDownloadLogService.class.php | 24 ++++++++++++ .../Home/Controller/HomeController.class.php | 9 +++++ .../Controller/PackageController.class.php | 26 +++++++++++++ .../Home/View/default/Home/landingPage.html | 39 +++++++++++++++---- .../Controller/CommonController.class.php | 6 +-- .../Mobile/Controller/SsgController.class.php | 10 +++++ 6 files changed, 103 insertions(+), 11 deletions(-) create mode 100644 Application/Base/Service/PackageDownloadLogService.class.php diff --git a/Application/Base/Service/PackageDownloadLogService.class.php b/Application/Base/Service/PackageDownloadLogService.class.php new file mode 100644 index 000000000..f5c4e2296 --- /dev/null +++ b/Application/Base/Service/PackageDownloadLogService.class.php @@ -0,0 +1,24 @@ +add([ + 'user_id' => $userId, + 'game_id' => $gameId, + 'promote_id' => $promoteId, + 'type' => $type, + 'create_time' => time() + ]); + + } +} \ No newline at end of file diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index 7077e3e01..3008c4c72 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -5,6 +5,7 @@ use Think\Controller; use User\Api\MemberApi; use Base\Facade\Request; use Base\Service\ApplyService; +use Base\Service\PackageDownloadLogService; /** * 前台公共控制器 @@ -316,6 +317,14 @@ class HomeController extends Controller $this->error('链接丢失'); } + $packageDownloadLogService = new PackageDownloadLogService(); + $packageDownloadLogService->add([ + 'user_id' => 0, + 'game_id' => $gameId, + 'promote_id' => $promoteId, + 'type' => 1, + ]); + if ($status == 1) { $downLink = 'itms-services://?action=download-manifest&url=' . "https://" . $_SERVER["HTTP_HOST"] . ltrim(M('GameSource', 'tab_')->where(array('game_id' => $gameId))->getField('org_plist_url'), '.'); } else { diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index 37364c1cc..b55b4e79e 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -7,6 +7,7 @@ use Think\Think; use Base\Service\PromoteService; use Base\Facade\Request; use Base\Service\ApplyService; +use Base\Service\PackageDownloadLogService; /** * @author elf<360197197@qq.com> @@ -85,6 +86,14 @@ class PackageController extends Controller if (Request::isAndroid()) { $this->gotoPkgUrl($packageUrl); } else if (Request::isIOS()) { + $packageDownloadLogService = new PackageDownloadLogService(); + $packageDownloadLogService->add([ + 'user_id' => 0, + 'game_id' => $gameId, + 'promote_id' => $promoteId, + 'type' => 1, + ]); + $plistUrl = substr($packageUrl, 1, strlen($packageUrl)); header("HTTP/1.1 303 See Other"); header("Location: "."itms-services://?action=download-manifest&url=" . C('DOMAIN_DOWNLOAD') . '/' . ltrim($plistUrl, '/')); @@ -113,4 +122,21 @@ class PackageController extends Controller } } } + + public function addDownloadLog() + { + $params = I('.post'); + $packageDownloadLogService = new PackageDownloadLogService(); + if ($packageDownloadLogService->add($params)) { + $this->ajaxReturn([ + 'status' => true, + 'message' => '记录成功' + ]); + } else { + $this->ajaxReturn([ + 'status' => false, + 'message' => '系统异常' + ]); + } + } } diff --git a/Application/Home/View/default/Home/landingPage.html b/Application/Home/View/default/Home/landingPage.html index c9cefe6d0..5587d69ca 100644 --- a/Application/Home/View/default/Home/landingPage.html +++ b/Application/Home/View/default/Home/landingPage.html @@ -557,7 +557,7 @@ background:rgba(0,0,0,0.6); z-index: 999;display: none;">