Compare commits

...

12 Commits

Author SHA1 Message Date
nimtaurel 026bff1499 nim_style 5 2025-04-23 17:49:24 +05:00
Rustem 660ae6a1bc Доработка апи 2025-04-18 14:07:57 +05:00
Rustem f11b04dde2 Доработка апи 2025-04-18 14:07:39 +05:00
Rustem 6b02c057f1 Доработка апи 2025-04-18 14:05:14 +05:00
Rustem 3a9b1d35a6 Доработка апи 2025-04-18 14:04:43 +05:00
Rustem 33ddc91e79 Доработка апи 2025-04-18 14:01:16 +05:00
Rustem ee0f52a4c7 Доработка апи 2025-03-31 23:51:34 +05:00
Rustem a156e81a8b api 2025-03-27 11:16:56 +05:00
Rustem ab9013c32a Кузовы 2025-03-27 10:40:46 +05:00
Rustem 57eedf2cd4 Кузовы 2025-03-27 10:35:34 +05:00
Rustem 384de527c6 fix api 2025-03-27 10:22:07 +05:00
nimtaurel 13f632fd7b Merge pull request 'nim_style' (#6) from nim_style into master
Reviewed-on: #6
2025-03-26 06:34:17 +00:00
26 changed files with 835 additions and 159 deletions

View File

@ -25,6 +25,7 @@ class PipiCarInstallCommands extends InstallCommand
$this->packages = [
'main', // Главная страница
'auto_brands', // Бренд авто
'auto_bodywork', // Кузов авто
'auto_colors', // Цвета авто
'auto_types', // Типы авто
'auto_equipment', // Комплектация авто

View File

@ -64,7 +64,8 @@ class MobileApiController extends Controller
$data['car_id'] = null;
if ($request->header('Authorization')) {
$user = auth()->guard('api')->user();
$data['user_id'] = $user ? $user->id : null;
$data['user_id'] = $user?->id;
$authToken = $request->header('Authorization');
} else {
$user = UniModel::model('core_users')
->where('email', $data['email'])
@ -85,18 +86,19 @@ class MobileApiController extends Controller
'message' => 'Заявка создана',
];
if ($authToken) {
$car = $this->getAvailableCar($data['started_at'], $data['ended_at'], $data['mark_id']);
if (isEmpty($car)) {
if ($data['user_id']) {
$car = $this->getAvailableCar($data['started_at'], $data['ended_at'], $data['mark_id'], $data['color_code']);
if (!isset($car)) {
return response()->json('Нет свободных машин');
}
$data['car_id'] = $car->id;
$period = CarbonPeriod::create($data['started_at'], $data['ended_at']);
$dates = array_map(fn($date) => $date->toDateString(), iterator_to_array($period));
foreach ($dates as $date) {
UniModel::model('pipi_auto_calendar')->create([
'auto_id' => $car->id,
'auto_id' => $data['car_id'],
'date' => $date,
'status' => AutoStatusEnums::Rent->name
]);
@ -187,6 +189,7 @@ class MobileApiController extends Controller
$started_at = $request->query('started_at');
$ended_at = $request->query('ended_at');
$class = $request->query('class');
$bodywork = $request->query('bodywork');
$marks = UniModel::model('pipi_brand_models')->get();
$availableMarks = [];
@ -195,6 +198,11 @@ class MobileApiController extends Controller
$class_id = UniModel::model('pipi_auto_classes')->where('name', $class)->first()->id;
$marks = $marks->where('class_id', $class_id);
}
if ($bodywork) {
$bodywork_id = UniModel::model('pipi_auto_bodywork')->where('name', $bodywork)->first()->id;
$marks = $marks->where('bodywork_id', $bodywork_id);
}
foreach ($marks as $mark) {
if ($mark->name === 'Ввод остатков') {
continue;
@ -204,40 +212,69 @@ class MobileApiController extends Controller
continue;
}
$cars = UniModel::model('pipi_auto')->where('model_id', $mark->id)->get();
if ($cars->isEmpty()) {
continue;
}
$brand = UniModel::model('pipi_auto_brands')->find($mark->brand_id);
$tariffs = UniModel::model('pipi_auto_tariffs')->where('model_id', $mark->id)->get();
$equipment = UniModel::model('pipi_auto_equipment')->where('id', $mark->equipment_id)->first();
$class = UniModel::model('pipi_auto_classes')->find($mark->class_id);
$bodywork = UniModel::model('pipi_auto_bodywork')->find($mark->bodywork_id);
$photo = UniModel::model('core_files')->find($mark?->photo_id);
$path = null;
if ($mark?->photo_id) {
$path = lurl('/download/'.$mark?->photo_id);
if ($photo) {
$path = url('api/files/file/' . ltrim($photo->path, '/'));
}
$tariffs_new = [];
foreach ($tariffs as $tariff) {
$tariffs_new[] = [
'name' => $tariff?->name,
'price' => $tariff?->base_rate,
'min' => $tariff?->day_range_start,
'max' => $tariff?->day_range_end,
'name' => $tariff?->name,
'price' => $tariff?->base_rate,
'min' => $tariff?->day_range_start,
'max' => $tariff?->day_range_end,
'deposit' => $tariff?->deposit,
];
}
$carsByColor = $cars->groupBy('color_id');
$availableMarks[$mark->name . '-' . $mark->year] = [
'id' => $mark->id,
'brand' => $brand?->name,
'mark' => $mark->name,
'year' => $mark->year,
'configuration' => $equipment?->name,
'people' => $mark?->people ?? 5,
'actuator' => $mark?->actuator ?? 'Передний',
'fuel_type' => $mark?->fuel_type ?? 'АКПП',
'hp' => $mark?->hp ?? '1.6',
'engine_capacity' => $mark?->engine_capacity ?? 1591,
'fuel_tank' => $mark?->fuel_tank ?? 50,
'conditioner' => $mark?->conditioner,
'photo' => $path,
'tariffs' => $tariffs_new
];
foreach ($carsByColor as $carColor => $carsOfColor) {
$carColor = UniModel::model('pipi_auto_colors')->find($carColor)->code;
$colorPath = $path;
if ($carsOfColor->first()->photo_id) {
$photo = UniModel::model('core_files')->find($carsOfColor->first()->photo_id);
$colorPath = url('api/files/file/' . ltrim($photo->path, '/'));
}
$key = $mark->name . '-' . $mark->year . '-' . $carColor;
$availableMarks[$key] = [
'id' => $mark->id,
'brand' => $brand?->name,
'mark' => $mark->name,
'year' => $mark->year,
'color' => $carColor,
'configuration' => $equipment?->name,
'people' => $mark?->people ?? '5',
'actuator' => $mark?->actuator ?? 'Передний',
'fuel_type' => $mark?->fuel_type ?? 'АКПП',
'hp' => $mark?->hp ?? '1.6',
'engine_capacity' => $mark?->engine_capacity ?? '1591',
'fuel_tank' => $mark?->fuel_tank ?? '50',
'class' => $class->name ?? 'Эконом',
'bodywork' => $bodywork->name ?? 'Седан',
'deposit' => $tariffs_new[0]['deposit'] ?? 30000,
'conditioner' => $mark?->conditioner,
'photo' => $colorPath,
'tariffs' => $tariffs_new,
];
}
}
if (empty($availableMarks)) {
@ -246,11 +283,15 @@ class MobileApiController extends Controller
return response()->json($availableMarks);
}
public function getAvailableCar($started_at, $ended_at, $modelId)
public function getAvailableCar($started_at, $ended_at, $modelId, $color)
{
$started_at = Carbon::parse($started_at)->format('Y-m-d');
$ended_at = Carbon::parse($ended_at)->format('Y-m-d');
$cars = UniModel::model('pipi_auto')->where('model_id', $modelId)->get();
$color = UniModel::model('pipi_auto_colors')->where('code', $color)->first()->id;
$cars = UniModel::model('pipi_auto')
->where('color_id', $color)
->where('model_id', $modelId)
->get();
$busyCars = UniModel::model('pipi_auto_calendar')
->whereBetween('date', [$started_at, $ended_at])
->pluck('auto_id')
@ -261,7 +302,58 @@ class MobileApiController extends Controller
if ($availableCars->isNotEmpty()) {
return $availableCars->first();
} else {
return (object) [];
return null;
}
}
public function getSum(Request $request)
{
$started_at = $request->input('started_at');
$ended_at = $request->input('ended_at');
$mark_id = $request->input('mark_id');
$start = Carbon::createFromFormat('d-m-Y H:i', $started_at);
$end = Carbon::createFromFormat('d-m-Y H:i', $ended_at);
$days = $start->diffInDays($end);
// Получаем тарифы
$tariffs = UniModel::model('pipi_auto_tariffs')
->where('model_id', $mark_id)
->get();
if (!isset($tariffs)) {
return response()->json(__('Отсутсвуют данные по машине'));
}
$discountRate = null;
$basePrice = null;
foreach ($tariffs as $range) {
if ($range->day_range_start == 1 && $range->day_range_end == 2) {
$basePrice = $range->base_rate;
}
if ($days >= $range->day_range_start && $days <= $range->day_range_end) {
$discountRate = $range->base_rate;
}
}
// Если не нашли подходящий тариф, но дней больше 30 — применяем скидку
if (is_null($discountRate) && $days > 30 && count($tariffs) > 0) {
$discountRate = round($tariffs[0]->base_rate * 0.6);
}
// Считаем суммы
$baseSum = $basePrice ? $basePrice * $days : null;
$discountedSum = $discountRate ? $discountRate * $days : null;
return response()->json([
'days' => $days,
'base_price_per_day' => $basePrice,
'discount_price_per_day' => $discountRate,
'base_sum' => $baseSum,
'discounted_sum' => $discountedSum,
]);
}
}

201
composer.lock generated
View File

@ -8,17 +8,17 @@
"packages": [
{
"name": "a7kz/platform",
"version": "1.3.224",
"version": "1.3.248",
"source": {
"type": "git",
"url": "ssh://git@git.a7.kz:22022/A7/package.platform.git",
"reference": "6568799d86f1f817e26169c91d0b03136ecd8a79"
"reference": "e1e9d3fbca67aaa95287a70881a74641ba7890bf"
},
"dist": {
"type": "tar",
"url": "https://packagist.a7.kz/dist/a7kz/platform/a7kz-platform-1.3.224-015abb.tar",
"reference": "6568799d86f1f817e26169c91d0b03136ecd8a79",
"shasum": "e245549e24305e73fa8552df633c84ba62e8cf39"
"url": "https://packagist.a7.kz/dist/a7kz/platform/a7kz-platform-1.3.248-27290c.tar",
"reference": "e1e9d3fbca67aaa95287a70881a74641ba7890bf",
"shasum": "6a5b643f024048a65105d1c1eb7f5cff48919143"
},
"require": {
"doctrine/dbal": "^3.5",
@ -47,7 +47,7 @@
}
],
"description": "LowCode platform",
"time": "2025-03-14T13:36:53+00:00"
"time": "2025-04-20T18:53:48+00:00"
},
{
"name": "brick/math",
@ -538,26 +538,29 @@
},
{
"name": "doctrine/deprecations",
"version": "1.1.4",
"version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
@ -577,9 +580,9 @@
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
"source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
"time": "2024-12-07T21:18:45+00:00"
"time": "2025-04-07T20:06:18+00:00"
},
{
"name": "doctrine/event-manager",
@ -969,16 +972,16 @@
},
{
"name": "egulias/email-validator",
"version": "4.0.3",
"version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
"reference": "b115554301161fa21467629f1e1391c1936de517"
"reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b115554301161fa21467629f1e1391c1936de517",
"reference": "b115554301161fa21467629f1e1391c1936de517",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa",
"reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa",
"shasum": ""
},
"require": {
@ -1024,7 +1027,7 @@
],
"support": {
"issues": "https://github.com/egulias/EmailValidator/issues",
"source": "https://github.com/egulias/EmailValidator/tree/4.0.3"
"source": "https://github.com/egulias/EmailValidator/tree/4.0.4"
},
"funding": [
{
@ -1032,7 +1035,7 @@
"type": "github"
}
],
"time": "2024-12-27T00:36:43+00:00"
"time": "2025-03-06T22:45:56+00:00"
},
{
"name": "ezyang/htmlpurifier",
@ -1230,16 +1233,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.9.2",
"version": "7.9.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "d281ed313b989f213357e3be1a179f02196ac99b"
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b",
"reference": "d281ed313b989f213357e3be1a179f02196ac99b",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"shasum": ""
},
"require": {
@ -1336,7 +1339,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.9.2"
"source": "https://github.com/guzzle/guzzle/tree/7.9.3"
},
"funding": [
{
@ -1352,20 +1355,20 @@
"type": "tidelift"
}
],
"time": "2024-07-24T11:22:20+00:00"
"time": "2025-03-27T13:37:11+00:00"
},
{
"name": "guzzlehttp/promises",
"version": "2.0.4",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455"
"reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455",
"url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c",
"reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c",
"shasum": ""
},
"require": {
@ -1419,7 +1422,7 @@
],
"support": {
"issues": "https://github.com/guzzle/promises/issues",
"source": "https://github.com/guzzle/promises/tree/2.0.4"
"source": "https://github.com/guzzle/promises/tree/2.2.0"
},
"funding": [
{
@ -1435,20 +1438,20 @@
"type": "tidelift"
}
],
"time": "2024-10-17T10:06:22+00:00"
"time": "2025-03-27T13:27:01+00:00"
},
{
"name": "guzzlehttp/psr7",
"version": "2.7.0",
"version": "2.7.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201"
"reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"shasum": ""
},
"require": {
@ -1535,7 +1538,7 @@
],
"support": {
"issues": "https://github.com/guzzle/psr7/issues",
"source": "https://github.com/guzzle/psr7/tree/2.7.0"
"source": "https://github.com/guzzle/psr7/tree/2.7.1"
},
"funding": [
{
@ -1551,7 +1554,7 @@
"type": "tidelift"
}
],
"time": "2024-07-18T11:15:46+00:00"
"time": "2025-03-27T12:30:47+00:00"
},
{
"name": "guzzlehttp/uri-template",
@ -2162,16 +2165,16 @@
},
{
"name": "league/commonmark",
"version": "2.6.1",
"version": "2.6.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "d990688c91cedfb69753ffc2512727ec646df2ad"
"reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d990688c91cedfb69753ffc2512727ec646df2ad",
"reference": "d990688c91cedfb69753ffc2512727ec646df2ad",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/06c3b0bf2540338094575612f4a1778d0d2d5e94",
"reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94",
"shasum": ""
},
"require": {
@ -2265,7 +2268,7 @@
"type": "tidelift"
}
],
"time": "2024-12-29T14:10:59+00:00"
"time": "2025-04-18T21:09:27+00:00"
},
{
"name": "league/config",
@ -2790,16 +2793,16 @@
},
{
"name": "monolog/monolog",
"version": "3.8.1",
"version": "3.9.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4"
"reference": "10d85740180ecba7896c87e06a166e0c95a0e3b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/aef6ee73a77a66e404dd6540934a9ef1b3c855b4",
"reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/10d85740180ecba7896c87e06a166e0c95a0e3b6",
"reference": "10d85740180ecba7896c87e06a166e0c95a0e3b6",
"shasum": ""
},
"require": {
@ -2877,7 +2880,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/3.8.1"
"source": "https://github.com/Seldaek/monolog/tree/3.9.0"
},
"funding": [
{
@ -2889,7 +2892,7 @@
"type": "tidelift"
}
],
"time": "2024-12-05T17:15:07+00:00"
"time": "2025-03-24T10:02:05+00:00"
},
{
"name": "mpdf/mpdf",
@ -3295,16 +3298,16 @@
},
{
"name": "nette/utils",
"version": "v4.0.5",
"version": "v4.0.6",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96"
"reference": "ce708655043c7050eb050df361c5e313cf708309"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96",
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96",
"url": "https://api.github.com/repos/nette/utils/zipball/ce708655043c7050eb050df361c5e313cf708309",
"reference": "ce708655043c7050eb050df361c5e313cf708309",
"shasum": ""
},
"require": {
@ -3375,9 +3378,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v4.0.5"
"source": "https://github.com/nette/utils/tree/v4.0.6"
},
"time": "2024-08-07T15:39:19+00:00"
"time": "2025-03-30T21:06:30+00:00"
},
{
"name": "nikic/php-parser",
@ -4590,16 +4593,16 @@
},
{
"name": "ramsey/collection",
"version": "2.1.0",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/ramsey/collection.git",
"reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109"
"reference": "344572933ad0181accbf4ba763e85a0306a8c5e2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/collection/zipball/3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109",
"reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109",
"url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2",
"reference": "344572933ad0181accbf4ba763e85a0306a8c5e2",
"shasum": ""
},
"require": {
@ -4660,9 +4663,9 @@
],
"support": {
"issues": "https://github.com/ramsey/collection/issues",
"source": "https://github.com/ramsey/collection/tree/2.1.0"
"source": "https://github.com/ramsey/collection/tree/2.1.1"
},
"time": "2025-03-02T04:48:29+00:00"
"time": "2025-03-22T05:38:12+00:00"
},
{
"name": "ramsey/uuid",
@ -4758,16 +4761,16 @@
},
{
"name": "sabberworm/php-css-parser",
"version": "v8.7.0",
"version": "v8.8.0",
"source": {
"type": "git",
"url": "https://github.com/MyIntervals/PHP-CSS-Parser.git",
"reference": "f414ff953002a9b18e3a116f5e462c56f21237cf"
"reference": "3de493bdddfd1f051249af725c7e0d2c38fed740"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/f414ff953002a9b18e3a116f5e462c56f21237cf",
"reference": "f414ff953002a9b18e3a116f5e462c56f21237cf",
"url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/3de493bdddfd1f051249af725c7e0d2c38fed740",
"reference": "3de493bdddfd1f051249af725c7e0d2c38fed740",
"shasum": ""
},
"require": {
@ -4775,7 +4778,7 @@
"php": "^5.6.20 || ^7.0.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
},
"require-dev": {
"phpunit/phpunit": "5.7.27 || 6.5.14 || 7.5.20 || 8.5.40"
"phpunit/phpunit": "5.7.27 || 6.5.14 || 7.5.20 || 8.5.41"
},
"suggest": {
"ext-mbstring": "for parsing UTF-8 CSS"
@ -4817,9 +4820,9 @@
],
"support": {
"issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues",
"source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.7.0"
"source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.8.0"
},
"time": "2024-10-27T17:38:32+00:00"
"time": "2025-03-23T17:59:05+00:00"
},
{
"name": "setasign/fpdi",
@ -4895,16 +4898,16 @@
},
{
"name": "symfony/console",
"version": "v6.4.17",
"version": "v6.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04"
"reference": "2e4af9c952617cc3f9559ff706aee420a8464c36"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04",
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04",
"url": "https://api.github.com/repos/symfony/console/zipball/2e4af9c952617cc3f9559ff706aee420a8464c36",
"reference": "2e4af9c952617cc3f9559ff706aee420a8464c36",
"shasum": ""
},
"require": {
@ -4969,7 +4972,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v6.4.17"
"source": "https://github.com/symfony/console/tree/v6.4.20"
},
"funding": [
{
@ -4985,7 +4988,7 @@
"type": "tidelift"
}
],
"time": "2024-12-07T12:07:30+00:00"
"time": "2025-03-03T17:16:38+00:00"
},
{
"name": "symfony/css-selector",
@ -5121,16 +5124,16 @@
},
{
"name": "symfony/error-handler",
"version": "v6.4.19",
"version": "v6.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
"reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71"
"reference": "aa3bcf4f7674719df078e61cc8062e5b7f752031"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/3d4e55cd2b8f1979a65eba9ab749d6466c316f71",
"reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/aa3bcf4f7674719df078e61cc8062e5b7f752031",
"reference": "aa3bcf4f7674719df078e61cc8062e5b7f752031",
"shasum": ""
},
"require": {
@ -5176,7 +5179,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/error-handler/tree/v6.4.19"
"source": "https://github.com/symfony/error-handler/tree/v6.4.20"
},
"funding": [
{
@ -5192,7 +5195,7 @@
"type": "tidelift"
}
],
"time": "2025-02-02T20:16:33+00:00"
"time": "2025-03-01T13:00:38+00:00"
},
{
"name": "symfony/event-dispatcher",
@ -5493,16 +5496,16 @@
},
{
"name": "symfony/http-kernel",
"version": "v6.4.19",
"version": "v6.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c"
"reference": "6be6db31bc74693ce5516e1fd5e5ff1171005e37"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/88f2c9f7feff86bb7b9105c5151bc2c1404cd64c",
"reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/6be6db31bc74693ce5516e1fd5e5ff1171005e37",
"reference": "6be6db31bc74693ce5516e1fd5e5ff1171005e37",
"shasum": ""
},
"require": {
@ -5587,7 +5590,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v6.4.19"
"source": "https://github.com/symfony/http-kernel/tree/v6.4.20"
},
"funding": [
{
@ -5603,7 +5606,7 @@
"type": "tidelift"
}
],
"time": "2025-02-26T10:51:37+00:00"
"time": "2025-03-28T13:27:10+00:00"
},
{
"name": "symfony/mailer",
@ -6408,16 +6411,16 @@
},
{
"name": "symfony/process",
"version": "v6.4.19",
"version": "v6.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3"
"reference": "e2a61c16af36c9a07e5c9906498b73e091949a20"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3",
"reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3",
"url": "https://api.github.com/repos/symfony/process/zipball/e2a61c16af36c9a07e5c9906498b73e091949a20",
"reference": "e2a61c16af36c9a07e5c9906498b73e091949a20",
"shasum": ""
},
"require": {
@ -6449,7 +6452,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v6.4.19"
"source": "https://github.com/symfony/process/tree/v6.4.20"
},
"funding": [
{
@ -6465,7 +6468,7 @@
"type": "tidelift"
}
],
"time": "2025-02-04T13:35:48+00:00"
"time": "2025-03-10T17:11:00+00:00"
},
{
"name": "symfony/routing",
@ -9655,16 +9658,16 @@
},
{
"name": "symfony/yaml",
"version": "v6.4.18",
"version": "v6.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5"
"reference": "28ee818fce4a73ac1474346b94e4b966f665c53f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5",
"reference": "bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5",
"url": "https://api.github.com/repos/symfony/yaml/zipball/28ee818fce4a73ac1474346b94e4b966f665c53f",
"reference": "28ee818fce4a73ac1474346b94e4b966f665c53f",
"shasum": ""
},
"require": {
@ -9707,7 +9710,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v6.4.18"
"source": "https://github.com/symfony/yaml/tree/v6.4.20"
},
"funding": [
{
@ -9723,7 +9726,7 @@
"type": "tidelift"
}
],
"time": "2025-01-07T09:44:41+00:00"
"time": "2025-02-27T20:15:30+00:00"
},
{
"name": "theseer/tokenizer",

View File

@ -149,6 +149,10 @@
"type": "timestamp",
"nullable": true,
"comment": "Дата удаления"
},
"photo_id": {
"type": "int",
"validation": "nullable|int"
}
}
},
@ -300,6 +304,14 @@
"name": "owner_id",
"label": "Владелец"
}
},
{
"size": 12,
"input": {
"name": "photo_id",
"label": "Фото",
"type": "file"
}
}
]
}
@ -384,6 +396,14 @@
"name": "owner_id",
"label": "Владелец"
}
},
{
"size": 12,
"input": {
"name": "photo_id",
"label": "Фото",
"type": "file"
}
}
]
}

