Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1642

Přidáno uživatelem Ondřej Fibich před asi 12 roky(ů)

Novinky:

- Filter_form#as_sql - pridan parametr pro vyfiltrovani pouzitelnych poli

Opravy:

- roolback zmen u provozu ktere k nicemu nevedly

Zobrazit rozdíly:

freenetis/branches/testing/db_upgrades/upgrade_1.0.0~rc1.php
`day` date NOT NULL,
PRIMARY KEY (`member_id`,`day`),
KEY `member_id` (`member_id`),
KEY `day` (`day`),
KEY `upload` (`upload`),
KEY `download` (`download`),
KEY `local_upload` (`local_upload`),
KEY `local_download` (`local_download`)
KEY `day` (`day`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;",
"CREATE TABLE IF NOT EXISTS `messages` (
freenetis/branches/testing/application/helpers/html.php
public static function menu_item_counter($count, $color = NULL)
{
echo '<span class="menu_item_counter ' . ($count ? 'rbg' : '') . '"'
. (empty($color) ? '' : " style=\"background-color: $color\"")
. ((!empty($color) && $count) ? " style=\"background-color: $color\"" : "")
. '>' . $count . '</span>';
}
freenetis/branches/testing/application/models/members_traffic.php
SELECT
IFNULL(SUM(upload),0) AS upload,
IFNULL(SUM(download),0) AS download
FROM members_traffics d WHERE d.member_id = ?
FROM members_traffics d
WHERE d.member_id = ?
", $member_id);
return ($result && $result->count()) ? $result->current() : null;
......
SELECT
IFNULL(SUM(upload),0) AS upload,
IFNULL(SUM(download),0) AS download
FROM members_traffics d WHERE d.member_id = ? AND day = CURDATE()
FROM members_traffics d
WHERE d.member_id = ? AND day = CURDATE()
", array($member_id))->current();
}
......
SELECT
IFNULL(SUM(upload),0) AS upload,
IFNULL(SUM(download),0) AS download
FROM members_traffics d WHERE d.member_id = ? AND day BETWEEN ? AND CURDATE()
FROM members_traffics d
WHERE d.member_id = ? AND day BETWEEN ? AND CURDATE()
", array($member_id, date::start_of_week (date("W"))))->current();
}
......
SELECT
IFNULL(SUM(upload),0) AS upload,
IFNULL(SUM(download),0) AS download
FROM members_traffics d WHERE d.member_id = '?' AND day BETWEEN ? AND CURDATE()
FROM members_traffics d
WHERE d.member_id = '?' AND day BETWEEN ? AND CURDATE()
", array($member_id, date("Y-m").'-01'))->current();
}
......
$group_by
$where
) d
JOIN members m ON d.member_id = m.id
")->current()->total;
}
freenetis/branches/testing/application/libraries/Filter_form.php
/**
* Returns SQL query (only part after WHERE) to use in model methods
*
* @param mixed $approved_keys Array which defined columns which should be used in query.
* @author Michal Kliment
* @return string
*/
public function as_sql ()
public function as_sql ($approved_keys = FALSE)
{
// loads default filter's values
$this->load_default();
......
foreach ($this->types as $i => $type)
{
if (is_array($approved_keys) && !in_array($type, $approved_keys))
{ // not allowed => continue
continue;
}
$filter = $this->filters[$type];
$sub_queries = array();

Také k dispozici: Unified diff