• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP XUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中XUtils的典型用法代码示例。如果您正苦于以下问题:PHP XUtils类的具体用法?PHP XUtils怎么用?PHP XUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了XUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: actionLogin

 /**
  * 会员登录
  */
 public function actionLogin()
 {
     $model = new Admin('login');
     if (XUtils::method() == 'POST') {
         $model->attributes = $_POST['Admin'];
         if ($model->validate()) {
             $data = $model->find('username=:username', array('username' => $model->username));
             if ($data === null) {
                 $model->addError('username', '用户不存在');
                 AdminLogger::_create(array('catalog' => 'login', 'intro' => '登录失败,用户不存在:' . CHtml::encode($model->username), 'user_id' => 0));
             } elseif (!$model->validatePassword($data->password)) {
                 $model->addError('password', '密码不正确');
                 AdminLogger::_create(array('catalog' => 'login', 'intro' => '登录失败,密码不正确:' . CHtml::encode($model->username) . ',使用密码:' . CHtml::encode($model->password), 'user_id' => 0));
             } elseif ($data->group_id == 2) {
                 $model->addError('username', '用户被锁定,请联系网站管理');
             } else {
                 parent::_stateWrite(array('userId' => $data->id, 'userName' => $data->username, 'groupId' => $data->group_id, 'super' => $data->group_id == 1 ? 1 : 0), array('prefix' => '_admini'));
                 $data->last_login_ip = XUtils::getClientIP();
                 $data->last_login_time = time();
                 $data->login_count = $data->login_count + 1;
                 $data->save();
                 AdminLogger::_create(array('catalog' => 'login', 'intro' => '用户登录成功:' . CHtml::encode($model->username)));
                 $this->redirect(array('default/index'));
             }
         }
     }
     $this->render('login', array('model' => $model));
 }
开发者ID:zywh,项目名称:maplecity,代码行数:31,代码来源:PublicController.php


示例2: actionBasicExecute

 /**
  * 上传
  */
 public function actionBasicExecute()
 {
     if (XUtils::method() == 'POST') {
         $adminiUserId = self::_sessionGet('adminiUserId');
         $file = XUpload::upload($_FILES['imgFile']);
         if (is_array($file)) {
             $model = new Upload();
             $model->user_id = intval($accountUserId);
             $model->file_name = $file['pathname'];
             $model->thumb_name = $file['paththumbname'];
             $model->real_name = $file['name'];
             $model->file_ext = $file['extension'];
             $model->file_mime = $file['type'];
             $model->file_size = $file['size'];
             $model->save_path = $file['savepath'];
             $model->hash = $file['hash'];
             $model->save_name = $file['savename'];
             $model->create_time = time();
             if ($model->save()) {
                 exit(CJSON::encode(array('state' => 'success', 'fileId' => $model->id, 'realFile' => $model->real_name, 'message' => '上传成功', 'file' => $file['pathname'])));
             } else {
                 @unlink($file['pathname']);
                 exit(CJSON::encode(array('state' => 'error', 'message' => '数据写入失败,上传错误')));
             }
         } else {
             exit(CJSON::encode(array('error' => 1, 'message' => '上传错误')));
         }
     }
 }
开发者ID:zywh,项目名称:maplecity,代码行数:32,代码来源:UploadifyController.php