View File

@ -139,6 +139,12 @@ return new class extends \A7kz\Platform\Commands\InstallScript {
$table->string('guid')->unique()->nullable();
});
}
if (!Schema::connection($segment->connector)->hasColumn('pipi_auto', 'photo_id')) {
Schema::connection($segment->connector)->table('pipi_auto', static function (Blueprint $table) {
$table->unsignedBigInteger('photo_id')->nullable();
});
}
}
}

View File

@ -0,0 +1,9 @@
{
"admin": [
"default",
"add",
"show",
"edit",
"delete"
]
}

View File

@ -0,0 +1,102 @@
{
"module": "pipicar",
"name": "pipicar.auto_bodywork",
"type": "crud",
"title": "Классы автомобилей",
"withHeader": false,
"data": {
"table": "pipi_auto_bodywork",
"pk": "id",
"limit": 25,
"segment": true,
"timestamp": false,
"fields": {
"id": {
"type": "pk"
},
"name": {
"type": "string"
}
}
},
"ui": {
"grid": {
"title": "Кузовы автомобилей",
"component": "App.components.Grid",
"cols": [
{
"name": "name",
"caption": "Название кузова"
}
],
"action": {
"head": [],
"row": [
"edit",
"delete"
]
},
"filter": {
"template": "app.base.crud.filter",
"rows": [
{
"cols": [
{
"size": 6,
"input": {
"name": "name",
"label": "Название кузова"
}
}
]
}
]
}
},
"forms": {
"add": {
"title": "Добавление кузова",
"template": "app.base.crud.form",
"component": "App.components.Show",
"form": {
"submits": "struct:crud.form.edit.submits",
"rows": [
{
"cols": [
{
"size": 12,
"input": {
"name": "name",
"label": "Название кузова"
}
}
]
}
]
}
},
"edit": {
"title": "Редактирование кузова",
"template": "app.base.crud.form",
"component": "App.components.Show",
"form": {
"rows": [
{
"cols": [
{
"size": 12,
"input": {
"name": "name",
"label": "Название кузова"
}
}
]
}
],
"submits": "struct:crud.form.edit.submits"
}
}
}
},
"actions": "struct:crud.actions"
}

View File

@ -0,0 +1,23 @@
<?php
use A7kz\Platform\Modules\Platform\Segment\Facades\Segment;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
$segments = Segment::listActive();
foreach ($segments as $segment) {
Schema::connection($segment->connector)->create('pipi_auto_bodywork', static function (Blueprint $table) {
$table->id();
$table->string('name')->nullable()->comment('Наименование');
$table->timestamps();
$table->softDeletes();
});
}
}
};

View File

@ -0,0 +1,38 @@
<?php
use A7kz\Platform\Models\UniModel;
use A7kz\Platform\Modules\Platform\Core\Facades\Core;
use A7kz\Platform\Modules\Platform\Segment\Facades\Segment;
use Carbon\Carbon;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Storage;
use \A7kz\Platform\Commands\InstallScript;
return new class extends \A7kz\Platform\Commands\InstallScript {
public function install($module_name, $module_version)
{
}
public function update($module_name, $module_version): void
{
$this->upgrade();
}
private function upgrade(): void
{
$segments = Segment::listActive();
foreach ($segments as $segment) {
if (!Schema::connection($segment->connector)->hasTable('pipi_auto_bodywork')) {
Schema::connection($segment->connector)->create('pipi_auto_bodywork', static function (Blueprint $table) {
$table->id();
$table->string('name')->nullable()->comment('Наименование');
$table->timestamps();
$table->softDeletes();
});
}
}
}
};

