mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 04:09:56 +03:00
Feature_1255:
- bug fix : function pwg_db_get_recent_period_expression - add extra fields for select based on "order by" git-svn-id: http://piwigo.org/svn/trunk@4387 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
c96097529e
commit
ad796f152f
4 changed files with 24 additions and 27 deletions
|
@ -458,23 +458,14 @@ function do_maintenance_all_tables()
|
|||
}
|
||||
}
|
||||
|
||||
function pwg_db_get_recent_period_expression($period, $date='CURRENT_DATE')
|
||||
function pwg_db_concat_ws($string, $separaor)
|
||||
{
|
||||
if ($date!='CURRENT_DATE')
|
||||
{
|
||||
$date = '\''.$date.'\'';
|
||||
}
|
||||
|
||||
return 'SUBDATE('.$date.',INTERVAL '.$period.' DAY)';
|
||||
return 'CONCAT_WS(\''.$separaor.'\','. $string.')';
|
||||
}
|
||||
|
||||
function pwg_db_get_recent_period($period, $date='CURRENT_DATE')
|
||||
function pwg_db_cast_to_text($string)
|
||||
{
|
||||
$query = '
|
||||
SELECT '.pwg_db_get_recent_period_expression($period);
|
||||
list($d) = pwg_db_fetch_row(pwg_query($query));
|
||||
|
||||
return $d;
|
||||
return 'CAST('.$string.' AS CHAR)';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue