included get_latest text function to class text.php
This commit is contained in:
parent
04f0f76f2f
commit
711ea543d4
10
page/qq/SYS_TEXT_GET_LATEST.php
Normal file
10
page/qq/SYS_TEXT_GET_LATEST.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\SQL;
|
||||||
|
class SYS_TEXT_GET_LATEST extends \SYSTEM\DB\QP {
|
||||||
|
public static function get_class(){return \get_class();}
|
||||||
|
public static function mysql(){return
|
||||||
|
'SELECT system_text.id,text FROM system_text
|
||||||
|
LEFT JOIN system_text_tag ON system_text.id = system_text_tag.id
|
||||||
|
WHERE tag = ? ORDER BY time_create DESC LIMIT ?;';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -78,6 +78,9 @@ class text {
|
|||||||
return self::get_adv($id, \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG));}
|
return self::get_adv($id, \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG));}
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
public static function get_latest($tag, $limit){
|
||||||
|
return \SYSTEM\SQL\SYS_TEXT_GET_LATEST::QA(array($tag, $limit));
|
||||||
|
}
|
||||||
public static function search($search,$tag/*=null*/){
|
public static function search($search,$tag/*=null*/){
|
||||||
$search = '%'.$search.'%';
|
$search = '%'.$search.'%';
|
||||||
return \SYSTEM\SQL\SYS_TEXT_SEARCH_TAG::QA(array($tag,$search,$search,$search));}
|
return \SYSTEM\SQL\SYS_TEXT_SEARCH_TAG::QA(array($tag,$search,$search,$search));}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user