View File

@ -16,6 +16,9 @@
},
"name": {
"type": "string"
},
"code": {
"type": "string"
}
}
},
@ -27,6 +30,10 @@
{
"name": "name",
"caption": "Название цвета"
},
{
"name": "code",
"caption": "Код"
}
],
"action": {
@ -49,6 +56,13 @@
"name": "name",
"label": "Название цвета"
}
},
{
"size": 6,
"input": {
"name": "code",
"label": "Код"
}
}
]
}
@ -66,11 +80,18 @@
{
"cols": [
{
"size": 12,
"size": 6,
"input": {
"name": "name",
"label": "Название"
}
},
{
"size": 6,
"input": {
"name": "code",
"label": "Код"
}
}
]
}
@ -86,11 +107,18 @@
{
"cols": [
{
"size": 12,
"size": 6,
"input": {
"name": "name",
"label": "Название"
}
},
{
"size": 6,
"input": {
"name": "code",
"label": "Код"
}
}
]
}

View File

@ -33,6 +33,12 @@ return new class extends \A7kz\Platform\Commands\InstallScript {
$table->softDeletes();
});
}
if (!Schema::connection($segment->connector)->hasColumn('pipi_auto_colors', 'code')) {
Schema::connection($segment->connector)->table('pipi_auto_colors', static function (Blueprint $table) {
$table->string('code')->nullable();
});
}
}
}
};

