当前位置: 首页>>代码示例>>PHP>>正文


PHP Actions::createCondition方法代码示例

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


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

示例1: actionIndex

 public function actionIndex()
 {
     if (isset($_GET['toggleView']) && $_GET['toggleView']) {
         if (Yii::app()->params->profile->oldActions) {
             Yii::app()->params->profile->oldActions = 0;
         } else {
             Yii::app()->params->profile->oldActions = 1;
         }
         Yii::app()->params->profile->update(array('oldActions'));
         $this->redirect(array('index'));
     }
     $model = new Actions('search');
     if (!isset(Yii::app()->params->profile->oldActions) || !Yii::app()->params->profile->oldActions) {
         if (!empty($_POST) || !empty(Yii::app()->params->profile->actionFilters)) {
             if (isset($_POST['complete'], $_POST['assignedTo'], $_POST['dateType'], $_POST['dateRange'], $_POST['orderType'], $_POST['order'], $_POST['start'], $_POST['end'])) {
                 $complete = $_POST['complete'];
                 $assignedTo = $_POST['assignedTo'];
                 $dateType = $_POST['dateType'];
                 $dateRange = $_POST['dateRange'];
                 $orderType = $_POST['orderType'];
                 $order = $_POST['order'];
                 $start = $_POST['start'];
                 $end = $_POST['end'];
                 if ($dateRange != 'range') {
                     $start = null;
                     $end = null;
                 }
                 $filters = array('complete' => $complete, 'assignedTo' => $assignedTo, 'dateType' => $dateType, 'dateRange' => $dateRange, 'orderType' => $orderType, 'order' => $order, 'start' => $start, 'end' => $end);
             } elseif (!empty(Yii::app()->params->profile->actionFilters)) {
                 $filters = json_decode(Yii::app()->params->profile->actionFilters, true);
             }
             $condition = Actions::createCondition($filters);
             $dataProvider = $model->search($condition, Actions::ACTION_INDEX_PAGE_SIZE);
             $params = $filters;
         } else {
             $dataProvider = $model->search(null, Actions::ACTION_INDEX_PAGE_SIZE);
             $params = array();
         }
         $this->render('index', array('model' => $model, 'dataProvider' => $dataProvider, 'params' => $params));
     } else {
         $this->render('oldIndex', array('model' => $model));
     }
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:43,代码来源:ActionsController.php


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