Skip to content

Commit

Permalink
Merge pull request #211 from xxl4/develop
Browse files Browse the repository at this point in the history
#210 locales
  • Loading branch information
xxl4 authored May 7, 2024
2 parents 5e36b31 + cd1d90d commit 25704a1
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 367 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
</section>

<!-- jQuery -->
<script src="/themes/manage/AdminLTE/plugins/jquery/jquery.min.js"></script>
Expand Down
Loading

0 comments on commit 25704a1

Please sign in to comment.