View File

@ -1,11 +1,11 @@
{
"module": "pipicar",
"name": "pipicar.auto_colors",
"name": "pipicar.auto_tariffs",
"type": "crud",
"title": "Цвета Автомобилей",
"withHeader": false,
"data": {
"table": "pipi_auto_colors",
"table": "pipi_auto_tariffs",
"pk": "id",
"limit": 25,
"segment": true,

View File

@ -63,6 +63,24 @@
],
"validation": "nullable|integer"
},
"class_id": {
"type": "foreign",
"table": "pipi_auto_classes",
"foreign": "id",
"display": [
"name"
],
"validation": "nullable|integer"
},
"bodywork_id": {
"type": "foreign",
"table": "pipi_auto_bodywork",
"foreign": "id",
"display": [
"name"
],
"validation": "nullable|integer"
},
"pipi_tariffs": {
"type": "subcrud",
"module": "pipicar",
@ -313,6 +331,22 @@
"label": "Год"
}
},
{
"size": 4,
"input": {
"name": "bodywork_id",
"label": "Кузов",
"readonly": true
}
},
{
"size": 4,
"input": {
"name": "class_id",
"label": "Класс",
"readonly": true
}
},
{
"size": 4,
"input": {
@ -411,6 +445,22 @@
"label": "Год"
}
},
{
"size": 4,
"input": {
"name": "bodywork_id",
"label": "Кузов",
"readonly": true
}
},
{
"size": 4,
"input": {
"name": "class_id",
"label": "Класс",
"readonly": true
}
},
{
"size": 4,
"input": {

View File

@ -67,6 +67,11 @@ return new class extends \A7kz\Platform\Commands\InstallScript {
$table->unsignedBigInteger('photo_id')->nullable()->comment('Фото');
});
}
if (!Schema::connection($segment->connector)->hasColumn('pipi_brand_models', 'bodywork_id')) {
Schema::connection($segment->connector)->table('pipi_brand_models', function ($table) {
$table->unsignedBigInteger('bodywork_id')->nullable()->comment('Кузов');
});
}
}
}
};

