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


PHP w2p_Database_Query::dbfnNow方法代码示例

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


在下文中一共展示了w2p_Database_Query::dbfnNow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 w2p_Database_Query();
     $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('task_updated 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 <> 1');
     $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:eureka2,项目名称:web2project,代码行数:30,代码来源:tasks.class.php

示例2: __extract_from_todo

/**
 * @param $user_id
 * @param $showArcProjs
 * @param $showLowTasks
 * @param $showInProgress
 * @param $showHoldProjs
 * @param $showDynTasks
 * @param $showPinned
 * @param $showEmptyDate
 * @param $task_type
 * @param $allowedTasks
 * @param $allowedProjects
 *
 * @return Array
 */
function __extract_from_todo($user_id, $showArcProjs, $showLowTasks, $showInProgress, $showHoldProjs, $showDynTasks, $showPinned, $showEmptyDate, $task_type, $allowedTasks, $allowedProjects)
{
    // query my sub-tasks (ignoring task parents)
    $q = new w2p_Database_Query();
    $q->addQuery('distinct(ta.task_id), ta.*, ta.task_start_date as task_start_datetime, ta.task_end_date as task_end_datetime');
    $q->addQuery('project_name, pr.project_id, project_color_identifier');
    $q->addQuery('tp.task_pinned');
    $q->addQuery('ut.user_task_priority');
    $dateDiffString = $q->dbfnDateDiff('ta.task_end_date', $q->dbfnNow()) . ' AS task_due_in';
    $q->addQuery($dateDiffString);
    $q->addTable('projects', 'pr');
    $q->addTable('tasks', 'ta');
    $q->addTable('user_tasks', 'ut');
    $q->leftJoin('user_task_pin', 'tp', 'tp.task_id = ta.task_id and tp.user_id = ' . (int) $user_id);
    $q->addWhere('ut.task_id = ta.task_id');
    $q->addWhere('ut.user_id = ' . (int) $user_id);
    $q->addWhere('( ta.task_percent_complete < 100 or ta.task_percent_complete is null)');
    $q->addWhere('ta.task_status = 0');
    $q->addWhere('pr.project_id = ta.task_project');
    if (!$showArcProjs) {
        $q->addWhere('project_active = 1');
        if (($template_status = w2PgetConfig('template_projects_status_id')) != '') {
            $q->addWhere('project_status <> ' . (int) $template_status);
        }
    }
    if (!$showLowTasks) {
        $q->addWhere('task_priority >= 0');
    }
    if ($showInProgress) {
        $q->addWhere('project_status = 3');
    }
    if (!$showHoldProjs) {
        if (($on_hold_status = w2PgetConfig('on_hold_projects_status_id')) != '') {
            $q->addWhere('project_status <> ' . (int) $on_hold_status);
        }
    }
    if (!$showDynTasks) {
        $q->addWhere('task_dynamic <> 1');
    }
    if ($showPinned) {
        $q->addWhere('task_pinned = 1');
    }
    if (!$showEmptyDate) {
        $q->addWhere('ta.task_start_date <> \'\' AND ta.task_start_date <> \'0000-00-00 00:00:00\'');
    }
    if ($task_type != '') {
        $q->addWhere('ta.task_type = ' . (int) $task_type);
    }
    if (count($allowedTasks)) {
        $q->addWhere($allowedTasks);
    }
    if (count($allowedProjects)) {
        $q->addWhere($allowedProjects);
    }
    $q->addOrder('task_end_date, task_start_date, task_priority');
    $tasks = $q->loadList();
    return $tasks;
}
开发者ID:illuminate3,项目名称:web2project,代码行数:73,代码来源:cleanup_functions.php

示例3: CProject

        echo db_error();
        $q->clear();
    }
}
$AppUI->savePlace();
$proj = new CProject();
$tobj = new CTask();
$allowedProjects = $proj->getAllowedSQL($AppUI->user_id, 'pr.project_id');
$allowedTasks = $tobj->getAllowedSQL($AppUI->user_id, 'ta.task_id');
// query my sub-tasks (ignoring task parents)
$q = new w2p_Database_Query();
$q->addQuery('ta.*');
$q->addQuery('project_name, pr.project_id, project_color_identifier');
$q->addQuery('tp.task_pinned');
$q->addQuery('ut.user_task_priority');
$dateDiffString = $q->dbfnDateDiff('ta.task_end_date', $q->dbfnNow()) . ' AS task_due_in';
$q->addQuery($dateDiffString);
$q->addTable('projects', 'pr');
$q->addTable('tasks', 'ta');
$q->addTable('user_tasks', 'ut');
$q->leftJoin('user_task_pin', 'tp', 'tp.task_id = ta.task_id and tp.user_id = ' . (int) $user_id);
$q->leftJoin('project_departments', 'project_departments', 'pr.project_id = project_departments.project_id OR project_departments.project_id IS NULL');
$q->leftJoin('departments', 'departments', 'departments.dept_id = project_departments.department_id OR dept_id IS NULL');
$q->addWhere('ut.task_id = ta.task_id');
$q->addWhere('ut.user_id = ' . (int) $user_id);
$q->addWhere('( ta.task_percent_complete < 100 or ta.task_percent_complete is null)');
$q->addWhere('ta.task_status = 0');
$q->addWhere('pr.project_id = ta.task_project');
if (!$showArcProjs) {
    $q->addWhere('project_active = 1');
    if (($template_status = w2PgetConfig('template_projects_status_id')) != '') {
开发者ID:,项目名称:,代码行数:31,代码来源:

示例4: 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 w2p_Database_Query();
     $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->dbfnNowWithTZ() . "' 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:eureka2,项目名称:web2project,代码行数:25,代码来源:calendar.class.php


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