public function doWebManage() { global $_GPC, $_W; load()->model('reply'); $pindex = max(1, intval($_GPC['page'])); $psize = 10; $sql = "uniacid = :uniacid AND `module` = :module"; $params = array(); $params[':uniacid'] = $_W['uniacid']; $params[':module'] = 'weisrc_pano'; if (isset($_GPC['keywords'])) { $sql .= ' AND `name` LIKE :keywords'; $params[':keywords'] = "%{$_GPC['keywords']}%"; } $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keywords'] = reply_keywords_search($condition); $reply = pdo_fetch("SELECT * FROM " . tablename('weisrc_pano_reply') . " WHERE rid = :rid ", array(':rid' => $item['id'])); $item['dateline'] = date('Y-m-d H:i', $reply['dateline']); } } include $this->template('manage'); }
public function doSwitch() { global $_W, $_GPC; $m = array_merge($_W['modules']['userapi'], $_W['account']['modules']['userapi']); $cfg = $m['config']; if ($_W['ispost']) { $rids = explode(',', $_GPC['rids']); if (is_array($rids)) { $cfg = array(); foreach ($rids as $rid) { $cfg[intval($rid)] = true; } $this->saveSettings($cfg); } exit; } load()->model('reply'); $rs = reply_search("uniacid = 0 AND module = 'userapi' AND `status`=1"); $ds = array(); foreach ($rs as $row) { $reply = pdo_fetch('SELECT * FROM ' . tablename($this->tablename) . ' WHERE `rid`=:rid', array(':rid' => $row['id'])); $r = array(); $r['title'] = $row['name']; $r['rid'] = $row['id']; $r['description'] = $reply['description']; $r['switch'] = $cfg[$r['rid']] ? ' checked="checked"' : ''; $ds[] = $r; } include $this->template('switch'); }
public function doWebManage() { //这个操作被定义用来呈现 管理中心导航菜单 global $_GPC, $_W; load()->model('reply'); $pindex = max(1, intval($_GPC['page'])); $psize = 20; $sql = "uniacid = :weid AND `module` = :module"; $params = array(); $params[':weid'] = $_W['uniacid']; $params[':module'] = 'jdg_dream'; if (isset($_GPC['keywords'])) { $sql .= ' AND `name` LIKE :keywords'; $params[':keywords'] = "%{$_GPC['keywords']}%"; } $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keywords'] = reply_keywords_search($condition); $scratch = pdo_fetch("SELECT * FROM " . tablename('dream_reply') . " WHERE rid = :rid ", array(':rid' => $item['id'])); $item['dreamnum'] = $scratch['dreamnum']; $item['viewnum'] = $scratch['viewnum']; $item['starttime'] = date('Y-m-d H:i', $scratch['starttime']); $endtime = $scratch['endtime'] + 86399; $item['endtime'] = date('Y-m-d H:i', $endtime); $nowtime = time(); if ($scratch['starttime'] > $nowtime) { $item['status'] = '<span class="label label-warning">未开始</span>'; $item['show'] = 1; } elseif ($endtime < $nowtime) { $item['status'] = '<span class="label label-default ">已结束</span>'; $item['show'] = 0; } else { if ($scratch['isshow'] == 1) { $item['status'] = '<span class="label label-success">已开始</span>'; $item['show'] = 2; } else { $item['status'] = '<span class="label label-default ">已暂停</span>'; $item['show'] = 1; } } $item['isshow'] = $scratch['isshow']; } } include $this->template('manage'); }
public function doWebManage() { global $_GPC, $_W; $pindex = max(1, intval($_GPC['page'])); $psize = 20; $sql = "uniacid = :uniacid AND `module` = :module"; $params = array(); $params[':uniacid'] = $_W['uniacid']; $params[':module'] = 'ewei_takephotoa'; if (isset($_GPC['keywords'])) { $sql .= ' AND `name` LIKE :keywords'; $params[':keywords'] = "%{$_GPC['keywords']}%"; } load()->model('reply'); $list = array(); $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keywords'] = reply_keywords_search($condition); $reply = pdo_fetch("SELECT rid,title, viewnum,starttime,endtime,status FROM " . tablename('ewei_takephotoa_reply') . " WHERE rid = :rid ", array(':rid' => $item['id'])); $item['rid'] = $reply['rid']; $item['title'] = $reply['title']; $item['fansnum'] = pdo_fetchcolumn("select count(*) from " . tablename('ewei_takephotoa_fans') . " where rid=:rid ", array(":rid" => $item['id'])); $item['viewnum'] = $reply['viewnum']; $item['starttime'] = date('Y-m-d H:i', $reply['starttime']); $endtime = $reply['endtime']; $item['endtime'] = date('Y-m-d H:i', $endtime); $nowtime = time(); if ($reply['starttime'] > $nowtime) { $item['statusstr'] = "<span class=\"label label-warning\">未开始</span>"; } elseif ($endtime < $nowtime) { $item['statusstr'] = "<span class=\"label label-default\">已结束</span>"; } else { if ($reply['status'] == 1) { $item['statusstr'] = "<span class=\"label label-success\">已开始</span>"; } else { $item['statusstr'] = "<span class=\"label \">已暂停</span>"; } } $item['status'] = $reply['status']; } unset($item); } include $this->template('manage'); }
public function doWebManage() { global $_GPC, $_W; $pindex = max(1, intval($_GPC['page'])); $psize = 20; $sql = "uniacid = :uniacid AND `module` = :module"; $params = array(); $params[':uniacid'] = $_W['uniacid']; $params[':module'] = 'xwz_queue'; if (isset($_GPC['keywords'])) { $sql .= ' AND `name` LIKE :keywords'; $params[':keywords'] = "%{$_GPC['keywords']}%"; } load()->model('reply'); $list = array(); $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keywords'] = reply_keywords_search($condition); $reply = pdo_fetch("SELECT rid,title,status FROM " . tablename('xwz_queue_reply') . " WHERE rid = :rid ", array(':rid' => $item['id'])); $item['rid'] = $reply['rid']; $item['title'] = $reply['title']; $types = pdo_fetchall('SELECT * FROM ' . tablename('xwz_queue_type') . ' WHERE rid = :rid', array(':rid' => $reply['rid'])); foreach ($types as &$type) { $type['num'] = pdo_fetchcolumn('select count(*) from ' . tablename('xwz_queue_data') . ' where rid=:rid and typeid=:typeid and status=0', array(':rid' => $reply['rid'], ':typeid' => $type['id'])); } unset($type); $item['types'] = $types; if ($reply['status'] == 1) { $item['statusstr'] = "<span class=\"label label-success\">已开始</span>"; } else { $item['statusstr'] = "<span class=\"label label-default\">已暂停</span>"; } $item['status'] = $reply['status']; } unset($item); } include $this->template('manage'); }
/** * 列表 */ public function doWebManage() { global $_GPC, $_W; load()->model('reply'); $pindex = max(1, intval($_GPC['page'])); $psize = 20; $sql = "uniacid = :uniacid AND `module` = :module"; $params = array(); $params[':uniacid'] = $_W['uniacid']; $params[':module'] = 'eso_runman'; if (isset($_GPC['keywords'])) { $sql .= ' AND `name` LIKE :keywords'; $params[':keywords'] = "%{$_GPC['keywords']}%"; } $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keywords'] = reply_keywords_search($condition); $vote = pdo_fetch("SELECT * FROM " . tablename("eso_runman_reply") . " WHERE rid = :rid ", array(':rid' => $item['id'])); $item['title'] = $vote['title']; $item['join'] = $vote['join']; $item['view'] = $vote['view']; $limits = "活动时间: " . date('Y-m-d H:i:s', $vote['starttime']) . " 至 " . date('Y-m-d H:i:s', $vote['endtime']); $item['limits'] = $limits; if ($vote['endtime'] < SYS_TIME) { $item['status'] = '<span class="label label-default ">活动结束</span>'; } elseif ($vote['starttime'] > SYS_TIME) { $item['status'] = '<span class="label label-default ">活动未开始</span>'; } else { $item['status'] = '<span class="label label-success">活动正常</span>'; } // $item['starttime'] = $vote['starttime'] ? date('Y-m-d H:i:s', $vote['starttime']) : '无限制'; $item['endtime'] = $vote['endtime'] ? date('Y-m-d H:i:s', $vote['endtime']) : '无限制'; } } include $this->template('manage'); }
$key1 = date('m-d', $da['createtime']); if (in_array($key1, $days)) { $datasets[$key1]++; } } $todaytimestamp = strtotime(date('Y-m-d')); $monthtimestamp = strtotime(date('Y-m')); $stat['month'] = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('stat_msg_history') . " WHERE uniacid = :uniacid AND module = :module AND createtime >= '{$monthtimestamp}'", array(':uniacid' => $_W['uniacid'], ':module' => $m_name)); $stat['today'] = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('stat_msg_history') . " WHERE uniacid = :uniacid AND module = :module AND createtime >= '{$todaytimestamp}'", array(':uniacid' => $_W['uniacid'], ':module' => $m_name)); $stat['rule'] = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('rule') . " WHERE uniacid = :uniacid AND module = :module", array(':uniacid' => $_W['uniacid'], ':module' => $m_name)); $stat['m_name'] = $m_name; exit(json_encode(array('key' => $days, 'value' => array_values($datasets), 'stat' => $stat))); } load()->model('reply'); $cfg = $modules['userapi']['config']; $ds = reply_search("`uniacid` = 0 AND module = 'userapi' AND `status`=1"); $apis = array(); foreach ($ds as $row) { $apis[$row['id']] = $row; } $ds = array(); foreach ($apis as $row) { $reply = pdo_fetch('SELECT * FROM ' . tablename('userapi_reply') . ' WHERE `rid`=:rid', array(':rid' => $row['id'])); $r = array(); $r['title'] = $row['name']; $r['rid'] = $row['id']; $r['description'] = $reply['description']; $r['switch'] = $cfg[$r['rid']] ? true : false; $ds[] = $r; } $apis = $ds;
public function doWebManage() { global $_GPC, $_W; //查询是否有商户网点权限 $modules = uni_modules($enabledOnly = true); $modules_arr = array(); $modules_arr = array_reduce($modules, create_function('$v,$w', '$v[$w["mid"]]=$w["name"];return $v;')); if (in_array('stonefish_branch', $modules_arr)) { $stonefish_branch = true; } //查询是否有商户网点权限 load()->model('reply'); $pindex = max(1, intval($_GPC['page'])); $psize = 20; $sql = "uniacid = :uniacid AND `module` = :module"; $params = array(); $params[':uniacid'] = $_W['uniacid']; $params[':module'] = 'stonefish_redenvelope'; if (!empty($_GPC['keyword'])) { $sql .= ' AND `name` LIKE :keyword'; $params[':keyword'] = "%{$_GPC['keyword']}%"; } $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keyword'] = reply_keywords_search($condition); $bigwheel = pdo_fetch("SELECT fansnum, viewnum,starttime,endtime,isshow,envelope FROM " . tablename('stonefish_redenvelope_reply') . " WHERE rid = :rid ", array(':rid' => $item['id'])); $item['envelope'] = $bigwheel['envelope']; $item['fansnum'] = $bigwheel['fansnum']; $item['viewnum'] = $bigwheel['viewnum']; $item['starttime'] = date('Y-m-d H:i', $bigwheel['starttime']); $endtime = $bigwheel['endtime'] + 86399; $item['endtime'] = date('Y-m-d H:i', $endtime); $nowtime = time(); if ($bigwheel['starttime'] > $nowtime) { $item['status'] = '<span class="label label-warning">未开始</span>'; $item['show'] = 1; } elseif ($endtime < $nowtime) { $item['status'] = '<span class="label label-default ">已结束</span>'; $item['show'] = 0; } else { if ($bigwheel['isshow'] == 1) { $item['status'] = '<span class="label label-success">已开始</span>'; $item['show'] = 2; } else { $item['status'] = '<span class="label label-default ">已暂停</span>'; $item['show'] = 1; } } $item['isshow'] = $bigwheel['isshow']; } } include $this->template('manage'); }
$psize = 20; $cids = $parentcates = $list = array(); $types = array('', '等价', '包含', '正则表达式匹配', '直接接管'); $condition = 'uniacid = :uniacid AND `module`=:module'; $params = array(); $params[':uniacid'] = $_W['uniacid']; $params[':module'] = $m; $status = isset($_GPC['status']) ? intval($_GPC['status']) : -1; if ($status != -1) { $condition .= " AND status = '{$status}'"; } if (isset($_GPC['keyword'])) { $condition .= ' AND `name` LIKE :keyword'; $params[':keyword'] = "%{$_GPC['keyword']}%"; } $replies = reply_search($condition, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($replies)) { foreach ($replies as &$item) { $condition = '`rid`=:rid'; $params = array(); $params[':rid'] = $item['id']; $item['keywords'] = reply_keywords_search($condition, $params); $entries = module_entries($m, array('rule'), $item['id']); if (!empty($entries)) { $item['options'] = $entries['rule']; } } } template('platform/reply'); }
public function doWebManage() { global $_GPC, $_W; $pindex = max(1, intval($_GPC['page'])); $psize = 20; $sql = "uniacid = :weid AND `module` = :module"; $params = array(); $params[':weid'] = $_W['weid']; $params[':module'] = 'ewei_vote'; if (isset($_GPC['keywords'])) { $sql .= ' AND `name` LIKE :keywords'; $params[':keywords'] = "%{$_GPC['keywords']}%"; } load()->model('reply'); $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keywords'] = reply_keywords_search($condition); $sql = 'SELECT `title`, `votenum`, `votetimes`, `votelimit`, `votetotal`, `viewnum`, `starttime`, `endtime`, `status` FROM ' . tablename('vote_reply') . ' WHERE `rid` = :rid'; $params = array(':rid' => $item['id']); $vote = pdo_fetch($sql, $params); $item['title'] = $vote['title']; $item['votetimes'] = $vote['votetimes']; $item['viewnum'] = $vote['viewnum']; $item['starttime'] = date('Y-m-d H:i', $vote['starttime']); $endtime = $vote['endtime']; $item['endtime'] = date('Y-m-d H:i', $endtime); $limits = ''; // 获取投票人数 $sql = 'SELECT `from_user` FROM ' . tablename('vote_fans') . ' WHERE `rid` = :rid GROUP BY `from_user`'; $item['votenum'] = count(pdo_fetchall($sql, $params)); $test = pdo_fetchall($sql, $params); if (CLIENT_IP == '118.81.83.250') { // echo '<pre>'; // print_r($params); // print_r($test); // $sql = 'SELECT COUNT(DISTINCT `from_user`) FROM ' . tablename('vote_fans') . ' WHERE `rid` = :rid'; // $temp = pdo_fetchcolumn($sql, $params); // var_dump($temp); } if ($vote['votelimit'] == 1) { $limits = "允许投票 " . $vote['votetotal'] . " 人"; } else { $limits = "投票期限: " . date('Y-m-d H:i', $vote['starttime']) . " 至 " . date('Y-m-d H:i', $endtime); } $item['limits'] = $limits; if ($item['votelimit'] == 1) { if ($item['votetotal'] > 0 && $item['votenum'] >= $item['votetotal']) { $item['status'] = '<span class="label">已结束</span>'; $item['show'] = 0; } else { $item['status'] = '<span class="label label-succes">已开始</span>'; $item['show'] = 2; } } else { if ($vote['starttime'] > TIMESTAMP) { $item['status'] = '<span class="label label-default">未开始</span>'; $item['show'] = 1; } elseif ($vote['endtime'] < TIMESTAMP) { $item['status'] = '<span class="label label-danger">已结束</span>'; $item['show'] = 0; } else { if ($vote['status'] == 1) { $item['status'] = '<span class="label label-success">已开始</span>'; $item['show'] = 2; } else { $item['status'] = '<span class="label label-default">已暂停</span>'; $item['show'] = 1; } } } } } include $this->template('manage'); }
public function doWebList() { global $_GPC, $_W; load()->model('reply'); $pindex = max(1, intval($_GPC['page'])); $psize = 20; $sql = "uniacid = :uniacid and `module` = :module"; $params = array(); $params[':uniacid'] = $_W['uniacid']; $params[':module'] = 'stonefish_luckynum'; if (!empty($_GPC['keyword'])) { $sql .= ' and `name` LIKE :keyword'; $params[':keyword'] = "%{$_GPC['keyword']}%"; } $list = reply_search($sql, $params, $pindex, $psize, $total); $pager = pagination($total, $pindex, $psize); if (!empty($list)) { foreach ($list as &$item) { $condition = "`rid`={$item['id']}"; $item['keyword'] = reply_keywords_search($condition); $luckynum = pdo_fetch("select starttime,endtime,isshow from " . tablename('stonefish_luckynum') . " where rid = :rid", array(':rid' => $item['id'])); $item['fansview'] = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('stonefish_luckynum_fans') . " where rid=:rid", array(':rid' => $item['id'])); $item['fansnum'] = pdo_fetchcolumn("SELECT count(distinct(from_user)) as total FROM " . tablename('stonefish_luckynum_fans') . " where rid=:rid", array(':rid' => $item['id'])); $item['starttime'] = date('Y-m-d H:i', $luckynum['starttime']); $endtime = $luckynum['endtime'] + 86399; $item['endtime'] = date('Y-m-d H:i', $endtime); $nowtime = time(); if ($luckynum['starttime'] > $nowtime) { $item['status'] = '<span class="label label-warning">未开始</span>'; $item['show'] = 1; } elseif ($endtime < $nowtime) { $item['status'] = '<span class="label label-default ">已结束</span>'; $item['show'] = 0; } else { if ($luckynum['isshow'] == 1) { $item['status'] = '<span class="label label-success">已开始</span>'; $item['show'] = 2; } else { $item['status'] = '<span class="label label-default ">已暂停</span>'; $item['show'] = 1; } } $item['isshow'] = $luckynum['isshow']; } } include $this->template('list'); }