PCT gpx update
This commit is contained in:
10
inc/Feed.php
10
inc/Feed.php
@@ -39,6 +39,10 @@ class Feed extends PhpObject {
|
||||
const FEED_TABLE = 'feeds';
|
||||
const MSG_TABLE = 'messages';
|
||||
|
||||
//Hide/Display values
|
||||
const MSG_HIDDEN = 0;
|
||||
const MSG_DISPLAYED = 1;
|
||||
|
||||
/**
|
||||
* Database Handle
|
||||
* @var Db
|
||||
@@ -111,6 +115,7 @@ class Feed extends PhpObject {
|
||||
}
|
||||
|
||||
public function getMessages($asConstraints=array()) {
|
||||
$sFeedIdCol = Db::getId(self::FEED_TABLE, true);
|
||||
$asInfo = array(
|
||||
'select' => array(
|
||||
Db::getId(self::MSG_TABLE), 'ref_msg_id', 'type', //ID
|
||||
@@ -120,8 +125,8 @@ class Feed extends PhpObject {
|
||||
),
|
||||
'from' => self::MSG_TABLE,
|
||||
'join' => array(self::FEED_TABLE => Db::getId(self::FEED_TABLE)),
|
||||
'constraint'=> array(Db::getId(self::FEED_TABLE, true) => $this->getFeedId()),
|
||||
'constOpe' => array(Db::getId(self::FEED_TABLE, true) => "="),
|
||||
'constraint'=> array($sFeedIdCol => $this->getFeedId(), 'display' => self::MSG_DISPLAYED),
|
||||
'constOpe' => array($sFeedIdCol => "=", 'display' => "="),
|
||||
'orderBy' => array('site_time'=>'ASC')
|
||||
);
|
||||
if(!empty($asConstraints)) $asInfo = array_merge($asInfo, $asConstraints);
|
||||
@@ -144,7 +149,6 @@ class Feed extends PhpObject {
|
||||
}
|
||||
|
||||
public function getLastMessageId($asConstraints=array()) {
|
||||
|
||||
$asMessages = $this->getMessages($asConstraints);
|
||||
return end($asMessages)[Db::getId(self::MSG_TABLE)] ?? 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user