diff --git a/packages/TPS/API/Http/Controllers/FilterOptions.php b/packages/TPS/API/Http/Controllers/FilterOptions.php new file mode 100644 index 000000000..bb838f992 --- /dev/null +++ b/packages/TPS/API/Http/Controllers/FilterOptions.php @@ -0,0 +1,89 @@ +getRepositoryInstance() + ->where('attribute_options.attribute_id',$request->get('attribute_id')) + ->whereIn('attribute_options.id',function ($q) { + $q->distinct()->select('integer_value') + ->from('product_attribute_values') + ->whereNotNull('product_attribute_values.integer_value'); + + if(request()->has('category')){ +// $q->join('product_categories','product_attribute_values.product_id','=','product_categories.product_id') +// ->where('product_categories.category_id',request()->get('category')); + $q->whereIn('product_attribute_values.product_id',function ($q) { + $q->select('product_categories.product_id')->from('product_categories') + ->where('product_categories.category_id',request()->get('category')); + }); + } + + if(request()->has('brand')){ + $q->whereIn('product_attribute_values.product_id',function ($q) { + $q->select('products.id')->from('products') + ->where('products.brand_id',request()->get('brand')); + }); + } + + $q->groupBy('integer_value'); + }); + + //Log::info($query->toSql()); + + if($key = $request->get('search')){ + $query->where('admin_name','LIKE', '%'.$key.'%'); + } + + if ($sort = $request->input('sort')) { + $query->orderBy($sort, $request->input('order') ?? 'desc'); + } else { + $query->orderBy('sort_order', 'asc'); + } + +// Log::info($query->toSql()); + if (is_null($request->input('pagination')) || $request->input('pagination')) { + $results = $query->paginate($request->input('limit') ?? 20); + } else { + $results = $query->get(); + } + + return $this->getResourceCollection($results); + } +} \ No newline at end of file diff --git a/packages/TPS/Admin/src/Providers/AdminServiceProvider.php b/packages/TPS/Admin/src/Providers/AdminServiceProvider.php index 182756ff4..01e4792f8 100644 --- a/packages/TPS/Admin/src/Providers/AdminServiceProvider.php +++ b/packages/TPS/Admin/src/Providers/AdminServiceProvider.php @@ -16,12 +16,15 @@ class AdminServiceProvider extends ServiceProvider $this->loadRoutesFrom(__DIR__ . '/../Routes/web.php'); $this->publishes([ - __DIR__ . '/../Resources/views/settings' => resource_path('views/vendor/admin/settings'), +// __DIR__ . '/../Resources/views/settings' => resource_path('views/vendor/admin/settings'), __DIR__ . '/../Resources/views/sales' => resource_path('views/vendor/admin/sales'), - __DIR__ . '/../Resources/views/notifications' => resource_path('views/vendor/admin/notifications'), - __DIR__ . '/../Resources/views/layouts' => resource_path('views/vendor/admin/layouts'), - __DIR__ . '/../Resources/views/dashboard' => resource_path('views/vendor/admin/dashboard'), +// __DIR__ . '/../Resources/views/notifications' => resource_path('views/vendor/admin/notifications'), +// __DIR__ . '/../Resources/views/layouts' => resource_path('views/vendor/admin/layouts'), +// __DIR__ . '/../Resources/views/dashboard' => resource_path('views/vendor/admin/dashboard'), ],'admin'); + + $this->loadViewsFrom(__DIR__ . '/../Resources/views', 'elektronika'); + $this->app->register(EventServiceProvider::class); } /** * Register services. diff --git a/packages/TPS/Admin/src/Providers/EventServiceProvider.php b/packages/TPS/Admin/src/Providers/EventServiceProvider.php new file mode 100644 index 000000000..68ff7f213 --- /dev/null +++ b/packages/TPS/Admin/src/Providers/EventServiceProvider.php @@ -0,0 +1,26 @@ +addTemplate( + 'elektronika::settings.sliders.slider-dop' + ); + } + ); + } +} \ No newline at end of file diff --git a/packages/TPS/Admin/src/Resources/views/dashboard/index.blade.php b/packages/TPS/Admin/src/Resources/views/dashboard/index.blade.php deleted file mode 100644 index ffd0a7780..000000000 --- a/packages/TPS/Admin/src/Resources/views/dashboard/index.blade.php +++ /dev/null @@ -1,541 +0,0 @@ -@extends('admin::layouts.master') - -@section('page_title') - {{ __('admin::app.dashboard.title') }} -@stop - -@section('content-wrapper') - -
- - -
- -
- - - - - -
-
- {{ __('admin::app.dashboard.total-sale') }} -
- -
- {{ core()->formatBasePrice($statistics['total_sales']['current']) }} - - - @if ($statistics['total_sales']['progress'] < 0) - - {{ __('admin::app.dashboard.decreased', [ - 'progress' => -number_format($statistics['total_sales']['progress'], 1) - ]) - }} - @else - - {{ __('admin::app.dashboard.increased', [ - 'progress' => number_format($statistics['total_sales']['progress'], 1) - ]) - }} - @endif - -
-
- -
-
- {{ __('admin::app.dashboard.average-sale') }} -
- -
- {{ core()->formatPrice($statistics['avg_sales']['current'],"TMT") }} - - - @if ($statistics['avg_sales']['progress'] < 0) - - {{ __('admin::app.dashboard.decreased', [ - 'progress' => -number_format($statistics['avg_sales']['progress'], 1) - ]) - }} - @else - - {{ __('admin::app.dashboard.increased', [ - 'progress' => number_format($statistics['avg_sales']['progress'], 1) - ]) - }} - @endif - -
-
- -
-
- {{ __('admin::app.dashboard.total-unpaid-invoices') }} -
- -
- {{ core()->formatPrice($statistics['total_unpaid_invoices'],'TMT') }} -
-
- -
- -
- -
-
-
- {{ __('admin::app.dashboard.sales') }} -
- -
- - - -
-
-
- -
-
-
- {{ __('admin::app.dashboard.top-performing-categories') }} -
- -
- - - @if (! count($statistics['top_selling_categories'])) - -
- - -

{{ __('admin::app.common.no-result-found') }}

- -
- - @endif -
-
-
- -
- -
-
-
- {{ __('admin::app.dashboard.top-selling-products') }} -
- -
- - - @if (! count($statistics['top_selling_products'])) - -
- - -

{{ __('admin::app.common.no-result-found') }}

- -
- - @endif -
-
- -
-
- {{ __('admin::app.dashboard.customer-with-most-sales') }} -
- -
- - - @if (! count($statistics['customer_with_most_sales'])) - -
- - -

{{ __('admin::app.common.no-result-found') }}

- -
- - @endif -
- -
- -
-
- {{ __('admin::app.dashboard.stock-threshold') }} -
- -
- - - @if (! count($statistics['stock_threshold'])) - -
- - -

{{ __('admin::app.common.no-result-found') }}

- -
- - @endif -
- -
-
-
-
- -@stop - -@push('scripts') - - - - - - - - - -@endpush \ No newline at end of file diff --git a/packages/TPS/Admin/src/Resources/views/layouts/nav-top.blade.php b/packages/TPS/Admin/src/Resources/views/layouts/nav-top.blade.php deleted file mode 100644 index 548fce8d1..000000000 --- a/packages/TPS/Admin/src/Resources/views/layouts/nav-top.blade.php +++ /dev/null @@ -1,117 +0,0 @@ -@php - $orderStatusMessages = [ - 'pending' => trans('admin::app.notification.order-status-messages.pending'), - 'canceled'=> trans('admin::app.notification.order-status-messages.canceled'), - 'closed' => trans('admin::app.notification.order-status-messages.closed'), - 'completed'=> trans('admin::app.notification.order-status-messages.completed'), - 'processing' => trans('admin::app.notification.order-status-messages.processing') - ]; - $allLocales = core()->getAllLocales()->pluck('name', 'code'); -@endphp - - \ No newline at end of file diff --git a/packages/TPS/Admin/src/Resources/views/notifications/index.blade.php b/packages/TPS/Admin/src/Resources/views/notifications/index.blade.php deleted file mode 100644 index 02d256cfb..000000000 --- a/packages/TPS/Admin/src/Resources/views/notifications/index.blade.php +++ /dev/null @@ -1,62 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('admin::app.notification.notification-title') }} -@endsection - -@php - $orderStatus = [ - 'all' => trans('admin::app.notification.status.all'), - 'pending' => trans('admin::app.notification.status.pending'), - 'canceled'=> trans('admin::app.notification.status.canceled'), - 'closed' => trans('admin::app.notification.status.closed'), - 'completed'=> trans('admin::app.notification.status.completed'), - 'processing' => trans('admin::app.notification.status.processing') - ]; - - $orderStatusMessages = [ - 'pending' => trans('admin::app.notification.order-status-messages.pending'), - 'canceled'=> trans('admin::app.notification.order-status-messages.canceled'), - 'closed' => trans('admin::app.notification.order-status-messages.closed'), - 'completed'=> trans('admin::app.notification.order-status-messages.completed'), - 'processing' => trans('admin::app.notification.order-status-messages.processing') - ]; -@endphp - -@push('css') - -@endpush - -@section('content') - getCurrentLocale()->code }}> - -@endsection diff --git a/packages/TPS/Admin/src/Resources/views/sales/invoices/index.blade.php b/packages/TPS/Admin/src/Resources/views/sales/invoices/index.blade.php index 8071b568b..32cee8ee5 100644 --- a/packages/TPS/Admin/src/Resources/views/sales/invoices/index.blade.php +++ b/packages/TPS/Admin/src/Resources/views/sales/invoices/index.blade.php @@ -37,5 +37,5 @@ @stop @push('scripts') - @include('admin::export.export', ['gridName' => app('Webkul\Admin\DataGrids\OrderInvoicesDataGrid')]) + @include('admin::export.export', ['gridName' => app('TPS\Admin\DataGrids\OrderInvoicesDataGrid')]) @endpush diff --git a/packages/TPS/Admin/src/Resources/views/settings/sliders/index.blade.php b/packages/TPS/Admin/src/Resources/views/settings/sliders/index.blade.php deleted file mode 100644 index 193f9774d..000000000 --- a/packages/TPS/Admin/src/Resources/views/settings/sliders/index.blade.php +++ /dev/null @@ -1,43 +0,0 @@ -@extends('admin::layouts.content') - -@section('page_title') - {{ __('admin::app.settings.sliders.title') }} -@stop - -@section('content') -
- @php - $locale = core()->getRequestedLocaleCode('locale', false); - - $channel = core()->getRequestedChannelCode(false); - @endphp - - - -
- -
-
-@stop - -@push('scripts') - -@endpush diff --git a/packages/TPS/Admin/src/Resources/views/settings/sliders/slider-dop.blade.php b/packages/TPS/Admin/src/Resources/views/settings/sliders/slider-dop.blade.php new file mode 100644 index 000000000..bad05f5e7 --- /dev/null +++ b/packages/TPS/Admin/src/Resources/views/settings/sliders/slider-dop.blade.php @@ -0,0 +1,22 @@ +
+ + mobile_path) + :images='"{{ Storage::url($slider->mobile_path) }}"'> + @endif + + + @foreach ($errors->get('mobile_image.*') as $key => $message) + @php echo str_replace($key, 'Image', $message[0]); @endphp + @endforeach + +
+
+ + + +
\ No newline at end of file diff --git a/packages/TPS/Shop/src/Database/Migrations/2022_12_06_1_add_mobile_link_to_sliders_table.php b/packages/TPS/Shop/src/Database/Migrations/2022_12_06_1_add_mobile_link_to_sliders_table.php new file mode 100644 index 000000000..394d210dd --- /dev/null +++ b/packages/TPS/Shop/src/Database/Migrations/2022_12_06_1_add_mobile_link_to_sliders_table.php @@ -0,0 +1,30 @@ +string('mobile_link')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropColumn('mobile_link'); + } +}; \ No newline at end of file diff --git a/packages/TPS/Shop/src/Models/Slider.php b/packages/TPS/Shop/src/Models/Slider.php index bc0920116..52c9f308e 100644 --- a/packages/TPS/Shop/src/Models/Slider.php +++ b/packages/TPS/Shop/src/Models/Slider.php @@ -15,7 +15,8 @@ class Slider extends SliderModel 'expired_at', 'sort_order', 'type', - 'mobile_path' + 'mobile_path', + 'mobile_link' ]; /**