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


PHP DBQuery::dbfnDateAdd方法代码示例

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


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

示例1: getTaskList

 public function getTaskList($userId, $days = 30)
 {
     /*
      * This list of fields - id, name, description, startDate, endDate,
      * updatedDate - are named specifically for the iCal creation.
      * If you change them, it's probably going to break.  So don't do that.
      */
     $q = new DBQuery();
     $q->addQuery('t.task_id as id');
     $q->addQuery('task_name as name');
     $q->addQuery('task_description as description');
     $q->addQuery('task_start_date as startDate');
     $q->addQuery('task_end_date as endDate');
     $q->addQuery($q->dbfnNow() . ' as updatedDate');
     $q->addQuery('CONCAT(\'' . W2P_BASE_URL . '/index.php?m=tasks&a=view&task_id=' . '\', t.task_id) as url');
     $q->addQuery('p.project_id, p.project_name');
     $q->addTable('tasks', 't');
     $q->addWhere('(task_start_date < ' . $q->dbfnDateAdd($q->dbfnNow(), $days, 'DAY') . ' OR task_end_date < ' . $q->dbfnDateAdd($q->dbfnNow(), $days, 'DAY') . ')');
     $q->addWhere('task_percent_complete < 100');
     $q->addWhere('task_dynamic = 0');
     $q->innerJoin('user_tasks', 'ut', 'ut.task_id = t.task_id');
     $q->addWhere('ut.user_id = ' . $userId);
     $q->innerJoin('projects', 'p', 'p.project_id = t.task_project');
     $q->addWhere('project_active > 0');
     if (($template_status = w2PgetConfig('template_projects_status_id')) != '') {
         $q->addWhere('project_status <> ' . $template_status);
     }
     $q->addOrder('task_start_date, task_end_date');
     return $q->loadList();
 }
开发者ID:joly,项目名称:web2project,代码行数:30,代码来源:tasks.class.php

示例2: getCalendarEvents

 public function getCalendarEvents($userId, $days = 30)
 {
     /*
      * This list of fields - id, name, description, startDate, endDate,
      * updatedDate - are named specifically for the iCal creation.
      * If you change them, it's probably going to break.  So don't do that.
      */
     $q = new DBQuery();
     $q->addQuery('e.event_id as id');
     $q->addQuery('event_title as name');
     $q->addQuery('event_description as description');
     $q->addQuery('event_start_date as startDate');
     $q->addQuery('event_end_date as endDate');
     $q->addQuery($q->dbfnNow() . ' as updatedDate');
     $q->addQuery('CONCAT(\'' . W2P_BASE_URL . '/index.php?m=calendar&a=view&event_id=' . '\', e.event_id) as url');
     $q->addQuery('projects.project_id, projects.project_name');
     $q->addTable('events', 'e');
     $q->leftJoin('projects', 'projects', 'e.event_project = projects.project_id');
     $q->addWhere('(event_start_date > ' . $q->dbfnNow() . ' OR event_end_date > ' . $q->dbfnNow() . ')');
     $q->addWhere('(event_start_date < ' . $q->dbfnDateAdd($q->dbfnNow(), $days, 'DAY') . ' OR event_end_date < ' . $q->dbfnDateAdd($q->dbfnNow(), $days, 'DAY') . ')');
     $q->innerJoin('user_events', 'ue', 'ue.event_id = e.event_id');
     $q->addWhere('ue.user_id = ' . $userId);
     $q->addOrder('event_start_date');
     return $q->loadList();
 }
开发者ID:joly,项目名称:web2project,代码行数:25,代码来源:calendar.class.php


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