public function getInfo($scksid) { $cond['a.id'] = $scksid; $tbWstWznr = \Web\Model\WstWznrModel::WST_WZNR; $data = $this->table(self::WST_SCKS . ' a')->join('LEFT JOIN ' . $tbWstWznr . ' b ON a.wznrid=b.id')->field('a.*,b.jgzn,b.title,b.address,b.ypcode,b.optel,b.email')->where($cond)->find(); return string_gb2312_to_utf8($data); }
/** * 获取某个处室的栏目 */ public function getChushiSort($scksid) { $cond['scksid'] = $scksid; $cond['parentid'] = array('neq', 0); $result = $this->where($cond)->select(); return string_gb2312_to_utf8($result); }
public function getOneData($id) { $cond['id'] = $id; $data = $this->where($cond)->find(); $data = string_gb2312_to_utf8($data); return $data; }
public function getContent($page, $pagesize) { $data = $this->where(array('scxm' => array('egt', 1)))->order('pyfy ASC')->limit($page, $pagesize)->select(); $data = string_gb2312_to_utf8($data); foreach ($data as $k => $v) { } return $data; }
public function getContent($page, $pagesize, $sortid) { $data = $this->field('articleid,title,addtime')->where(array('sortid' => $sortid))->order('articleid DESC')->limit($page, $pagesize)->select(); $data = string_gb2312_to_utf8($data); foreach ($data as $k => $v) { $data[$k]['addtime'] = date('Y-m-d', strtotime($v['addtime'])); $data[$k]['addtime1'] = date('m.d', strtotime($v['addtime'])); } return $data; }
/** * 公开目录 ---树状 */ public function getTrees() { $cond['pid'] = 'a'; $cond['isow'] = 1; $data = $this->field('id,nid,name,pid')->where($cond)->order('xlis ASC')->select(); $result = string_gb2312_to_utf8($data); foreach ($result as $k => $v) { $child = $this->field('id,nid,name')->where(array('pid' => $v['nid']))->select(); $utf8 = string_gb2312_to_utf8($child); $result[$k]['child'] = $utf8; } return $result; }
public function getContent($ldid = null) { $cond['sowzt'] = 1; $data = $this->where($cond)->order('pyfy ASC')->select(); $data = string_gb2312_to_utf8($data); if ($ldid) { $ldid = explode(',', $ldid); foreach ($data as $k => $v) { if (in_array($v['id'], $ldid)) { $data[$k]['check'] = 1; } } } return $data; }
/** * 机构资料管理 */ public function dataList($page, $pagesize, $postData) { if ($postData['scxm']) { $cond['a.scxm'] = array('like', '%' . string_utf8_to_gb2312($postData['scxm']) . '%'); } $cond['a.dellzt'] = 0; //$cond['xmlb'] = 1; //$cond['isshtml'] = 1; $count = $this->table(self::WST_WZNR . ' a')->where($cond)->count(); $result = $this->table(self::WST_WZNR . ' a')->where($cond)->field('a.*')->order('a.id ASC')->limit($page, $pagesize)->select(); $result = string_gb2312_to_utf8($result); $array['count'] = $count ? $count : 0; $array['data'] = $result; return $array; }
/** * 链接管理 */ public function dataList($page, $pagesize, $postData) { if ($postData['linkname']) { $cond['a.linkname'] = array('like', '%' . string_utf8_to_gb2312($postData['linkname']) . '%'); } //$cond['scksid'] = 1; $count = $this->table(self::WST_LINK . ' a')->where($cond)->count(); $result = $this->table(self::WST_LINK . ' a')->where($cond)->field('a.*')->order('a.uptime DESC')->limit($page, $pagesize)->select(); $result = string_gb2312_to_utf8($result); foreach ($result as $k => $v) { $result[$k]['class'] = self::$classify[$v['scfl']]; } $array['count'] = $count ? $count : 0; $array['data'] = $result; return $array; }
/** * 栏目申请表 */ public function dataList($page, $pagesize, $postData) { if ($postData['sqtime']) { $cond['a.sqtime'] = array('like', '%' . $postData['sqtime'] . '%'); } if ($postData['name']) { $cond['a.name'] = array('like', '%' . string_utf8_to_gb2312($postData['name']) . '%'); } if ($postData['code']) { $cond['a.code'] = array('like', '%' . $postData['code'] . '%'); } $count = $this->table(self::WST_GKMLSQB . ' a')->where($cond)->count(); $result = $this->table(self::WST_GKMLSQB . ' a')->where($cond)->field('a.*')->order('a.id DESC')->limit($page, $pagesize)->select(); $result = string_gb2312_to_utf8($result); $array['count'] = $count ? $count : 0; $array['data'] = $result; return $array; }
public function getContent($page, $pagesize) { $info = S('wst_spgg'); if ($info) { return $info; } else { $data = $this->order('gsid desc')->limit($page, $pagesize)->select(); $data = string_gb2312_to_utf8($data); foreach ($data as $k => $v) { $data[$k]['dwdm'] = mb_substr($v['dwdm'], 0, 4, 'utf-8') . '...'; $data[$k]['dwmc'] = mb_substr($v['dwmc'], 0, 5, 'utf-8') . '...'; $data[$k]['dwdz'] = mb_substr($v['dwdz'], 0, 4, 'utf-8') . '...'; $data[$k]['znflmc'] = mb_substr($v['znflmc'], 0, 4, 'utf-8') . '...'; } S('wst_spgg', $data, 3600); return $data; } }
/** * 栏目管理 */ public function dataList($page, $pagesize, $postData) { if ($postData['senddate']) { $cond['a.senddate'] = array('like', '%' . $postData['senddate'] . '%'); } if ($postData['sqh']) { $cond['a.sqh'] = array('like', '%' . $postData['sqh'] . '%'); } if ($postData['artitle']) { $cond['a.artitle'] = array('like', '%' . string_utf8_to_gb2312($postData['artitle']) . '%'); } $count = $this->table(self::WST_GKMLXX . ' a')->where($cond)->count(); $result = $this->table(self::WST_GKMLXX . ' a')->where($cond)->field('a.*')->order('a.id DESC')->limit($page, $pagesize)->select(); $result = string_gb2312_to_utf8($result); $gkml = D('WstGkml')->getShortGkml(); foreach ($result as $k => $v) { $result[$k]['mlid1'] = $gkml[$v['mlid1']]; $result[$k]['mlid2'] = $gkml[$v['mlid2']]; $result[$k]['mlid3'] = $gkml[$v['mlid3']]; } $array['count'] = $count ? $count : 0; $array['data'] = $result; return $array; }
public function getSortname($sortid) { $name = D('WstSort')->where(array('sortid' => $sortid))->getField('sortname'); return string_gb2312_to_utf8($name); }
/** * 获取一条数据 * @param unknown $id */ public function getObject($id) { $data = $this->where(array('id' => $id))->find(); return string_gb2312_to_utf8($data); }
/** * 编辑 */ public function editAct() { $id = intval(I("id")); if (IS_POST) { $sort = D('WstSort')->where(array('sortid' => $_POST['sortid']))->find(); $_POST['ldid'] = $_POST['leader'] ? implode(',', $_POST['leader']) : 0; $_POST['pid'] = $sort['parentid']; $_POST['tid'] = $sort['treedid']; $data = D("WstContent")->create(); if ($data) { $data = string_utf8_to_gb2312($data); if (D("WstContent")->save($data) !== false) { $this->success("修改成功!"); } else { $this->error("修改失败!"); } } else { $this->error('"修改失败!"'); } } else { if (!$id) { $this->error("非法操作!"); } $data = D("WstContent")->getObject($id); if (!$data) { $this->error("该角色不存在!"); } //树状栏目 $result = D("WstSort")->field('sortid as id,sortname as name,parentid')->order(array("sortid" => "ASC"))->select(); $result = string_gb2312_to_utf8($result); $tree = new p\Tree(); foreach ($result as $r) { $r['selected'] = $r['id'] == $data['sortid'] ? 'selected' : ''; $array[] = $r; } $str = "<option value='\$id' \$selected>\$spacer \$name</option>"; $tree->init($array); $select_categorys = $tree->get_tree(0, $str); $this->assign("select_categorys", $select_categorys); //上传图片 $img_upload = unifile_upload(array('name' => 'picture', 'content' => $data['picture'], 'table' => 'WstContent', 'p_key' => 'articleid', 'field_name' => 'picture')); $this->assign('img_upload', $img_upload); //编辑器 $keditor = keditor(array('name' => 'content', 'content' => $data['content'])); $this->assign('keditor', $keditor); //领导 $leader = D('WstLd')->getContent($data['ldid']); $this->assign('leader', $leader); //领导子站 $leaderSort = D('WstLdSort')->getContent(); $this->assign('leaderSort', $leaderSort); //获取处室 $chushi = D('WstScks')->getNewChushi(); $this->assign('chushi', $chushi); //处室栏目 $cslanmu = D('WstSort')->getChushiSort($data['scks']); $this->assign('cslanmu', $cslanmu); $this->assign('actionName', ACTION_NAME); $this->assign("info", $data); $this->display("Article:add"); } }
/** * 获取关联公开目录--一维数组 */ public function getShortGkml() { $result = $this->getField('nid,name', true); return string_gb2312_to_utf8($result); }
public function getContent() { $data = $this->order('id ASC')->select(); $data = string_gb2312_to_utf8($data); return $data; }
/** * 处室下的内容 * @param int $page * @param int $pagesize * @param int $scksid * @param int $iscopy * @return string */ public function getScksContent($page, $pagesize, $scksid, $iscopy = null) { $cond['scks'] = $scksid; if ($iscopy) { $cond['sortid'] = $iscopy; } // $cond['iscopy'] = $iscopy; $count = $this->where($cond)->count(); $data = $this->field('articleid,title,addtime,picture,sortid,content')->where($cond)->order('articleid DESC')->limit($page, $pagesize)->select(); $data = string_gb2312_to_utf8($data); foreach ($data as $k => $v) { $data[$k]['addtime'] = date('Y-m-d', strtotime($v['addtime'])); $data[$k]['addtime1'] = date('m.d', strtotime($v['addtime'])); $data[$k]['subcontent'] = utf8_strcut(strip_tags($data[$k]['content']), 0, 50) . '...'; $data[$k]['title1'] = mb_substr($v['title'], 0, 16, 'utf-8') . '...'; $data[$k]['title'] = mb_substr($v['title'], 0, 18, 'utf-8') . '...'; } $info['data'] = $data; $info['count'] = $count; return $info; }
/** * 获取一条数据 * @param unknown $articleid */ public function getObject($articleid) { $tbWstSort = \Web\Model\WstSortModel::WST_SORT; $data = $this->table(self::WST_CONTENT . ' a')->join('LEFT JOIN ' . $tbWstSort . ' b ON a.sortid=b.sortid')->field('a.*,b.sortname')->where(array('a.articleid' => $articleid))->find(); return string_gb2312_to_utf8($data); }
public function editSortAct() { $sortid = intval(I("sortid")); if (IS_POST) { //有效时间 if ($_POST['endday']) { $time = explode('-', $_POST['endday']); $_POST['b_time'] = strtotime($time[0] . ' 00:00:00'); $_POST['e_time'] = strtotime($time[1] . ' 23:59:59'); } $data = D("Card")->create(); if ($data) { if (D("Card")->save($data) !== false) { $this->success("修改成功!"); } else { $this->error("修改失败!"); } } else { $this->error('修改失败'); } } else { $info = D('Category')->where(array('sortid' => $sortid))->find(); $info = string_gb2312_to_utf8($info); $this->assign('info', $info); $sortTree = D('Category')->sortTree(); $this->assign('sortTree', $sortTree); $result = D("Category")->field('sortid,parentid,sortname')->order(array("sortdir" => "ASC"))->select(); $result = string_gb2312_to_utf8($result); $tree = new p\Tree(); $parentid = intval(I("get.parentid")); foreach ($result as $r) { $r['selected'] = $r['id'] == $parentid ? 'selected' : ''; $array[] = $r; } $str = "<option value='\$sortid' \$selected>\$spacer \$sortname</option>"; $tree->init($array); $select_categorys = $tree->get_tree(0, $str); $this->assign("select_categorys", $select_categorys); $this->assign('jumpurl', UC("Category/editSort")); } $this->display(); }
/** * 处室政务新闻 */ public function cszwxw() { $this->_set_page(); $scks = I('id'); $iscopy = I('iscopy'); if (!$scks || !$iscopy) { exit('参数错误'); } $newInfo = D('WstContent')->getScksContent(0, 25, $scks, $iscopy); $list = $newInfo['data']; $count = $newInfo['count']; //点击率 $hitlist = D('WstContent')->getContentRecursionOrderByHit(0, 10, 1); $this->assign('hitlist', $hitlist); //最新消息 $latest = D('WstContent')->getContent(0, 10); $this->assign('latest', $latest); $page = new \Think\Page($count, 25); $show = $page->show(); $this->assign('page', $show); $this->assign('list', $list); $name = D('WstSort')->where(array('sortid' => $iscopy))->getField('sortname'); $name = string_gb2312_to_utf8($name); $info['sortname'] = $name; $this->assign('info', $info); $this->assign('bmfw', 1); $this->display('Zwgk:zwxw'); }
public function getNewChushi() { $cond['ifshow'] = 1; $data = $this->where($cond)->select(); return string_gb2312_to_utf8($data); }