public function actionList() { $criteria = new CDbCriteria(); $data = AdminUpload::fetchList($criteria, true, true); $this->adminTitle = t('upload_file_list', 'admin'); $this->render('list', $data); }
public function search() { $criteria = new CDbCriteria(); if ($this->postid) { $criteria->addColumnCondition(array('post_id' => $this->postid)); } if ($this->userid) { $criteria->addColumnCondition(array('user_id' => $this->userid)); } if ($this->fileType) { $criteria->addColumnCondition(array('file_type' => $this->fileType)); } if ($this->keyword) { $criteria->addSearchCondition('desc', $this->keyword); } if ($this->fileUrl) { $criteria->addSearchCondition('url', $this->fileUrl); } $data = $criteria->condition ? AdminUpload::fetchList($criteria) : null; return $data; }