From 16122d5d9f8ae69c5ac26e1441bf39fce56cdac5 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 11 Sep 2020 14:32:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Service/ApplyService.class.php | 13 +++++++++++-- .../Home/Controller/HomeController.class.php | 5 +++-- .../Home/Controller/PackageController.class.php | 7 +++++-- Data/update.sql | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Application/Base/Service/ApplyService.class.php b/Application/Base/Service/ApplyService.class.php index 9db28b296..8d43022c8 100644 --- a/Application/Base/Service/ApplyService.class.php +++ b/Application/Base/Service/ApplyService.class.php @@ -79,7 +79,7 @@ class ApplyService { public function getDownloadUrl($apply) { - $host = C('DOMAIN_DOWNLOAD'); + $host = $this->getDownloadDomain(); $host = $host ? $host : Request::getHost(); $code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_DOWNLOAD); return $host . '/index.php?s=/Home/Package/download/code/' . $code; @@ -87,12 +87,21 @@ class ApplyService { public function getLandingPageUrl($apply) { - $host = C('DOMAIN_DOWNLOAD'); + $host = $this->getDownloadDomain(); $host = $host ? $host : Request::getHost(); $code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_LANDING_PAGE); return $host . '/index.php?s=/Home/Home/landingPage/code/' . $code; } + public function getDownloadDomain() + { + if (C('APP_ENV') == 'prod') { + return C('DOMAIN_DOWNLOAD_PROD'); + } else { + return C('DOMAIN_DOWNLOAD'); + } + } + public function getApplyData($apply, $type, $version) { $data = null; diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index c1c57599f..31016cf8a 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -264,16 +264,17 @@ class HomeController extends Controller // $isIOS = true; $downloadUrl = ''; + $applyService = new ApplyService(); + $downloadDomain = $applyService->getDownloadDomain(); if (!$isNewIos && $isIOS13) { $downloadUrl = 'itms-services://?action=download-manifest&url=' . Request::getHost() . ltrim($gameSource['org_plist_url'], '.'); } else { - $applyService = new ApplyService(); $downloadUrl = $applyService->getDownloadUrl($apply); } $serviceQQ = M("config", "sys_")->field('value')->where("name='APP_QQ'")->find()['value']; - $ssgUrl = C('DOMAIN_DOWNLOAD') . '/mobile.php/Ssg/pay/game_id/' . $game['id'] . '/promote_id/' . $promoteId; + $ssgUrl = $downloadDomain . '/mobile.php/Ssg/pay/game_id/' . $game['id'] . '/promote_id/' . $promoteId; /* if(in_array($game['id'], [187, 188])) { $game['relation_game_name'] = '游戏下载'; diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index 6f664020d..4d6e33753 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -103,6 +103,7 @@ class PackageController extends Controller M('user_action_log', 'tab_')->data($log)->add(); + $downloadDomain = $applyService->getDownloadDomain(); if (Request::isIOS() || Request::isIPadOS()) { $packageDownloadLogService = new PackageDownloadLogService(); $packageDownloadLogService->add([ @@ -114,7 +115,7 @@ class PackageController extends Controller $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, '/')); + header("Location: "."itms-services://?action=download-manifest&url=" . $downloadDomain . '/' . ltrim($plistUrl, '/')); } else { $this->gotoPkgUrl($packageUrl); } @@ -122,6 +123,8 @@ class PackageController extends Controller private function gotoPkgUrl($packageUrl) { + $applyService = new ApplyService(); + $downloadDomain = $applyService->getDownloadDomain(); if (preg_match("/http/", $packageUrl)) { $url = str_replace('-internal', '', $packageUrl); echo ""; @@ -136,7 +139,7 @@ class PackageController extends Controller if (!file_exists($packageUrl)) { $this->error('文件不存在哦,亲!'); }else{ - redirect(C('DOMAIN_DOWNLOAD') . ltrim($packageUrl, '.')); + redirect($downloadDomain . ltrim($packageUrl, '.')); } } } diff --git a/Data/update.sql b/Data/update.sql index e85adbad5..e98d14d62 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2496,3 +2496,20 @@ ADD COLUMN `performance_profit` decimal(13, 2) NULL DEFAULT 0.00 COMMENT '维护 ALTER TABLE `sys_ucenter_member` ADD COLUMN `work_status` tinyint(2) NOT NULL DEFAULT 0 COMMENT '离职状态' AFTER `openid_sign`; + + +CREATE TABLE `tab_payment_orders` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `merchant_id` int(11) NOT NULL COMMENT '商户ID', + `order_no` varchar(100) NOT NULL COMMENT '订单号', + `business_type` varchar(20) NOT NULL DEFAULT '' COMMENT '业务类型', + `order_amount` decimal(12, 2) not null default '0.00' comment '订单金额', + `fee` decimal(12, 2) not null default '0.00' comment '手续费', + `product_name` varchar(255) NOT NULL DEFAULT '' COMMENT '产品名称', + `channel_order_no` varchar(100) NOT NULL DEFAULT '' COMMENT '渠道订单号', + `channel_user_account` varchar(100) NOT NULL DEFAULT '' COMMENT '渠道用户', + `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', + `created_at` datetime NOT NULL COMMENT '订单创建时间', + `finished_at` datetime NOT NULL COMMENT '订单完成时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; \ No newline at end of file