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 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; 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'); }
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'); }
public function analyzeText(&$message, $order = 0) { global $_W; $pars = array(); $order = intval($order); if (!isset($message['content'])) { return $pars; } $condition = <<<EOF `uniacid` IN ( 0, {$_W['uniacid']} ) AND ( \t( `type` = 1 AND `content` = :c1 ) \tor \t( `type` = 2 AND instr(:c2, `content`) ) \tor \t( `type` = 3 AND :c3 REGEXP `content` ) \tor \t( `type` = 4 ) ) AND `status`=1 EOF; $params = array(); $params[':c1'] = $message['content']; $params[':c2'] = $message['content']; $params[':c3'] = $message['content']; if (intval($order) > 0) { $condition .= " AND `displayorder` > :order"; $params[':order'] = $order; } $keywords = reply_keywords_search($condition, $params); if (empty($keywords)) { return $pars; } foreach ($keywords as $keyword) { $params = array('message' => $message, 'module' => $keyword['module'], 'rule' => $keyword['rid'], 'priority' => $keyword['displayorder'], 'keyword' => $keyword); $pars[] = $params; } return $pars; }
public function doWebScreen() { global $_W, $_GPC; $rid = intval($_GPC['rid']); $wid = intval($_GPC['wid']); $reply = pdo_fetch('select * from ' . tablename('xwz_queue_reply') . ' where uniacid=:uniacid and rid=:rid limit 1', array(':uniacid' => $wid, ':rid' => $rid)); load()->model('reply'); $keywords = reply_keywords_search('rid=' . $rid); $keyword = $keywords[0]['content']; include $this->template('screen'); }
$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'); } if ($do == 'post') { if ($_W['isajax'] && $_W['ispost']) { $sql = 'SELECT `rid` FROM ' . tablename('rule_keyword') . " WHERE `uniacid` = :uniacid AND `content` = :content"; $result = pdo_fetchall($sql, array(':uniacid' => $_W['uniacid'], ':content' => $_GPC['keyword'])); if (!empty($result)) { $keywords = array(); foreach ($result as $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'); }