From 4bd677bf8344de6af257b05480aaacaa0105ecfb Mon Sep 17 00:00:00 2001 From: tping Date: Tue, 24 Aug 2021 18:19:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E6=8E=A8=E5=B9=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Qrcode/Controller/JumpController.class.php | 4 +++- .../Controller/QrCodePromotionController.class.php | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Application/Qrcode/Controller/JumpController.class.php b/Application/Qrcode/Controller/JumpController.class.php index 4f628b7f1..dc3378f07 100644 --- a/Application/Qrcode/Controller/JumpController.class.php +++ b/Application/Qrcode/Controller/JumpController.class.php @@ -64,18 +64,20 @@ class JumpController extends HomeController $id = I('request.id', 0); if (!$id || !is_numeric($id)) { $this->ajaxReturn([ + 'id' => $_REQUEST['id'], 'status' => 1, 'background_img' => $backgroundImg, 'qrcode_img' => $qrCodeImg ]); } - // 二维码 + // 二维码: $qrcodePromotionList = M('qrcode_promotion_list', 'tab_')->where(['id' => $id])->find(); // 背景图 $qrcodePromotion = M('qrcode_promotion', 'tab_')->where(['id' => $qrcodePromotionList['qp_id']])->find(); $this->ajaxReturn([ + 'id' => $_REQUEST['id'], 'status' => 1, 'background_img' => $qrcodePromotion['background_img'], 'qrcode_img' => $qrcodePromotionList['qrcode_img'] diff --git a/Application/Qrcode/Controller/QrCodePromotionController.class.php b/Application/Qrcode/Controller/QrCodePromotionController.class.php index 9b18fedc7..cfef9a52d 100644 --- a/Application/Qrcode/Controller/QrCodePromotionController.class.php +++ b/Application/Qrcode/Controller/QrCodePromotionController.class.php @@ -159,21 +159,26 @@ class QrCodePromotionController extends BaseController public function linkAdd() { if (IS_POST) { + $isHttps = is_https(); $loginer = $this->getLoginPromote(); $params = I('post.'); if (!$params['id']) { $this->ajaxReturn(['status' => 0, 'message' => '参数有误!']); } - M('qrcode_promotion_list', 'tab_')->add([ + $id = M('qrcode_promotion_list', 'tab_')->add([ 'qp_id' => $params['id'], 'admin_id' => $loginer['id'], 'admin_name' => $loginer['account'], - 'h5_link' => "1", + 'h5_link' => "", 'create_time' => time(), 'status' => 0, 'qrcode_img' => $params['img'], ]); + if ($id > 0) { + $h5Link = ($isHttps? 'https://': 'http://').$_SERVER['HTTP_HOST']."index.php?s=/Qrcode/Jump/jumpMp/id/{$id}"; + M('qrcode_promotion_list', 'tab_')->where(['id' => $id])->save(['h5_link' => $h5Link]); + } $this->ajaxReturn(['status' => 1, 'message' => '保存成功!']); }