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;">