View File

@ -10,6 +10,9 @@
namespace App\Modules\main\Components;
use A7kz\Platform\Modules\Platform\Core\Services\Base\Component;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Http;
class Main extends Component
{
@ -17,5 +20,19 @@ class Main extends Component
{
parent::__construct($params, $module);
$this->template = 'pipicar::main.views.main';
// $request = new Request([
// 'started_at' => Carbon::now()->toDateString(),
// 'ended_at' => Carbon::now()->addDays(3)->toDateString(),
// ]);
//
// $response = (new \App\Http\Controllers\MobileApiController)->getAvailableMarksList($request);
// $this->params['cars'] = $response->getData(true);
$response = Http::get('https://cvm10.a7.kz/api/mobile/getAvailableMarksList', [
'started_at' => Carbon::now()->toDateString(),
'ended_at' => Carbon::now()->addDays(3)->toDateString(),
]);
$this->params['cars'] = collect($response->json());
}
}

View File

@ -1,2 +1,104 @@
@section('content')
@endsection
<div class="container text-center my-3 main-page">
<p class="top-title">Доступные автомобили</p>
<p class="title with-line line-center">Выберите лучший автомобиль</p>
<p class="subtitle">У нас есть автомобили разных классов. Выберите свой идеальный вариант и забронируйте его.</p>
<div class="row mx-auto my-auto">
<div id="recipeCarousel" class="carousel slide w-100" data-bs-ride="carousel">
<div class="carousel-inner w-100" role="listbox">
@php $carsValues = array_values($cars->toArray()); @endphp
@for($i = 0; $i < count($carsValues); $i++)
@if($i % 1 == 0)
<div class="carousel-item {{ $i == 0 ? 'active' : '' }}">
<div class="row">
@for($j = $i; $j < $i + 3 && $j < count($carsValues); $j++)
@php $car = $carsValues[$j]; @endphp
<div class="col-md-4">
<div class="car-card">
<img class="img-fluid" src="{{ $car['photo'] }}" alt="Car Image">
<div class="title">{{ $car['brand'] . ' ' . $car['mark'] . ' - ' . $car['year'] }}</div>
<div class="card-car-chars">
<div class="add-li"><i class="material-symbols-outlined"></i> Кондиционер</div>
<div class="add-li"><i class="material-symbols-outlined"></i> {{ $car['fuel_type'] }}</div>
<div class="add-li"><i class="material-symbols-outlined"></i>{{ $car['people'] }}</div>
</div>
<div class="car-card-footer">
<div class="cost">
<small>Базовая ставка</small>
<p>{{ $car['tariffs'][0]['price'] ?? ''}}</p>
</div>
<a href="#" class="btn btn-primary">Арендовать</a>
</div>
</div>
</div>
@endfor
</div>
</div>
@endif
@endfor
</div>
<a class="carousel-control-prev" href="#recipeCarousel" role="button" data-bs-slide="prev">
<span class="icon-container rounded-circle d-flex align-items-center justify-content-center">
<i class="bi bi-chevron-left"></i>
</span>
</a>
<a class="carousel-control-next" href="#recipeCarousel" role="button" data-bs-slide="next">
<span class="icon-container rounded-circle d-flex align-items-center justify-content-center">
<i class="bi bi-chevron-right"></i>
</span>
</a>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const carousel = new bootstrap.Carousel(document.querySelector('#recipeCarousel'), {
interval: 10000,
ride: 'carousel',
wrap: true
});
});
</script>
<style>
.carousel-control-prev,
.carousel-control-next {
width: 40px;
height: 40px;
background: white;
border-radius: 50%;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
border: 1px solid #ddd;
opacity: 1;
position: absolute;
top: 50%;
transform: translateY(-50%);
z-index: 10;
}
.carousel-control-prev {
left: -20px;
}
.carousel-control-next {
right: -20px;
}
.icon-container {
width: 100%;
height: 100%;
color: black; /* Цвет иконки */
font-size: 1.2rem;
}
/* Hover эффект */
.carousel-control-prev:hover,
.carousel-control-next:hover {
background: #f8f9fa;
}
.bi::before, [class^=bi-]::before, [class*=" bi-"]::before {
vertical-align: -0.2em;
}
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -34,3 +34,6 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
import $ from 'jquery';
window.$ = window.jQuery = $;
require('select2');
import * as bootstrap from 'bootstrap';
window.bootstrap = bootstrap;

