32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2025-01-26 05:48:26 +00:00

Apply auto cs fix from phpcbf

This commit is contained in:
Tuan Pham Ngoc 2021-08-15 22:12:14 +07:00
parent 2b960d4bed
commit 4805fc16f2
6 changed files with 19 additions and 14 deletions

View File

@ -186,9 +186,11 @@ class CategoryModel extends ListModel
{ {
$nowDate = Factory::getDate()->toSql(); $nowDate = Factory::getDate()->toSql();
$query->where('(' . $db->quoteName('a.publish_up') $query->where('(' . $db->quoteName('a.publish_up')
. ' IS NULL OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)') . ' IS NULL OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)'
)
->where('(' . $db->quoteName('a.publish_down') ->where('(' . $db->quoteName('a.publish_down')
. ' IS NULL OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)') . ' IS NULL OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)'
)
->bind(':publish_up', $nowDate) ->bind(':publish_up', $nowDate)
->bind(':publish_down', $nowDate); ->bind(':publish_down', $nowDate);
} }

View File

@ -126,9 +126,11 @@ class WeblinkModel extends ItemModel
// Filter by start and end dates. // Filter by start and end dates.
$nowDate = Factory::getDate()->toSql(); $nowDate = Factory::getDate()->toSql();
$query->where('(' . $db->quoteName('a.publish_up') $query->where('(' . $db->quoteName('a.publish_up')
. ' IS NULL OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)') . ' IS NULL OR ' . $db->quoteName('a.publish_up') . ' <= :publish_up)'
)
->where('(' . $db->quoteName('a.publish_down') ->where('(' . $db->quoteName('a.publish_down')
. ' IS NULL OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)') . ' IS NULL OR ' . $db->quoteName('a.publish_down') . ' >= :publish_down)'
)
->bind(':publish_up', $nowDate) ->bind(':publish_up', $nowDate)
->bind(':publish_down', $nowDate); ->bind(':publish_down', $nowDate);
} }

View File

@ -35,7 +35,8 @@ class WeblinksHelper
**/ **/
public static function getList($params, $app) public static function getList($params, $app)
{ {
/* @var \Joomla\Component\Weblinks\Site\Model\CategoryModel $model */ // @var \Joomla\Component\Weblinks\Site\Model\CategoryModel $model
$model = $app->bootComponent('com_weblinks')->getMVCFactory() $model = $app->bootComponent('com_weblinks')->getMVCFactory()
->createModel('Category', 'Site', ['ignore_request' => true]); ->createModel('Category', 'Site', ['ignore_request' => true]);