Jump to content

\IPS\Content\Item::getItemsWithPermission() ORDER BY


newbie LAC

Recommended Posts

Posted

Hello,

\IPS\Content\Item::getItemsWithPermission()

You don't allow to add columns to tables

I've added new table and I want to order topics by column from new table.

But I can't

					$subSelectClause = static::$databaseTable . '.' . static::$databasePrefix . static::$databaseColumnId;

					/* Are we doing a pseudo-rand ordering? */
					if( $order == '_rand' )
					{
						$subSelectClause	.= ', SUBSTR( ' . static::$databaseTable . '.' . static::$databasePrefix . static::$databaseColumnMap['date'] . ', ' . rand( 1, 9 ) . ', 10 ) as _rand';
					}

					$select = \IPS\Db::i()->select( $subSelectClause, static::$databaseTable, $where, $order, $limit, ( $joinComments ? static::$databasePrefix . static::$databaseColumnId : NULL ), NULL, $queryFlags );

Could you add data (columns | expressions) from $order to $subSelectClause?

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...