From cd1d90d8537ca50b647a1a339da2fd6872a0e898 Mon Sep 17 00:00:00 2001 From: xxl4 Date: Tue, 7 May 2024 13:32:35 +0800 Subject: [PATCH] #210 locales --- .../Controllers/Settings/LocaleController.php | 30 +- .../src/Resources/views/cms/index.blade.php | 2 +- .../views/settings/locales/index.blade.php | 479 +++++------------- 3 files changed, 144 insertions(+), 367 deletions(-) diff --git a/packages/Nicelizhi/Manage/src/Http/Controllers/Settings/LocaleController.php b/packages/Nicelizhi/Manage/src/Http/Controllers/Settings/LocaleController.php index 4a2e40357..3c6c4ccd1 100644 --- a/packages/Nicelizhi/Manage/src/Http/Controllers/Settings/LocaleController.php +++ b/packages/Nicelizhi/Manage/src/Http/Controllers/Settings/LocaleController.php @@ -6,6 +6,7 @@ use Nicelizhi\Manage\Http\Controllers\Controller; use Webkul\Core\Repositories\LocaleRepository; use Nicelizhi\Manage\DataGrids\Settings\LocalesDataGrid; +use Nicelizhi\Manage\Helpers\SSP; class LocaleController extends Controller { @@ -26,7 +27,34 @@ public function __construct(protected LocaleRepository $localeRepository) public function index() { if (request()->ajax()) { - return app(LocalesDataGrid::class)->toJson(); + + $table_pre = config("database.connections.mysql.prefix"); + $table = $table_pre.'locales'; + + $primaryKey = 'id'; + + $columns = array( + //array( 'db' => 'id', 'dt' => 0 ), + array( 'db' => '`p`.`id`', 'dt' => 'id', 'field'=>'id','formatter' => function($d, $row){ + return $d; + } ), + array( 'db' => '`p`.`code`', 'dt' => 'code', 'field'=>'code' ), + array( 'db' => '`p`.`name`', 'dt' => 'name', 'field'=>'name' ), + array( 'db' => '`p`.`direction`', 'dt' => 'direction', 'field'=>'direction' ), + array( 'db' => '`p`.`logo_path`', 'dt' => 'logo_path', 'field'=>'logo_path' ), + array( 'db' => '`p`.`updated_at`', 'dt' => 'updated_at', 'field'=>'updated_at' ) + ); + // SQL server connection information + $sql_details = []; + + $joinQuery = "FROM `{$table}` AS `p` "; + $extraCondition = ""; + //$extraCondition = "`a`.`address_type`='cart_shipping'"; + + + return json_encode(SSP::simple( request()->input(), $sql_details, $table, $primaryKey, $columns, $joinQuery, $extraCondition )); + + //return app(LocalesDataGrid::class)->toJson(); } return view('admin::settings.locales.index'); diff --git a/packages/Nicelizhi/Manage/src/Resources/views/cms/index.blade.php b/packages/Nicelizhi/Manage/src/Resources/views/cms/index.blade.php index b0078b37f..b2f789aaf 100644 --- a/packages/Nicelizhi/Manage/src/Resources/views/cms/index.blade.php +++ b/packages/Nicelizhi/Manage/src/Resources/views/cms/index.blade.php @@ -46,7 +46,7 @@ - + diff --git a/packages/Nicelizhi/Manage/src/Resources/views/settings/locales/index.blade.php b/packages/Nicelizhi/Manage/src/Resources/views/settings/locales/index.blade.php index 4fa222a2d..025a2af73 100644 --- a/packages/Nicelizhi/Manage/src/Resources/views/settings/locales/index.blade.php +++ b/packages/Nicelizhi/Manage/src/Resources/views/settings/locales/index.blade.php @@ -3,371 +3,120 @@ @lang('admin::app.settings.locales.index.title') - {!! view_render_event('bagisto.admin.settings.locales.create.before') !!} - - -
-

- @lang('admin::app.settings.locales.index.title') -

- -
- @if (bouncer()->hasPermission('settings.locales.create')) - - @endif -
-
- - {{-- DataGrid Shimmer --}} - -
- - {!! view_render_event('bagisto.admin.settings.locales.create.after') !!} - - @pushOnce('scripts') - + + + + + + + + + + + + + + + + + + - - - resetForm() { - this.locale = { - image: [], - }; - } - }, - }); - - @endPushOnce - \ No newline at end of file +