示例3: _catalogList

 /**
  * 获取栏目内容数据
  *
  * @param array   $params
  * @return array  数组
  */
 protected function _catalogList($params = array())
 {
     $postModel = new Post();
     $postCriteria = new CDbCriteria();
     $condition = '1';
     if ($params['catalog']) {
         $condition .= ' AND t.catalog_id=:catalogId';
         $criteriaParams[':catalogId'] = intval($params['catalog']);
     }
     if ($params['keyword']) {
         $condition .= ' AND t.title=:title';
         $criteriaParams[':title'] = CHtml::encode(strip_tags($params['keyword']));
     }
     $condition .= " AND t.status_is='Y'";
     $postCriteria->condition = $condition;
     $postCriteria->params = $criteriaParams;
     $postCriteria->order = 't.id DESC';
     $postCriteria->with = 'catalog';
     $count = $postModel->count($postCriteria);
     $postPages = new CPagination($count);
     $postPages->pageSize = $params['pageSize'] > 0 ? $params['pageSize'] : 20;
     $pageParams = XUtils::buildCondition($_GET, array('catalog', 'keyword'));
     $postPages->params = is_array($pageParams) ? $pageParams : array();
     $postCriteria->limit = $postPages->pageSize;
     $postCriteria->offset = $postPages->currentPage * $postPages->pageSize;
     $bagecmsDataList = $postModel->findAll($postCriteria);
     $catalogArr = Catalog::item($params['catalog'], $this->_catalog);
     if ($catalogArr) {
         $this->_seoTitle = empty($catalogArr['catalog_name']) ? $this->_seoTitle : $catalogArr['catalog_name'];
         $bagecmsCatalogData = $catalogArr;
         $this->_seoKeywords = empty($catalogArr['seo_keywords']) ? $this->_seoKeywords : $catalogArr['seo_keywords'];
         $this->_seoDescription = empty($catalogArr['seo_description']) ? $this->_seoDescription : $catalogArr['seo_description'];
     }
     return array('bagecmsDataList' => $bagecmsDataList, 'bagecmsPagebar' => $postPages, 'bagecmsCatalogData' => $bagecmsCatalogData);
 }
开发者ID:bigbol,项目名称:ziiwo,代码行数:41,代码来源:PostController.php


示例4: actionLogin

 /**
  * 会员登录
  */
 public function actionLogin()
 {
     try {
         $model = new EnergyAdmin('login');
         if (XUtils::method() == 'POST') {
             $model->id = $_POST['id'];
             $model->password = $_POST['password'];
             $data = $model->find('id=:id', array('id' => $model->id));
             if ($data === null) {
                 $model->addError('id', '用户不存在');
                 AdminLogger::_create(array('catalog' => 'login', 'intro' => '登录失败,用户不存在:' . CHtml::encode($model->id), 'user_id' => 0));
             } elseif (!$model->validatePassword($data->password)) {
                 $model->addError('password', '密码不正确');
                 AdminLogger::_create(array('catalog' => 'login', 'intro' => '登录失败,密码不正确:' . CHtml::encode($model->id) . ',使用密码:' . CHtml::encode($model->password), 'user_id' => 0));
             } else {
                 parent::_stateWrite(array('userId' => $data->id, 'userName' => $data->name), array('prefix' => '_admini'));
                 // $data->save();
                 AdminLogger::_create(array('catalog' => 'login', 'intro' => '用户登录成功:' . CHtml::encode($model->id)));
                 $this->redirect(array('energy/index'));
             }
         }
         $this->render('login', array('model' => $model));
     } catch (Exception $e) {
         echo var_dump($e);
     }
 }
开发者ID:jiahongwei,项目名称:newland-project,代码行数:29,代码来源:publicController.php


示例5: actionBatch

 /**
  * 批量操作
  *
  */
 public function actionBatch()
 {
     if (XUtils::method() == 'GET') {
         $command = trim($_GET['command']);
         $ids = intval($_GET['id']);
     } elseif (XUtils::method() == 'POST') {
         $command = trim($_POST['command']);
         $ids = $_POST['id'];
         is_array($ids) && ($ids = implode(',', $ids));
     } else {
         XUtils::message('errorBack', '只支持POST,GET数据');
     }
     empty($ids) && XUtils::message('error', '未选择记录');
     switch ($command) {
         case 'delete':
             parent::_acl('position_delete');
             $cityModel = new Position();
             $cityModel->deleteAll('id IN(' . $ids . ')');
             AdminLogger::_create(array('catalog' => 'delete', 'intro' => '删除内容,ID:' . $ids));
             parent::_delete(new Position(), $ids, array('index'));
             break;
         default:
             throw new CHttpException(404, '错误的操作类型:' . $command);
             break;
     }
 }
