mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
commit
a230cd42b3
@ -4,6 +4,11 @@ use Anomaly\Streams\Platform\Database\Migration\Migration;
|
|||||||
|
|
||||||
class VisiosoftModuleAdvsCreateAdvsStream extends Migration
|
class VisiosoftModuleAdvsCreateAdvsStream extends Migration
|
||||||
{
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
\Illuminate\Support\Facades\DB::getDoctrineSchemaManager()
|
||||||
|
->getDatabasePlatform()->registerDoctrineTypeMapping('point', 'string');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The stream definition.
|
* The stream definition.
|
||||||
|
|||||||
@ -6,13 +6,6 @@ use Visiosoft\AdvsModule\Adv\Table\Views\unfinished;
|
|||||||
|
|
||||||
class AdvTableBuilder extends TableBuilder
|
class AdvTableBuilder extends TableBuilder
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* The table views.
|
|
||||||
*
|
|
||||||
* @var array|string
|
|
||||||
*/
|
|
||||||
|
|
||||||
protected $views = [
|
protected $views = [
|
||||||
'all' => [
|
'all' => [
|
||||||
'view' => All::class,
|
'view' => All::class,
|
||||||
@ -31,25 +24,8 @@ class AdvTableBuilder extends TableBuilder
|
|||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* The table columns.
|
|
||||||
*
|
|
||||||
* @var array|string
|
|
||||||
*/
|
|
||||||
protected $columns = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The table buttons.
|
|
||||||
*
|
|
||||||
* @var array|string
|
|
||||||
*/
|
|
||||||
protected $buttons = [];
|
protected $buttons = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* The table actions.
|
|
||||||
*
|
|
||||||
* @var array|string
|
|
||||||
*/
|
|
||||||
protected $actions = [
|
protected $actions = [
|
||||||
'delete',
|
'delete',
|
||||||
'approve' => [
|
'approve' => [
|
||||||
@ -70,11 +46,6 @@ class AdvTableBuilder extends TableBuilder
|
|||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* The table options.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $options = [
|
protected $options = [
|
||||||
'order_by' => [
|
'order_by' => [
|
||||||
'id' => 'DESC',
|
'id' => 'DESC',
|
||||||
@ -82,11 +53,6 @@ class AdvTableBuilder extends TableBuilder
|
|||||||
'table_view' => 'visiosoft.module.advs::admin/table/table'
|
'table_view' => 'visiosoft.module.advs::admin/table/table'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
|
||||||
* The table assets.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
protected $assets = [
|
protected $assets = [
|
||||||
'scripts.js' => [
|
'scripts.js' => [
|
||||||
'visiosoft.module.advs::js/admin/advanced.js',
|
'visiosoft.module.advs::js/admin/advanced.js',
|
||||||
@ -96,5 +62,4 @@ class AdvTableBuilder extends TableBuilder
|
|||||||
'visiosoft.module.advs::css/admin/filter-user.css',
|
'visiosoft.module.advs::css/admin/filter-user.css',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class AdvTableButtons
|
|||||||
'create_configration' => [
|
'create_configration' => [
|
||||||
'text' => trans('visiosoft.module.advs::button.create_configurations'),
|
'text' => trans('visiosoft.module.advs::button.create_configurations'),
|
||||||
'href' => route('visiosoft.module.advs::configrations.create') . "?ad={entry.id}"]
|
'href' => route('visiosoft.module.advs::configrations.create') . "?ad={entry.id}"]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -553,7 +553,8 @@ class AdvsController extends PublicController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$metaTitle = $adv->name . " " . end($categories)['name'] . ' ' . setting_value('streams::domain');
|
$metaCatName = end($categories) ? end($categories)['name'] : '|';
|
||||||
|
$metaTitle = $adv->name . " " . $metaCatName . ' ' . setting_value('streams::domain');
|
||||||
$metaDesc = strip_tags($adv->advs_desc, '');
|
$metaDesc = strip_tags($adv->advs_desc, '');
|
||||||
|
|
||||||
if (is_module_installed('visiosoft.module.seo')) {
|
if (is_module_installed('visiosoft.module.seo')) {
|
||||||
|
|||||||
@ -112,35 +112,39 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
|
|||||||
|
|
||||||
public function getMainAndSubCats()
|
public function getMainAndSubCats()
|
||||||
{
|
{
|
||||||
$dBName = 'default_cats_category';
|
$dBName = 'cats_category';
|
||||||
$dBNamet = $dBName . '_translations';
|
$dBNamet = $dBName . '_translations';
|
||||||
|
|
||||||
$catsDB = DB::table((DB::raw($dBName . ' c1')))
|
$catsDB = DB::table($dBName . ' as c1')
|
||||||
->select(
|
->select(
|
||||||
DB::raw('c1.id'),
|
'c1.id',
|
||||||
DB::raw('c1.slug'),
|
'c1.slug',
|
||||||
DB::raw('c1.parent_category_id'),
|
'c1.parent_category_id',
|
||||||
DB::raw('c1.icon_id'),
|
'c1.icon_id',
|
||||||
DB::raw('t1.name'),
|
't1.name',
|
||||||
|
'c2.id as c2_id',
|
||||||
DB::raw('c2.id as c2_id'),
|
'c2.slug as c2_slug',
|
||||||
DB::raw('c2.slug as c2_slug'),
|
'c2.parent_category_id as c2_parent_category_id',
|
||||||
DB::raw('c2.parent_category_id as c2_parent_category_id'),
|
't2.name as c2_name',
|
||||||
DB::raw('t2.name as c2_name'),
|
'file.id as file_id'
|
||||||
|
|
||||||
DB::raw('file.id as file_id')
|
|
||||||
)
|
)
|
||||||
->leftJoin((DB::raw($dBName . ' c2')), DB::raw('c2.parent_category_id'), '=', DB::raw('c1.id'))
|
->leftJoin($dBName . ' as c2', function ($join) {
|
||||||
->leftJoin((DB::raw($dBNamet . ' t1')), DB::raw('c1.id'), '=', DB::raw('t1.entry_id'))
|
$join->on('c2.parent_category_id', '=', 'c1.id')
|
||||||
->leftJoin((DB::raw($dBNamet . ' t2')), DB::raw('c2.id'), '=', DB::raw('t2.entry_id'))
|
->whereNull('c2.deleted_at');
|
||||||
->leftJoin(DB::raw('default_files_files file'), DB::raw('c1.icon_id'), DB::raw('file.id'))
|
})
|
||||||
->where(DB::raw('t1.locale'), Request()->session()->get('_locale', setting_value('streams::default_locale')))
|
->leftJoin($dBNamet . ' as t1', function ($join) use ($dBNamet) {
|
||||||
->where(DB::raw('t2.locale'), Request()->session()->get('_locale', setting_value('streams::default_locale')))
|
$join->on('c1.id', '=', 't1.entry_id')
|
||||||
->where(DB::raw("c1.deleted_at"), NULL)
|
->where('t1.locale', Request()->session()->get('_locale', setting_value('streams::default_locale')));
|
||||||
->where(DB::raw("c2.deleted_at"), NULL)
|
})
|
||||||
->whereNull(DB::raw("c1.parent_category_id"))
|
->leftJoin($dBNamet . ' as t2', function ($join) use ($dBNamet) {
|
||||||
->orderBy(DB::raw("c1.sort_order"))
|
$join->on('c2.id', '=', 't2.entry_id')
|
||||||
->orderBy(DB::raw("c2.sort_order"))
|
->where('t2.locale', Request()->session()->get('_locale', setting_value('streams::default_locale')));
|
||||||
|
})
|
||||||
|
->leftJoin('files_files as file', 'c1.icon_id', 'file.id')
|
||||||
|
->whereNull('c1.deleted_at')
|
||||||
|
->whereNull('c1.parent_category_id')
|
||||||
|
->orderBy('c1.sort_order')
|
||||||
|
->orderBy('c2.sort_order')
|
||||||
->get();
|
->get();
|
||||||
$cats = collect([]);
|
$cats = collect([]);
|
||||||
$cats->subcats = $catsDB;
|
$cats->subcats = $catsDB;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user