View File

@ -35,16 +35,15 @@ body {
}
.main-container {
margin-left: 50px;
margin-top: 50px;
margin: 50px;
padding: 20px;
}
.menu-open{
.main-container{
margin-left: 250px;
}
}
//.menu-open{
// .main-container{
// margin-left: 250px;
// }
//}
.global-line{
margin: 0 0 10px 0;
@ -263,3 +262,54 @@ body {
.fkey{
background-color: white !important;
}
.main-page {
padding: 20px;
.top-title {
margin: 0;
line-height: 1;
text-transform: uppercase;
font-size: 12px;
color: #a8a8a8;
font-weight: 600;
}
.title {
font-weight: 800;
font-size: 36px;
margin-bottom: 40px;
text-transform: uppercase;
position: relative;
}
.subtitle {
font-size: 20px;
color: #5d5d5d;
margin: 0 0 50px 0;
}
.with-line.line-center:before {
left: 50%;
transform: translate(-50%);
}
.with-line:before {
content: "";
position: absolute;
bottom: -20px;
width: 45px;
height: 4px;
background-color: #01b0e8;
}
.carousel-control-prev-icon, .carousel-control-next-icon {
width: 3.125rem;
height: 3.125rem;
}
.carousel-control-next-icon {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='black'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.carousel-control-prev-icon {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='black'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}
}

View File

@ -52,3 +52,62 @@ iframe {
.table-container.subcrud-table {
box-shadow: none;
}
.carousel-inner {
overflow: hidden;
.carousel-item {
transition: transform 0.6s ease-in-out;
.row {
display: flex;
flex-wrap: nowrap;
justify-content: center;
margin-bottom: 35px;
.car-card {
margin: 0 10px;
min-width: calc(33.333% - 20px);
transition: .3s all ease;
padding: 25px 20px;
border-radius: 8px;
border-bottom: 2px solid transparent;
box-shadow: #0000001a 0 4px 6px -1px, #0000000f 0 2px 4px -1px;
img {
width: 100%;
height: 240px;
object-fit: contain;
}
.title {
font-size: 24px;
font-weight: 700;
margin-bottom: 20px;
}
.add-li {
display: flex;
align-content: center;
color: #a8a8a8;
margin-bottom: 5px;
font-size: 16px;
transition: .2s all ease;
}
.car-card-footer {
display: flex;
align-items: flex-end;
justify-content: space-between;
border-top: 1px solid #ddd;
padding-top: 10px;
margin-top: 10px;
}
}
.car-card:hover {
box-shadow: #0000001a 0 20px 25px -5px, #0000000a 0 10px 10px -5px;
border-bottom: 2px solid #01B0E8;
}
}
}
}

View File

@ -16,7 +16,7 @@
align-items: center;
justify-content: space-between;
padding: 0;
margin: 0 1rem;
margin: 0 auto;
.left-cont {
display: flex !important;
justify-content: center;
@ -123,6 +123,21 @@
}
}
}
.center-cont {
.dropdown {
border: none;
.dropdown-toggle::after {
vertical-align: middle;
}
& > a {
display: inline-block;
color: $primary-color;
font-size: 1.125rem;
font-weight: 500;
text-decoration: none;
}
}
}
.right-cont {
display: flex !important;
justify-content: center;
@ -143,7 +158,7 @@
}
@media screen and (max-width: 1400px) {
.navbar .container .left-cont .navbar-brand img {
.navbar .nav-container .left-cont .navbar-brand img {
width: 140px;
}
}
@ -157,7 +172,19 @@
font-size: 14px;
}
.navbar .container .left-cont .navbar-brand img{
.navbar .nav-container .left-cont .navbar-brand img{
width: 120px;
}
}
@media (min-width: 992px) {
.navbar .nav-container {
max-width: 960px;
}
}
@media (min-width: 1400px) {
.navbar .nav-container{
max-width: 1320px;
}
}

View File

@ -1,3 +1,7 @@
<?php
$nav = \A7kz\Platform\Modules\Platform\Navigation\Facades\Nav::config();
?>
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
@ -29,18 +33,11 @@
<div id="web_content">
<div id="app"
@if(isset($_COOKIE['a7platform_open_window']) && $_COOKIE['a7platform_open_window']) class="menu-open" @endif>
@auth
@include('platform.navigation::sidebar')
@endauth
<main class="main-container">
<header class="navbar">
<div class="nav-container py-1">
<div class="left-cont d-flex">
@auth
<i class="bi bi-list menu-trigger"></i>
@endauth
<a class="navbar-brand">
<a class="navbar-brand" href="{{ '/' . app()->getLocale() }}">
<img src="{{asset('img/logo.png')}}" alt="logo" class="logo">
</a>
<div class="item-nav lang">
@ -78,7 +75,38 @@
</div>
<a class="header-phone" href="tel:87763504141"><i class="bi bi-telephone-fill"></i> +7 776 350 41 41</a>
</div>
@guest
<div class="center-cont">
@auth
@if (auth()->user()->name === 'admin')
<div class="sidebar-content">
<ul class="list-group">
@php
$autoNav = $nav->{'pipicar-nav-auto'} ?? null;
@endphp
@if($autoNav)
@if(isset($autoNav->childs))
<li class="list-group-item dropdown">
<a class="dropdown-toggle text-decoration-none" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
{{ $autoNav->label }}
</a>
<ul class="dropdown-menu">
@foreach($autoNav->childs as $child)
<li>
<a class="dropdown-item" href="{{ '/' . app()->getLocale() . '/' . ltrim($child->link ?? '#', '/') }}">
{{ $child->label ?? 'Без названия' }}
</a>
</li>
@endforeach
</ul>
</li>
@endif
@endif
</ul>
</div>
@endif
@endauth
</div>
@guest
<div class="right-cont d-flex justify-end align-center">
@if (Route::has('login'))
<a class="item-nav btn btn-primary waves-effect" href="{{ lurl('login') }}">

View File

@ -15,6 +15,7 @@ use Illuminate\Support\Facades\Route;
|
*/
use App\Http\Controllers\Sync1cApiController;
use Illuminate\Support\Facades\Storage;
Route::prefix('1c')->group(function () {
Route::post('syncAutoData', [Sync1cApiController::class, 'syncAutoData']);
@ -29,9 +30,15 @@ Route::prefix('mobile')->group(function () {
Route::post('checkAvailableCar', [MobileApiController::class, 'checkAvailableCar']);
Route::post('sendApplication', [MobileApiController::class, 'sendApplication']);
Route::post('getApplications', [MobileApiController::class, 'getApplications']);
Route::post('getSum', [MobileApiController::class, 'getSum']);
Route::post('login', [MobileApiController::class, 'login']);
});
Route::get('/', function (Request $request) {
dd(123);
});
Route::get('/files/{path}', function ($path) {
return Storage::response($path);
})->where('path', '.*');