开发者ID:zywh,项目名称:maplecity,代码行数:30,代码来源:PositionController.php


示例6: actionLogin

 public function actionLogin()
 {
     $model = new Admin('login');
     if (XUtils::method() == 'POST') {
         $model->attributes = $_POST['Admin'];
         if ($model->validate()) {
             $data = $model->find('username=:username', array('username' => $model->username));
             if ($data === null) {
                 $model->addError('username', '用户不存在');
                 parent::_backendLogger(array('catalog' => 'login', 'intro' => '登录失败,用户不存在:' . CHtml::encode($model->username), 'user_id' => 0));
             } elseif (!$model->validatePassword($data->password)) {
                 $model->addError('password', '密码不正确');
                 parent::_backendLogger(array('catalog' => 'login', 'intro' => '登录失败,密码不正确:' . CHtml::encode($model->username) . ',使用密码:' . CHtml::encode($model->password), 'user_id' => 0));
             } elseif ($data->group_id == 2) {
                 $model->addError('username', '用户已经锁定,请联系管理');
             } else {
                 $this->_sessionSet('_backendGroupId', $data->group_id);
                 if (isset($data->group_id) && $data->group_id == 1) {
                     $this->_sessionSet('_backendPermission', 'backendstrator');
                 }
                 $data->last_login_ip = XUtils::getClientIP();
                 $data->last_login_time = time();
                 $data->login_count = $data->login_count + 1;
                 $data->save();
                 parent::_sessionSet('uid', $data->id);
                 parent::_sessionSet('uname', $data->username);
                 parent::_backendLogger(array('catalog' => 'login', 'intro' => '用户登录成功:' . $data->username));
                 $this->redirect(array('default/index'));
                 XUtils::message('success', '登录成功', $this->createUrl('default/index'), 2);
             }
         }
     }
     $this->render('login', array('model' => $model));
 }
开发者ID:lp19851119,项目名称:114la,代码行数:34,代码来源:PublicController.php


示例7: actionBatch

 /**
  * 批量操作
  */
 public function actionBatch()
 {
     if (XUtils::method() == 'GET') {
         $command = trim($this->_gets->getParam('command'));
         $ids = intval($this->_gets->getParam('id'));
     } elseif (XUtils::method() == 'POST') {
         $command = $this->_gets->getPost('command');
         $ids = $this->_gets->getPost('id');
         is_array($ids) && ($ids = implode(',', $ids));
     } else {
         throw new CHttpException(404, '只支持POST,GET数据');
     }
     empty($ids) && XUtils::message('error', '未选择记录');
     switch ($command) {
         case 'attachDelete':
             parent::_acl('attach_delete');
             AdminLogger::_create(array('catalog' => 'delete', 'intro' => '删除附件,ID:' . $ids));
             //日志
             parent::_delete(new Upload(), $ids, array('attach'), array('file_name'));
             break;
         default:
             throw new CHttpException(404, '错误的操作类型:' . $command);
             break;
     }
 }
开发者ID:bigbol,项目名称:ziiwo,代码行数:28,代码来源:OtherController.php


