星哥的博客

  • 首页
  • 系统
  • 虚拟机
  • 网站开发
  • 硬件外设
  • VPS/云主机
  • 心情随笔
  1. 首页
  2. 网站开发
  3. Code
  4. 正文

微赞自定义二维码功能增强

2016年7月6日 3314点热度 1人点赞 0条评论

微赞自定义二维码功能增强

修改web/source/platform/qr.ctrl.php,第168行,修改为

if($do == 'display') {
$_W['page']['title'] = '扫描统计 - 二维码管理 - 高级功能'.$_GPC['type'];
$starttime = empty($_GPC['time']['start']) ? TIMESTAMP - 86399 * 30 : strtotime($_GPC['time']['start']);
$endtime = empty($_GPC['time']['end']) ? TIMESTAMP + 6*86400: strtotime($_GPC['time']['end']) + 86399;
$where .= " WHERE uniacid = :uniacid AND acid = :acid AND createtime >= :starttime AND createtime < :endtime";
$param = array(':uniacid' => $_W['uniacid'], ':acid' => $_W['acid'], ':starttime' => $starttime, ':endtime' => $endtime);
!empty($_GPC['keyword']) && $where .= " AND scene_str LIKE '%{$_GPC['keyword']}%'";
!empty($_GPC['type']) && $where .= ' AND type = '.$_GPC['type'];
$pindex = max(1, intval($_GPC['page']));
$psize = 10;
$type = $_GPC['type'];
$type1 = ' AND type = 1';
$type2 = ' AND type = 2';
$count = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('qrcode_stat'). $where, $param);
$countt1 = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('qrcode_stat'). $where. $type1, $param);
$countt2 = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('qrcode_stat'). $where. $type2, $param);
if($_GPC['type']==2){
//$countt2 = $countt2 / 2;
$count = $countt2;
$typetext = '扫描';
}elseif($_GPC['type']==1){
$count = $countt1;
$typetext = '关注';
}else{
//$countt2 = $countt2 / 2;
$count = $countt1 + $countt2;
$typetext = '关注+扫描';
}
$list = pdo_fetchall("SELECT * FROM ".tablename('qrcode_stat')." $where ORDER BY id DESC LIMIT ".($pindex - 1) * $psize.','. $psize, $param);
if (!empty($list)) {
$openid = array();
foreach ($list as $index => &$qrcode) {
if ($qrcode['type'] == 1) {
$qrcode['type']="关注";
} else {
$qrcode['type']="扫描";
}
if(!in_array($qrcode['openid'], $openid)) {
$openid[] = $qrcode['openid'];
}
}
$openids = implode("','", $openid);
$param_temp[':uniacid'] = $_W['uniacid'];
$param_temp[':acid'] = $_W['acid'];
$nickname = pdo_fetchall('SELECT nickname, openid FROM ' . tablename('mc_mapping_fans') . " WHERE uniacid = :uniacid AND acid = :acid AND openid IN ('{$openids}')", $param_temp, 'openid');
}
$total = pdo_fetchcolumn('SELECT COUNT(*) FROM ' . tablename('qrcode_stat') . $where, $param);
$pager = pagination($total, $pindex, $psize);
template('platform/qr-display');
}

修改web/themes/default/qr-display.html,第19行,修改为

<select name="type" class="form-control" style="width: 80px;">
<option value="0" {php if(empty($type))echo "selected";}>全部</option>
<option value="1" {php if($type==1)echo "selected";}>关注</option>
<option value="2" {php if($type==2)echo "selected";}>扫描</option>
</select>

第38行

<div class="panel-heading">详细数据&nbsp;&nbsp;&nbsp;&nbsp;<span class="text-muted" style="color:red;">扫描次数:{$count}</span></div>

修改为:

<div class="panel-heading">详细数据&nbsp;&nbsp;&nbsp;&nbsp;<span class="text-muted" style="color:red;">{$typetext}次数:{$count}</span></div>

标签: 暂无
最后更新:2016年7月6日

wangxingcs

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

This site uses Akismet to reduce spam. Learn how your comment data is processed.

wangxingcs

这个人很懒,什么都没留下

我的博客

仅记录一些有用的教程,自己的经历,已屏蔽各大搜索引擎收录。

新浪微博 @wangxingcs

Twitter @wangxingcs(常在)

最新 热点 随机
最新 热点 随机
Proxmox VE(PVE)6.X 添加硬盘 PVE解决VM is locked问题 Proxmox VE配置更新源 黑群晖显示真实CPU信息(支持7.0.1) Proxmox VE直通硬盘(全盘映射方式) PVE去除“没有有效订阅”提示
CentOs下 PHP安装imap和exif等模块 Windows Server 2008 R2 Hyper-V 安装指南 AMH5下给NGINX开启SPDY支持 CentOS 多线程下载工具 lftp Zend Opcache安装配置 黑群晖显示真实CPU信息(支持7.0.1)
标签聚合
FineCMS MTP 群晖 驱动 CMS DSM PVE 虚拟机

COPYRIGHT © 2015-2023 wangxingcs.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

陕ICP备13007295号