小程序二维码推广

master
tping 3 years ago
parent 17c01de7a6
commit 4bd677bf83

@ -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']

@ -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' => '保存成功!']);
}

Loading…
Cancel
Save