diff --git a/addons/default/visiosoft/advs-module/migrations/2018_09_25_211039_visiosoft.module.advs__create_advs_stream.php b/addons/default/visiosoft/advs-module/migrations/2018_09_25_211039_visiosoft.module.advs__create_advs_stream.php index dfb48c899..440a82f92 100644 --- a/addons/default/visiosoft/advs-module/migrations/2018_09_25_211039_visiosoft.module.advs__create_advs_stream.php +++ b/addons/default/visiosoft/advs-module/migrations/2018_09_25_211039_visiosoft.module.advs__create_advs_stream.php @@ -4,6 +4,11 @@ use Anomaly\Streams\Platform\Database\Migration\Migration; class VisiosoftModuleAdvsCreateAdvsStream extends Migration { + public function __construct() + { + \Illuminate\Support\Facades\DB::getDoctrineSchemaManager() + ->getDatabasePlatform()->registerDoctrineTypeMapping('point', 'string'); + } /** * The stream definition. diff --git a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableBuilder.php b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableBuilder.php index 1e4f8df9e..64d123424 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableBuilder.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableBuilder.php @@ -6,13 +6,6 @@ use Visiosoft\AdvsModule\Adv\Table\Views\unfinished; class AdvTableBuilder extends TableBuilder { - - /** - * The table views. - * - * @var array|string - */ - protected $views = [ 'all' => [ '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 = []; - /** - * The table actions. - * - * @var array|string - */ protected $actions = [ 'delete', 'approve' => [ @@ -70,11 +46,6 @@ class AdvTableBuilder extends TableBuilder ], ]; - /** - * The table options. - * - * @var array - */ protected $options = [ 'order_by' => [ 'id' => 'DESC', @@ -82,11 +53,6 @@ class AdvTableBuilder extends TableBuilder 'table_view' => 'visiosoft.module.advs::admin/table/table' ]; - /** - * The table assets. - * - * @var array - */ protected $assets = [ 'scripts.js' => [ 'visiosoft.module.advs::js/admin/advanced.js', @@ -96,5 +62,4 @@ class AdvTableBuilder extends TableBuilder 'visiosoft.module.advs::css/admin/filter-user.css', ], ]; - } diff --git a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableButtons.php b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableButtons.php index d8bd59c4c..11dbe6196 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableButtons.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableButtons.php @@ -42,7 +42,7 @@ class AdvTableButtons 'create_configration' => [ 'text' => trans('visiosoft.module.advs::button.create_configurations'), 'href' => route('visiosoft.module.advs::configrations.create') . "?ad={entry.id}"] - ] + ] ] ]); } diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index 4fb2ccdd5..e53a74b8e 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -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, ''); if (is_module_installed('visiosoft.module.seo')) { diff --git a/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php b/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php index 7ff342133..06c66381b 100644 --- a/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php +++ b/addons/default/visiosoft/cats-module/src/Category/CategoryRepository.php @@ -112,35 +112,39 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn public function getMainAndSubCats() { - $dBName = 'default_cats_category'; + $dBName = 'cats_category'; $dBNamet = $dBName . '_translations'; - $catsDB = DB::table((DB::raw($dBName . ' c1'))) + $catsDB = DB::table($dBName . ' as c1') ->select( - DB::raw('c1.id'), - DB::raw('c1.slug'), - DB::raw('c1.parent_category_id'), - DB::raw('c1.icon_id'), - DB::raw('t1.name'), - - DB::raw('c2.id as c2_id'), - DB::raw('c2.slug as c2_slug'), - DB::raw('c2.parent_category_id as c2_parent_category_id'), - DB::raw('t2.name as c2_name'), - - DB::raw('file.id as file_id') + 'c1.id', + 'c1.slug', + 'c1.parent_category_id', + 'c1.icon_id', + 't1.name', + 'c2.id as c2_id', + 'c2.slug as c2_slug', + 'c2.parent_category_id as c2_parent_category_id', + 't2.name as c2_name', + 'file.id as file_id' ) - ->leftJoin((DB::raw($dBName . ' c2')), DB::raw('c2.parent_category_id'), '=', DB::raw('c1.id')) - ->leftJoin((DB::raw($dBNamet . ' t1')), DB::raw('c1.id'), '=', DB::raw('t1.entry_id')) - ->leftJoin((DB::raw($dBNamet . ' t2')), DB::raw('c2.id'), '=', DB::raw('t2.entry_id')) - ->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'))) - ->where(DB::raw('t2.locale'), Request()->session()->get('_locale', setting_value('streams::default_locale'))) - ->where(DB::raw("c1.deleted_at"), NULL) - ->where(DB::raw("c2.deleted_at"), NULL) - ->whereNull(DB::raw("c1.parent_category_id")) - ->orderBy(DB::raw("c1.sort_order")) - ->orderBy(DB::raw("c2.sort_order")) + ->leftJoin($dBName . ' as c2', function ($join) { + $join->on('c2.parent_category_id', '=', 'c1.id') + ->whereNull('c2.deleted_at'); + }) + ->leftJoin($dBNamet . ' as t1', function ($join) use ($dBNamet) { + $join->on('c1.id', '=', 't1.entry_id') + ->where('t1.locale', Request()->session()->get('_locale', setting_value('streams::default_locale'))); + }) + ->leftJoin($dBNamet . ' as t2', function ($join) use ($dBNamet) { + $join->on('c2.id', '=', 't2.entry_id') + ->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(); $cats = collect([]); $cats->subcats = $catsDB;