mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
fix sort by column
This commit is contained in:
parent
2d2baa343c
commit
efc1fc06ca
@ -1,17 +0,0 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule\Adv\Listeners;
|
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Ui\Table\Event\TableIsQuerying;
|
|
||||||
|
|
||||||
class AddTableCategoryColumn
|
|
||||||
{
|
|
||||||
public function handle(TableIsQuerying $event)
|
|
||||||
{
|
|
||||||
// $query = $event->getQuery();
|
|
||||||
// $builder = $event->getBuilder();
|
|
||||||
//
|
|
||||||
// if ($builder->getModel() === "Visiosoft\AdvsModule\Adv\AdvModel") {
|
|
||||||
// $query->join('cats_category_translations as cats_trans', 'advs_advs.cat1', '=', 'cats_trans.entry_id')
|
|
||||||
// ->select('advs_advs.*', 'cats_trans.name as cat');
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -221,7 +221,6 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
|||||||
protected $listeners = [
|
protected $listeners = [
|
||||||
TableIsQuerying::class => [
|
TableIsQuerying::class => [
|
||||||
AddAdvsSettingsScript::class,
|
AddAdvsSettingsScript::class,
|
||||||
AddTableCategoryColumn::class,
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -153,13 +153,12 @@ class AdvsController extends AdminController
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
'category' => [
|
'category' => [
|
||||||
|
'sort_column' => 'cat1',
|
||||||
'value' => function (EntryInterface $entry, CategoryModel $categoryModel) {
|
'value' => function (EntryInterface $entry, CategoryModel $categoryModel) {
|
||||||
$category = $categoryModel->getCat($entry->cat1);
|
$category = $categoryModel->getCat($entry->cat1);
|
||||||
if (!is_null($category))
|
if (!is_null($category))
|
||||||
return $category->name;
|
return $category->name;
|
||||||
}
|
}
|
||||||
// 'sort_column' => 'cat',
|
|
||||||
// 'value' => 'entry.cat'
|
|
||||||
],
|
],
|
||||||
'finish_at',
|
'finish_at',
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user