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