/**
  * 编辑
  */
 public function editAct()
 {
     $id = intval(I("id"));
     if (IS_POST) {
         $check = D('WstSort')->where(array('sortdir' => $_POST['sortdir'], 'sortid' => array('neq', $id)))->select();
         if ($check) {
             $this->error('目录已经被其他分类使用');
         }
         $tid = D('WstSort')->where(array('sortid' => $_POST['parentid']))->getField('parentid');
         $tid = $tid ? $tid : 0;
         $_POST['treedid'] = $tid;
         $data = string_utf8_to_gb2312($_POST);
         if ($data) {
             $result = D("WstSort")->where(array('sortid' => $id))->save($data);
             if ($result) {
                 $this->success("修改成功!");
             } else {
                 $this->error("修改失败!");
             }
         } else {
             $this->error('修改失败');
         }
     } else {
         $info = D('WstSort')->getOneData($id);
         $this->assign('info', $info);
         $fenlei = D('WstSort')->getsort();
         $this->assign('fenlei', $fenlei);
         $chushi = D('WstScks')->getChushi();
         $this->assign('chushi', $chushi);
         $gkml = D('WstGkml')->getGkml();
         $this->assign('gkml', $gkml);
         $this->assign('actionName', ACTION_NAME);
     }
     $this->display('Category:add');
 }
Пример #2
0
 /**
  * 机构资料管理
  */
 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;
 }
Пример #3
0
 /**
  * 链接管理
  */
 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;
 }
Пример #4
0
 public function chushiList($page, $pagesize, $postData)
 {
     $tbWstWznr = \Hgtlin\Model\WstWznrModel::WST_WZNR;
     if ($postData['real_name']) {
         $cond['a.name'] = array('like', '%' . string_utf8_to_gb2312($postData['real_name']) . '%');
     }
     $count = $this->table(self::WST_SCKS . ' a')->join('left join ' . $tbWstWznr . ' b ON a.wznrid=b.id')->where($cond)->count();
     $result = $this->table(self::WST_SCKS . ' a')->join('left join ' . $tbWstWznr . ' b ON a.wznrid=b.id')->where($cond)->field('a.*,b.scxm')->order('a.id DESC')->limit($page, $pagesize)->select();
     $result = string_gb2312_to_utf8($result);
     foreach ($result as $k => $v) {
         //$result[$k]['rightsName'] = self::$rights[$v['rights']];
     }
     $array['count'] = $count ? $count : 0;
     $array['data'] = $result;
     return $array;
 }
Пример #5
0
 /**
  * 栏目申请表
  */
 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;
 }
Пример #6
0
 public function ArticleList($page, $pagesize, $postData)
 {
     if ($postData['card_type']) {
         if ($postData['card_type'] == 1) {
             $cond['visible'] = 1;
         } elseif ($postData['card_type'] == 2) {
             $cond['tuiji'] = 1;
         } else {
         }
     }
     if ($postData['sortid']) {
         $cond['sortid'] = $postData['sortid'];
     }
     if ($postData['title']) {
         $cond['title'] = array('like', '%' . string_utf8_to_gb2312($postData['title']) . '%');
     }
     $tbWstSort = \Hgtlin\Model\WstSortModel::WST_SORT;
     $tbWstScks = \Hgtlin\Model\WstScksModel::WST_SCKS;
     $count = $this->where($cond)->count();
     $result = $this->table(self::WST_CONTENT . ' a')->join('left join ' . $tbWstSort . ' b ON a.sortid=b.sortid')->join('left join ' . $tbWstScks . ' c ON a.scks=c.id')->where($cond)->field('a.*,b.sortname,c.name as scks_name')->order('articleid DESC')->limit($page, $pagesize)->select();
     $array['count'] = $count ? $count : 0;
     $array['data'] = string_gb2312_to_utf8($result);
     return $array;
 }
Пример #7
0
 /**
  * 栏目管理
  */
 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;
 }
Пример #8
0
 public function searchResult($page, $pagesize, $keyword)
 {
     $cond['title'] = array('like', '%' . string_utf8_to_gb2312($keyword) . '%');
     $count = $this->where($cond)->count(1);
     $data = $this->where($cond)->limit($page, $pagesize)->order('articleid DESC')->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, 500);
     }
     $info['data'] = $data;
     $info['count'] = $count;
     return $info;
 }
Пример #9
0
 public function check($postArray)
 {
     $cond['username'] = string_utf8_to_gb2312($postArray['username']);
     return $this->where($cond)->find();
 }
Пример #10
0
 /**
  * 编辑
  */
 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");
     }
 }
Пример #11
0
 /**
  * 添加链接
  */
 public function addLinkAct()
 {
     if (IS_POST) {
         $_POST['uptime'] = date('Y-m-d H:i:s', time());
         $_POST['scksid'] = $this->_account['scks'];
         $data = string_utf8_to_gb2312($_POST);
         if ($data) {
             $id = D("WstLink")->add($data);
             if ($id) {
                 $this->success("成功");
             } else {
                 $this->error("失败!");
             }
         } else {
             $this->error('失败');
         }
     }
     $this->assign('actionName', ACTION_NAME);
     $this->display();
 }
Пример #12
0
 /**
  * 编辑用户
  */
 public function editChushiAct()
 {
     $id = intval(I("id"));
     if (IS_POST) {
         $data = string_utf8_to_gb2312($_POST);
         if ($data) {
             $result = D("WstScks")->where(array('id' => $id))->save($data);
             if ($result) {
                 $this->success("修改成功!");
             } else {
                 $this->error("修改失败!");
             }
         } else {
             $this->error('修改失败');
         }
     } else {
         $info = D('WstScks')->getOneData($id);
         $this->assign('info', $info);
         $childChushi = D('WstWznr')->getRelation();
         $this->assign('childChushi', $childChushi);
         $this->assign('actionName', ACTION_NAME);
     }
     $this->display('User:addChushi');
 }