示例8: actionUpload

 /**
  * 编辑器文件上传
  */
 public function actionUpload()
 {
     if (XUtils::method() == 'POST') {
         $file = XUpload::upload($_FILES['imgFile']);
         if (is_array($file)) {
             $model = new Upload();
             $model->user_id = intval($admini['userId']);
             $model->file_name = CHtml::encode($file['pathname']);
             $model->thumb_name = CHtml::encode($file['paththumbname']);
             $model->real_name = CHtml::encode($file['name']);
             $model->file_ext = $file['extension'];
             $model->file_mime = $file['type'];
             $model->file_size = $file['size'];
             $model->save_path = $file['savepath'];
             $model->hash = $file['hash'];
             $model->save_name = $file['savename'];
             $model->create_time = time();
             if ($model->save()) {
                 exit(CJSON::encode(array('error' => 0, 'url' => Yii::app()->baseUrl . '/' . $file['pathname'])));
             } else {
                 @unlink($file['pathname']);
                 @unlink($file['paththumbname']);
                 exit(CJSON::encode(array('error' => 1, 'message' => '上传错误')));
             }
         } else {
             exit(CJSON::encode(array('error' => 1, 'message' => '上传错误:' . $file)));
         }
     }
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:32,代码来源:XUserBase.php


示例9: actionView

 public function actionView($id)
 {
     $lesson = $this->loadModel($id);
     $userId = $this->_cookiesGet('userId');
     $userType = $this->_cookiesGet('userType');
     $this->_seoTitle = '课程 - ' . $lesson->name;
     //取报名人数
     $actual_students_criteria = new CDbCriteria();
     $actual_students = StudentLesson::model()->count($actual_students_criteria->addCondition("lesson_id =" . $id));
     $lesson->actual_students = $actual_students;
     $teacher = Teacher::model()->findByPk($lesson->teacher_id);
     $place = Place::model()->findByPk($lesson->place_id);
     //教学环境图片显示
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     //判断学员已收藏的课程
     if ($userType === 'student') {
         $is_focus = StudentLesson::model()->findByAttributes(array('student_id' => $userId, 'lesson_id' => $id, 'is_collection' => 1));
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($place->pic_other) {
         $imageList = unserialize($place->pic_other);
     }
     $this->render('view', array('is_focus' => $is_focus, 'isJoin' => $this->isJoin($userId, $id, 1), 'userType' => $userType, 'lesson' => $lesson, 'place' => $place, 'teacher' => $teacher, 'imageList' => $imageList));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:26,代码来源:LessonController.php


示例10: actionUpdatePlace

 public function actionUpdatePlace()
 {
     $model = Place::model()->findByPk($_GET['id']);
     $imageList = $this->_gets->getParam('imageList');
     $imageListSerialize = XUtils::imageListSerialize($imageList);
     if (isset($_POST['Place'])) {
         $model->attributes = $_POST['Place'];
         $model->pic_other = $imageListSerialize['dataSerialize'];
         $file = XUpload::upload($_FILES['attach'], array('thumb' => true, 'thumbSize' => array(192, 470)));
         $adr = XUpload::upload($_FILES['pic_adr'], array('thumb' => true, 'thumbSize' => array(498, 364)));
         if (is_array($file)) {
             $model->pic = $file['paththumbname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if (is_array($adr)) {
             $model->pic_adr = $adr['paththumbname'];
             @unlink($_POST['oAttach']);
             @unlink($_POST['oThumb']);
         }
         if ($model->validate() && $model->save()) {
             $this->redirect(array('/host/default/myplace'));
         }
     }
     if ($imageList) {
         $imageList = $imageListSerialize['data'];
     } elseif ($model->pic_other) {
         $imageList = unserialize($model->pic_other);
     }
     $this->render('addplace', array('model' => $model, 'imageList' => $imageList));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:31,代码来源:DefaultController.php


示例11: actionShow

 /**
  * 查看专题
  */
 public function actionShow($name)
 {
     $specialModel = Special::model()->find('title_alias=:titleAlias', array('titleAlias' => CHtml::encode(strip_tags($name))));
     if (false == $specialModel) {
         throw new CHttpException(404, '专题不存在');
     }
     //更新浏览次数
     $specialModel->updateCounters(array('view_count' => 1), 'id=:id', array('id' => $specialModel->id));
     $specialPostModel = new Post();
     $criteria = new CDbCriteria();
     $criteria->addCondition('t.status_is=:status AND special_id=:specialId');
     $criteria->params = array('status' => 'Y', 'specialId' => $specialModel->id);
     $criteria->order = 't.id DESC';
     $bagecmsSpecialCount = $specialPostModel->count($criteria);
     $postPage = new CPagination($bagecmsSpecialCount);
     $postPage->pageSize = 10;
     $postPageParams = XUtils::buildCondition($_GET, array());
     $postPageParams['#'] = 'list';
     $postPage->params = is_array($postPageParams) ? $postPageParams : array();
     $criteria->limit = $postPage->pageSize;
     $criteria->offset = $postPage->currentPage * $postPage->pageSize;
     $specialPostList = $specialPostModel->findAll($criteria);
     $this->_seoTitle = empty($specialModel->seo_title) ? $specialModel->title . ' - ' . $this->_conf['site_name'] : $specialModel->seo_title;
     $tpl = empty($specialModel->tpl) ? 'show' : $specialModel->tpl;
     $data = array('specialShow' => $specialModel, 'specialPostList' => $specialPostList, 'bagecmsPagebar' => $postPage);
     $this->render($tpl, $data);
 }
开发者ID:bigbol,项目名称:ziiwo,代码行数:30,代码来源:SpecialController.php


示例12: actionHome

 /**
  * 主界面
  */
 public function actionHome()
 {
     $data['soft'] = 'bagecms';
     $data['softVersion'] = $this->_bagecms;
     $data['softRelease'] = $this->_bagecmsRelease;
     $data['serverSoft'] = $_SERVER['SERVER_SOFTWARE'];
     $data['serverOs'] = PHP_OS;
     $data['phpVersion'] = PHP_VERSION;
     $data['fileupload'] = ini_get('file_uploads') ? ini_get('upload_max_filesize') : '禁止上传';
     $data['serverUri'] = $_SERVER['SERVER_NAME'];
     $data['maxExcuteTime'] = ini_get('max_execution_time') . ' 秒';
     $data['maxExcuteMemory'] = ini_get('memory_limit');
     $data['magic_quote_gpc'] = MAGIC_QUOTE_GPC ? '开启' : '关闭';
     $data['allow_url_fopen'] = ini_get('allow_url_fopen') ? '开启' : '关闭';
     $data['excuteUseMemory'] = function_exists('memory_get_usage') ? XUtils::byteFormat(memory_get_usage()) : '未知';
     $dbsize = 0;
     $connection = Yii::app()->db;
     $sql = 'SHOW TABLE STATUS LIKE \'' . $connection->tablePrefix . '%\'';
     $command = $connection->createCommand($sql)->queryAll();
     foreach ($command as $table) {
         $dbsize += $table['Data_length'] + $table['Index_length'];
     }
     $mysqlVersion = $connection->createCommand("SELECT version() AS version")->queryAll();
     $data['mysqlVersion'] = $mysqlVersion[0]['version'];
     $data['dbsize'] = $dbsize ? XUtils::byteFormat($dbsize) : '未知';
     $notebook = Admin::model()->findByPk($this->_admini['userId']);
     $env = XUtils::b64encode(serialize($data));
     $this->render('home', array('notebook' => $notebook, 'env' => $env, 'server' => $data));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:32,代码来源:DefaultController.php


示例13: beforeSave

 /**
  * 自动化初始值/处理数据
  *
  * @return unknown
  */
 public function beforeSave()
 {
     if ($this->isNewRecord) {
         isset($this->create_time) && ($this->create_time = time());
     }
     $this->sort_order = intval($this->sort_order);
     $this->site_url = XUtils::convertHttp($this->site_url);
     return true;
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:14,代码来源:Link.php


示例14: _create

 /**
  * 后台日志记录
  * @param  $intro
  */
 public static function _create(array $arr = array())
 {
     $session = new XSession();
     $admini = $session->get('_admini');
     $model = new AdminLogger();
     $model->attributes = $arr;
     !isset($arr['user_id']) && ($model->user_id = intval($admini['userId']));
     $model->url = Yii::app()->request->getRequestUri();
     $model->ip = XUtils::getClientIP();
     $model->save();
 }
开发者ID:zywh,项目名称:maplecity,代码行数:15,代码来源:AdminLogger.php


示例15: sendMail

 function sendMail($email, $subject, $message, $name)
 {
     global $app;
     $headers = "To: " . XUtils::strToBase($name, 'utf-8', 'windows-1251') . " <{$email}>\n";
     $headers .= "From: " . XUtils::strToBase($app->Dictionary->getWord("MailFrom"), 'utf-8', 'windows-1251') . "<" . $app->getVar("mailsender") . ">\n";
     $headers .= "X-Sender: " . XUtils::strToBase($app->Dictionary->getWord("XSender"), 'utf-8', 'windows-1251') . "\n";
     $headers .= "Content-Type: text/plain; charset=windows-1251\n";
     $headers .= "Content-Transfer-Encoding: 8bit\n";
     $headers .= "MIME-Version: 1.0\n";
     $headers = iconv("utf-8", "windows-1251", $headers);
     $subject = XUtils::strToBase($subject, 'utf-8', 'windows-1251');
     $message = iconv("utf-8", "windows-1251", $message);
     mail($email, $subject, $message, $headers);
 }
开发者ID:parxomchik,项目名称:Agro,代码行数:14,代码来源:XUtils.class.php


示例16: actionUpdateTpl

 /**
  * 编辑
  *
  * @param $id
  */
 public function actionUpdateTpl($filename)
 {
     $filename = CHtml::encode(trim($this->_gets->getParam('filename')));
     $content = trim($this->_gets->getParam('content'));
     if (isset($_POST['content'])) {
         $fileputcontent = file_put_contents(Yii::app()->basePath . '/views/' . XUtils::b64decode($filename), $content);
         if ($fileputcontent == true) {
             //$this->redirect( array ( 'index' ) );
             Yii::app()->user->setFlash('success', '修改成功!');
         }
     }
     $data['filename'] = XUtils::b64decode($filename);
     $data['content'] = htmlspecialchars(file_get_contents(Yii::app()->basePath . '/views/' . XUtils::b64decode($filename)));
     $this->render('update', $data);
 }
开发者ID:s-nice,项目名称:snece,代码行数:20,代码来源:TemplateController.php


示例17: actionIndex

 /**
  * 外借资产查询
  *
  * @author 张钰 徐晨阳
  * 该模块主要负责对申请资产进行显示,删除
  */
 public function actionIndex()
 {
     // 分页取数据
     $criteria = new CDbCriteria();
     $criteria->select = '*';
     if (XUtils::method() == 'POST') {
         // 查询按钮
         if (isset($_POST['subQuery'])) {
             // 判断是否获取content中的内容,内容为空是显示全部申请
             if (isset($_POST['queryType']) && isset($_POST['content']) && $_POST['content'] != null) {
                 $queryType = $_POST['queryType'];
                 if ($queryType == 'ByApplyId') {
                     $criteria->addCondition('applyId=:applyId');
                     // 查询条件,即where id = 1
                     $criteria->params[':applyId'] = $_POST['content'];
                 } else {
                     if ($queryType == 'ByStuId') {
                         $criteria->addCondition('stuId=:stuId');
                         // 查询条件,即where id = 1
                         $criteria->params[':stuId'] = $_POST['content'];
                     } else {
                         if ($queryType == 'ByAssetName') {
                             $criteria->addCondition('assetName=:assetName');
                             // 查询条件,即where id = 1
                             $criteria->params[':assetName'] = $_POST['content'];
                         } else {
                             echo "ERROR";
                         }
                     }
                 }
             }
         }
     }
     //分页获取
     $count = AsApply::model()->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = PAGESIZE;
     $pages->applyLimit($criteria);
     //echo var_dump($pages);
     $data = AsApply::model()->findAll($criteria);
     $data = json_decode(CJSON::encode($data), TRUE);
     is_array($data) ? null : ($data = array());
     // 防止空数组
     $this->render('index', array('data' => $data, 'pages' => $pages));
     // $this->render ( 'index' );
 }
开发者ID:jiahongwei,项目名称:newland-project,代码行数:52,代码来源:AssetApplyController.php


示例18: actionIndex

 /**
  * 首页
  */
 public function actionIndex()
 {
     $bagecmsQuestionModel = new Question();
     $bagecmsQuestionCriteria = new CDbCriteria();
     $bagecmsQuestionCriteria->condition = 'status_is=:status';
     $bagecmsQuestionCriteria->params = array('status' => 'Y');
     $bagecmsQuestionCriteria->order = 't.id DESC';
     $bagecmsQuestionCount = $bagecmsQuestionModel->count($bagecmsQuestionCriteria);
     $bagecmsQuestionPages = new CPagination($bagecmsQuestionCount);
     $bagecmsQuestionPages->pageSize = 10;
     $bagecmsQuestionPageParams = XUtils::buildCondition($_GET, array());
     $bagecmsQuestionPageParams['#'] = 'list';
     $bagecmsQuestionPages->params = is_array($bagecmsQuestionPageParams) ? $bagecmsQuestionPageParams : array();
     $bagecmsQuestionCriteria->limit = $bagecmsQuestionPages->pageSize;
     $bagecmsQuestionCriteria->offset = $bagecmsQuestionPages->currentPage * $bagecmsQuestionPages->pageSize;
     $bagecmsQuestionList = $bagecmsQuestionModel->findAll($bagecmsQuestionCriteria);
     $this->_seoTitle = '留言咨询 - ' . $this->_conf['site_name'];
     $this->render('index', array('bagecmsQuestionList' => $bagecmsQuestionList, 'pages' => $bagecmsQuestionPages));
 }
开发者ID:tecshuttle,项目名称:51qsk,代码行数:22,代码来源:QuestionController.php


示例19: mapi_get

 static function mapi_get($url_mixed, $data = array(), $debug = false)
 {
     //$debug=true;
     Yii::import('application.vendors.*');
     require_once 'Tp/Curl.class.php';
     $curl = new Curl();
     if (YII_ENV == 'development') {
         $curl->setHeader('Apihandshake', 'yaochufa');
         $curl->setHeader('Referer', 'http://m.yaochufa.com');
     } else {
         $curl->setHeader('Apihandshake', 'yaochufaapi');
         $curl->setHeader('Referer', 'http://m.yaochufa.com');
     }
     $curl->setOpt(CURLOPT_TIMEOUT, 15);
     $data['system'] = Yii::app()->params['mmm_api']['system'];
     $curl->get($url_mixed, $data);
     if ($debug == true) {
         XUtils::dump($curl->request_headers);
     }
     return $curl->response;
 }
开发者ID:mgcxy,项目名称:yiiSwoole,代码行数:21,代码来源:XHttp.php


示例20: actionIndex

 /**
  * 首页
  *
  */
 public function actionIndex()
 {
     parent::_acl('evaluate_index');
     $model = new Evaluate();
     $criteria = new CDbCriteria();
     $condition = '1';
     $isHandle = $this->_gets->getParam('is_handle');
     $noHandle = $this->_gets->getParam('no_handle');
     $isHandle && ($condition .= ' AND status= ' . $isHandle);
     $noHandle && ($condition .= ' AND status= ' . $noHandle);
     $criteria->condition = $condition;
     $criteria->order = 't.id DESC';
     $count = $model->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     $pageParams = XUtils::buildCondition($_GET, array('status'));
     $pages->params = is_array($pageParams) ? $pageParams : array();
     $criteria->limit = $pages->pageSize;
     $criteria->offset = $pages->currentPage * $pages->pageSize;
     $result = $model->findAll($criteria);
     $this->render('index', array('datalist' => $result, 'pagebar' => $pages));
 }
开发者ID:zywh,项目名称:maplecity,代码行数:26,代码来源:EvaluateController.php



注:本文中的XUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP XWB_plugin类代码示例发布时间:2022-05-23
下一篇:
PHP XTemplate类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap