PCT gpx update

This commit is contained in:
2022-09-14 15:04:58 +02:00
parent c4d9db0032
commit 9055fc02f3
5 changed files with 43759 additions and 8544 deletions

View File

@@ -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;
}