CC-4253: Smart Playlist: Please support filter tracks by date
-code refactor
This commit is contained in:
parent
d23bd2d85b
commit
167881c903
|
@ -1140,16 +1140,14 @@ EOT;
|
||||||
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$spCriteria]);
|
$column = CcFilesPeer::getTableMap()->getColumnByPhpName(self::$criteria2PeerMap[$spCriteria]);
|
||||||
// if the column is timestamp, convert it into UTC
|
// if the column is timestamp, convert it into UTC
|
||||||
if ($column->getType() == PropelColumnTypes::TIMESTAMP) {
|
if ($column->getType() == PropelColumnTypes::TIMESTAMP) {
|
||||||
|
$spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']);
|
||||||
/* Check if only a date was supplied and trim
|
/* Check if only a date was supplied and trim
|
||||||
* the time after it is converted to UTC time
|
* the time after it is converted to UTC time
|
||||||
*/
|
*/
|
||||||
if (strlen($criteria['value']) <= 10) {
|
if (strlen($criteria['value']) <= 10) {
|
||||||
//extract date only from timestamp in db
|
//extract date only from timestamp in db
|
||||||
$spCriteria = 'date('.$spCriteria.')';
|
$spCriteria = 'date('.$spCriteria.')';
|
||||||
$spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']);
|
|
||||||
$spCriteriaValue = substr($spCriteriaValue, 0, 10);
|
$spCriteriaValue = substr($spCriteriaValue, 0, 10);
|
||||||
} else {
|
|
||||||
$spCriteriaValue = Application_Common_DateHelper::ConvertToUtcDateTimeString($criteria['value']);
|
|
||||||
}
|
}
|
||||||
} else if($spCriteria == "bit_rate") {
|
} else if($spCriteria == "bit_rate") {
|
||||||
// multiply 1000 because we store only number value
|
// multiply 1000 because we store only number value
|
||||||
|
|
Loading…
Reference in New Issue