/**
  * 更新保留字操作
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     $data['edit_time'] = time();
     $data['edit_user'] = $this->loginUser["id"];
     parent::update($data, $request);
 }
 /**
  * 文章列表
  * @param HttpRequest $request
  */
 public function index(HttpRequest $request)
 {
     $title = $request->getParameter('title', 'trim');
     $chanelId = $request->getParameter('chanel_id', 'intval');
     $order = $request->getParameter('order', 'trim');
     $time = $request->getParameter('time', 'trim');
     $conditions = array();
     //标题筛选
     if ($title != '') {
         $conditions['title'] = '%.' . $title . '%';
     }
     //频道筛选
     if ($chanelId > 0) {
         $conditions['chanel_id'] = $chanelId;
     }
     //时间筛选
     if ($time != '') {
         $this->getTimeCondition($time, $conditions);
     }
     $this->setFields('id,title,userid,chanel_id,add_time,hits,collect_times,zan_times,share_times,comment_times');
     $this->setConditions($conditions);
     //设置排序
     $this->setOrder($this->getOrderString($order));
     parent::index($request);
     $this->setView('article/article_statistics');
     $this->assign('params', $request->getParameters());
 }
 /**
  * 更新菜单分组操作
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     $tkeyBak = $request->getParameter('tkey_bak');
     //修改了tkey需要重新验证
     if ($tkeyBak != trim($data['tkey'])) {
         $this->checkField('tkey', $data['tkey']);
     }
     parent::update($data, $request);
 }
Ejemplo n.º 4
0
 /**
  * 更新管理员操作
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     $password = $request->getParameter('password', 'trim');
     if ($password != '') {
         $password = md5(md5($password));
         $data['password'] = $password;
     }
     parent::update($data, $request);
 }
 /**
  * 频道编辑
  * @param HttpRequest $request
  */
 public function edit(HttpRequest $request)
 {
     $fid = $request->getParameter("id", "trim");
     parent::edit($request);
     $chanelService = Beans::get("admin.chanel.service");
     $friendlink = $this->friendlink->getItem("id={$fid}", "chanel_id");
     $chanels = $chanelService->getItems("pid = 0", "id,name");
     $strIds = "";
     foreach ($chanels as $key => $val) {
         $strIds .= $val["id"] . ",";
     }
     $str = trim($strIds, ",");
     $subChanels = $chanelService->getItems("pid in ({$str})", "id,pid,name");
     $this->assign("subChanels", $subChanels);
     $this->assign("friendlink", $friendlink);
     $this->setView('admin/friendlink_edit');
 }
Ejemplo n.º 6
0
 /**
  * 首页方法
  * @param HttpRequest $request
  */
 public function index(HttpRequest $request)
 {
     parent::index($request);
     $items = $this->getTemplateVar('items');
     //初始化用户名
     $userIds = array();
     foreach ($items as $value) {
         $userIds[] = $value['userid'];
     }
     if (!empty($userIds)) {
         $userService = Beans::get('user.user.service');
         $users = $userService->getItems($userIds, 'id, username, nickname');
         $users = ArrayUtils::changeArrayKey($users, 'id');
     }
     foreach ($items as $key => $value) {
         $items[$key]['username'] = $users[$value['userid']]['username'];
         $items[$key]['nickname'] = $users[$value['userid']]['nickname'];
     }
     $this->assign('items', $items);
     $this->setView('article/tipoff_index');
 }
Ejemplo n.º 7
0
 /**
  * 更新角色操作
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     parent::update($data, $request);
 }
 /**
  * 更新文章
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     $data['update_time'] = time();
     //是否定时发布
     $publish = $request->getParameter('publish');
     if ($publish == 0) {
         $data['publish_time'] = strtotime($request->getParameter('publish_time', 'trim'));
         //更改审核状态
         $data['ischeck'] = 0;
     } else {
         $data['publish_time'] = 0;
         $data['ischeck'] = 1;
     }
     //如果有标签则先插入标签
     $tag_bak = $request->getParameter('tag_bak', 'trim');
     if (trim($data['tags']) != $tag_bak) {
         $tagService = Beans::get('article.tags.service');
         $tags = explode(',', $data['tags']);
         $tagIds = array();
         foreach ($tags as $value) {
             $id = $tagService->add(array('name' => $value));
             if ($id > 0) {
                 $tagIds[] = $id;
             }
         }
         $data['tags'] = implode(',', $tagIds);
         //不更改标签
     } else {
         unset($data['tags']);
     }
     parent::update($data, $request);
 }
Ejemplo n.º 9
0
 /**
  * 初始化方法
  */
 public function C_start()
 {
     parent::C_start();
     $this->setServiceBean('admin.menu.service');
 }
Ejemplo n.º 10
0
 /**
  * 选择文章
  * @param HttpRequest $request
  */
 public function select(HttpRequest $request)
 {
     $mids = $request->getParameter('mids', 'trim');
     $name = $request->getParameter('name', 'urldecode|trim');
     $conditions = array('ischeck' => 1);
     if ($name != '') {
         $conditions['name'] = '%' . $name . '%';
     }
     $this->setPagesize(12);
     $this->setConditions($conditions);
     parent::index($request);
     $this->setView('media/media_select');
     $mids = explode(',', $mids);
     $this->assign('mids', $mids);
     $this->assign('params', $request->getParameters());
 }
 /**
  * 更新显示位操作
  * @param HttpRequest $request
  */
 public function update(HttpRequest $request)
 {
     $data = $request->getParameter('data');
     $posBak = $request->getParameter('pos_bak', 'trim');
     //更改了position重新认证
     if ($posBak != $data['position']) {
         $this->checkField('position', $data['position']);
     }
     parent::update($data, $request);
 }
 /**
  * 模板编辑
  * @param HttpRequest $request
  */
 public function edit(HttpRequest $request)
 {
     parent::edit($request);
     $this->setView('system/template_edit');
 }