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 = [ $this->packages = [
'main', // Главная страница 'main', // Главная страница
'auto_brands', // Бренд авто 'auto_brands', // Бренд авто
'auto_bodywork', // Кузов авто
'auto_colors', // Цвета авто 'auto_colors', // Цвета авто
'auto_types', // Типы авто 'auto_types', // Типы авто
'auto_equipment', // Комплектация авто 'auto_equipment', // Комплектация авто

View File

@ -64,7 +64,8 @@ class MobileApiController extends Controller
$data['car_id'] = null; $data['car_id'] = null;
if ($request->header('Authorization')) { if ($request->header('Authorization')) {
$user = auth()->guard('api')->user(); $user = auth()->guard('api')->user();
$data['user_id'] = $user ? $user->id : null; $data['user_id'] = $user?->id;
$authToken = $request->header('Authorization');
} else { } else {
$user = UniModel::model('core_users') $user = UniModel::model('core_users')
->where('email', $data['email']) ->where('email', $data['email'])
@ -85,18 +86,19 @@ class MobileApiController extends Controller
'message' => 'Заявка создана', 'message' => 'Заявка создана',
]; ];
if ($authToken) { if ($data['user_id']) {
$car = $this->getAvailableCar($data['started_at'], $data['ended_at'], $data['mark_id']); $car = $this->getAvailableCar($data['started_at'], $data['ended_at'], $data['mark_id'], $data['color_code']);
if (isEmpty($car)) { if (!isset($car)) {
return response()->json('Нет свободных машин'); return response()->json('Нет свободных машин');
} }
$data['car_id'] = $car->id;
$period = CarbonPeriod::create($data['started_at'], $data['ended_at']); $period = CarbonPeriod::create($data['started_at'], $data['ended_at']);
$dates = array_map(fn($date) => $date->toDateString(), iterator_to_array($period)); $dates = array_map(fn($date) => $date->toDateString(), iterator_to_array($period));
foreach ($dates as $date) { foreach ($dates as $date) {
UniModel::model('pipi_auto_calendar')->create([ UniModel::model('pipi_auto_calendar')->create([
'auto_id' => $car->id, 'auto_id' => $data['car_id'],
'date' => $date, 'date' => $date,
'status' => AutoStatusEnums::Rent->name 'status' => AutoStatusEnums::Rent->name
]); ]);
@ -187,6 +189,7 @@ class MobileApiController extends Controller
$started_at = $request->query('started_at'); $started_at = $request->query('started_at');
$ended_at = $request->query('ended_at'); $ended_at = $request->query('ended_at');
$class = $request->query('class'); $class = $request->query('class');
$bodywork = $request->query('bodywork');
$marks = UniModel::model('pipi_brand_models')->get(); $marks = UniModel::model('pipi_brand_models')->get();
$availableMarks = []; $availableMarks = [];
@ -195,6 +198,11 @@ class MobileApiController extends Controller
$class_id = UniModel::model('pipi_auto_classes')->where('name', $class)->first()->id; $class_id = UniModel::model('pipi_auto_classes')->where('name', $class)->first()->id;
$marks = $marks->where('class_id', $class_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) { foreach ($marks as $mark) {
if ($mark->name === 'Ввод остатков') { if ($mark->name === 'Ввод остатков') {
continue; continue;
@ -204,40 +212,69 @@ class MobileApiController extends Controller
continue; 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); $brand = UniModel::model('pipi_auto_brands')->find($mark->brand_id);
$tariffs = UniModel::model('pipi_auto_tariffs')->where('model_id', $mark->id)->get(); $tariffs = UniModel::model('pipi_auto_tariffs')->where('model_id', $mark->id)->get();
$equipment = UniModel::model('pipi_auto_equipment')->where('id', $mark->equipment_id)->first(); $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; $path = null;
if ($mark?->photo_id) { if ($photo) {
$path = lurl('/download/'.$mark?->photo_id); $path = url('api/files/file/' . ltrim($photo->path, '/'));
} }
$tariffs_new = []; $tariffs_new = [];
foreach ($tariffs as $tariff) { foreach ($tariffs as $tariff) {
$tariffs_new[] = [ $tariffs_new[] = [
'name' => $tariff?->name, 'name' => $tariff?->name,
'price' => $tariff?->base_rate, 'price' => $tariff?->base_rate,
'min' => $tariff?->day_range_start, 'min' => $tariff?->day_range_start,
'max' => $tariff?->day_range_end, 'max' => $tariff?->day_range_end,
'deposit' => $tariff?->deposit,
]; ];
} }
$carsByColor = $cars->groupBy('color_id');
$availableMarks[$mark->name . '-' . $mark->year] = [ foreach ($carsByColor as $carColor => $carsOfColor) {
'id' => $mark->id, $carColor = UniModel::model('pipi_auto_colors')->find($carColor)->code;
'brand' => $brand?->name,
'mark' => $mark->name, $colorPath = $path;
'year' => $mark->year, if ($carsOfColor->first()->photo_id) {
'configuration' => $equipment?->name, $photo = UniModel::model('core_files')->find($carsOfColor->first()->photo_id);
'people' => $mark?->people ?? 5, $colorPath = url('api/files/file/' . ltrim($photo->path, '/'));
'actuator' => $mark?->actuator ?? 'Передний', }
'fuel_type' => $mark?->fuel_type ?? 'АКПП',
'hp' => $mark?->hp ?? '1.6', $key = $mark->name . '-' . $mark->year . '-' . $carColor;
'engine_capacity' => $mark?->engine_capacity ?? 1591,
'fuel_tank' => $mark?->fuel_tank ?? 50, $availableMarks[$key] = [
'conditioner' => $mark?->conditioner, 'id' => $mark->id,
'photo' => $path, 'brand' => $brand?->name,
'tariffs' => $tariffs_new '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)) { if (empty($availableMarks)) {
@ -246,11 +283,15 @@ class MobileApiController extends Controller
return response()->json($availableMarks); 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'); $started_at = Carbon::parse($started_at)->format('Y-m-d');
$ended_at = Carbon::parse($ended_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') $busyCars = UniModel::model('pipi_auto_calendar')
->whereBetween('date', [$started_at, $ended_at]) ->whereBetween('date', [$started_at, $ended_at])
->pluck('auto_id') ->pluck('auto_id')
@ -261,7 +302,58 @@ class MobileApiController extends Controller
if ($availableCars->isNotEmpty()) { if ($availableCars->isNotEmpty()) {
return $availableCars->first(); return $availableCars->first();
} else { } 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": [ "packages": [
{ {
"name": "a7kz/platform", "name": "a7kz/platform",
"version": "1.3.224", "version": "1.3.248",
"source": { "source": {
"type": "git", "type": "git",
"url": "ssh://git@git.a7.kz:22022/A7/package.platform.git", "url": "ssh://git@git.a7.kz:22022/A7/package.platform.git",
"reference": "6568799d86f1f817e26169c91d0b03136ecd8a79" "reference": "e1e9d3fbca67aaa95287a70881a74641ba7890bf"
}, },
"dist": { "dist": {
"type": "tar", "type": "tar",
"url": "https://packagist.a7.kz/dist/a7kz/platform/a7kz-platform-1.3.224-015abb.tar", "url": "https://packagist.a7.kz/dist/a7kz/platform/a7kz-platform-1.3.248-27290c.tar",
"reference": "6568799d86f1f817e26169c91d0b03136ecd8a79", "reference": "e1e9d3fbca67aaa95287a70881a74641ba7890bf",
"shasum": "e245549e24305e73fa8552df633c84ba62e8cf39" "shasum": "6a5b643f024048a65105d1c1eb7f5cff48919143"
}, },
"require": { "require": {
"doctrine/dbal": "^3.5", "doctrine/dbal": "^3.5",
@ -47,7 +47,7 @@
} }
], ],
"description": "LowCode platform", "description": "LowCode platform",
"time": "2025-03-14T13:36:53+00:00" "time": "2025-04-20T18:53:48+00:00"
}, },
{ {
"name": "brick/math", "name": "brick/math",
@ -538,26 +538,29 @@
}, },
{ {
"name": "doctrine/deprecations", "name": "doctrine/deprecations",
"version": "1.1.4", "version": "1.1.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/deprecations.git", "url": "https://github.com/doctrine/deprecations.git",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1 || ^8.0" "php": "^7.1 || ^8.0"
}, },
"conflict": {
"phpunit/phpunit": "<=7.5 || >=13"
},
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^9 || ^12", "doctrine/coding-standard": "^9 || ^12 || ^13",
"phpstan/phpstan": "1.4.10 || 2.0.3", "phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2", "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" "psr/log": "^1 || ^2 || ^3"
}, },
"suggest": { "suggest": {
@ -577,9 +580,9 @@
"homepage": "https://www.doctrine-project.org/", "homepage": "https://www.doctrine-project.org/",
"support": { "support": {
"issues": "https://github.com/doctrine/deprecations/issues", "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", "name": "doctrine/event-manager",
@ -969,16 +972,16 @@
}, },
{ {
"name": "egulias/email-validator", "name": "egulias/email-validator",
"version": "4.0.3", "version": "4.0.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/egulias/EmailValidator.git", "url": "https://github.com/egulias/EmailValidator.git",
"reference": "b115554301161fa21467629f1e1391c1936de517" "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b115554301161fa21467629f1e1391c1936de517", "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa",
"reference": "b115554301161fa21467629f1e1391c1936de517", "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1024,7 +1027,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/egulias/EmailValidator/issues", "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": [ "funding": [
{ {
@ -1032,7 +1035,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-12-27T00:36:43+00:00" "time": "2025-03-06T22:45:56+00:00"
}, },
{ {
"name": "ezyang/htmlpurifier", "name": "ezyang/htmlpurifier",
@ -1230,16 +1233,16 @@
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
"version": "7.9.2", "version": "7.9.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/guzzle.git", "url": "https://github.com/guzzle/guzzle.git",
"reference": "d281ed313b989f213357e3be1a179f02196ac99b" "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"reference": "d281ed313b989f213357e3be1a179f02196ac99b", "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1336,7 +1339,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/guzzle/issues", "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": [ "funding": [
{ {
@ -1352,20 +1355,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-24T11:22:20+00:00" "time": "2025-03-27T13:37:11+00:00"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
"version": "2.0.4", "version": "2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/promises.git", "url": "https://github.com/guzzle/promises.git",
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455" "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c",
"reference": "f9c436286ab2892c7db7be8c8da4ef61ccf7b455", "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1419,7 +1422,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/promises/issues", "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": [ "funding": [
{ {
@ -1435,20 +1438,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-10-17T10:06:22+00:00" "time": "2025-03-27T13:27:01+00:00"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
"version": "2.7.0", "version": "2.7.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/guzzle/psr7.git", "url": "https://github.com/guzzle/psr7.git",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1535,7 +1538,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/guzzle/psr7/issues", "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": [ "funding": [
{ {
@ -1551,7 +1554,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-18T11:15:46+00:00" "time": "2025-03-27T12:30:47+00:00"
}, },
{ {
"name": "guzzlehttp/uri-template", "name": "guzzlehttp/uri-template",
@ -2162,16 +2165,16 @@
}, },
{ {
"name": "league/commonmark", "name": "league/commonmark",
"version": "2.6.1", "version": "2.6.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/commonmark.git", "url": "https://github.com/thephpleague/commonmark.git",
"reference": "d990688c91cedfb69753ffc2512727ec646df2ad" "reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d990688c91cedfb69753ffc2512727ec646df2ad", "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/06c3b0bf2540338094575612f4a1778d0d2d5e94",
"reference": "d990688c91cedfb69753ffc2512727ec646df2ad", "reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2265,7 +2268,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-29T14:10:59+00:00" "time": "2025-04-18T21:09:27+00:00"
}, },
{ {
"name": "league/config", "name": "league/config",
@ -2790,16 +2793,16 @@
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "3.8.1", "version": "3.9.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Seldaek/monolog.git", "url": "https://github.com/Seldaek/monolog.git",
"reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4" "reference": "10d85740180ecba7896c87e06a166e0c95a0e3b6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/aef6ee73a77a66e404dd6540934a9ef1b3c855b4", "url": "https://api.github.com/repos/Seldaek/monolog/zipball/10d85740180ecba7896c87e06a166e0c95a0e3b6",
"reference": "aef6ee73a77a66e404dd6540934a9ef1b3c855b4", "reference": "10d85740180ecba7896c87e06a166e0c95a0e3b6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2877,7 +2880,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/Seldaek/monolog/issues", "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": [ "funding": [
{ {
@ -2889,7 +2892,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-05T17:15:07+00:00" "time": "2025-03-24T10:02:05+00:00"
}, },
{ {
"name": "mpdf/mpdf", "name": "mpdf/mpdf",
@ -3295,16 +3298,16 @@
}, },
{ {
"name": "nette/utils", "name": "nette/utils",
"version": "v4.0.5", "version": "v4.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nette/utils.git", "url": "https://github.com/nette/utils.git",
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96" "reference": "ce708655043c7050eb050df361c5e313cf708309"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", "url": "https://api.github.com/repos/nette/utils/zipball/ce708655043c7050eb050df361c5e313cf708309",
"reference": "736c567e257dbe0fcf6ce81b4d6dbe05c6899f96", "reference": "ce708655043c7050eb050df361c5e313cf708309",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3375,9 +3378,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nette/utils/issues", "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", "name": "nikic/php-parser",
@ -4590,16 +4593,16 @@
}, },
{ {
"name": "ramsey/collection", "name": "ramsey/collection",
"version": "2.1.0", "version": "2.1.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/ramsey/collection.git", "url": "https://github.com/ramsey/collection.git",
"reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109" "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ramsey/collection/zipball/3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109", "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2",
"reference": "3c5990b8a5e0b79cd1cf11c2dc1229e58e93f109", "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4660,9 +4663,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/ramsey/collection/issues", "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", "name": "ramsey/uuid",
@ -4758,16 +4761,16 @@
}, },
{ {
"name": "sabberworm/php-css-parser", "name": "sabberworm/php-css-parser",
"version": "v8.7.0", "version": "v8.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git",
"reference": "f414ff953002a9b18e3a116f5e462c56f21237cf" "reference": "3de493bdddfd1f051249af725c7e0d2c38fed740"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/f414ff953002a9b18e3a116f5e462c56f21237cf", "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/3de493bdddfd1f051249af725c7e0d2c38fed740",
"reference": "f414ff953002a9b18e3a116f5e462c56f21237cf", "reference": "3de493bdddfd1f051249af725c7e0d2c38fed740",
"shasum": "" "shasum": ""
}, },
"require": { "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" "php": "^5.6.20 || ^7.0.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0"
}, },
"require-dev": { "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": { "suggest": {
"ext-mbstring": "for parsing UTF-8 CSS" "ext-mbstring": "for parsing UTF-8 CSS"
@ -4817,9 +4820,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", "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", "name": "setasign/fpdi",
@ -4895,16 +4898,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v6.4.17", "version": "v6.4.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04" "reference": "2e4af9c952617cc3f9559ff706aee420a8464c36"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", "url": "https://api.github.com/repos/symfony/console/zipball/2e4af9c952617cc3f9559ff706aee420a8464c36",
"reference": "799445db3f15768ecc382ac5699e6da0520a0a04", "reference": "2e4af9c952617cc3f9559ff706aee420a8464c36",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -4969,7 +4972,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v6.4.17" "source": "https://github.com/symfony/console/tree/v6.4.20"
}, },
"funding": [ "funding": [
{ {
@ -4985,7 +4988,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-12-07T12:07:30+00:00" "time": "2025-03-03T17:16:38+00:00"
}, },
{ {
"name": "symfony/css-selector", "name": "symfony/css-selector",
@ -5121,16 +5124,16 @@
}, },
{ {
"name": "symfony/error-handler", "name": "symfony/error-handler",
"version": "v6.4.19", "version": "v6.4.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/error-handler.git", "url": "https://github.com/symfony/error-handler.git",
"reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71" "reference": "aa3bcf4f7674719df078e61cc8062e5b7f752031"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/3d4e55cd2b8f1979a65eba9ab749d6466c316f71", "url": "https://api.github.com/repos/symfony/error-handler/zipball/aa3bcf4f7674719df078e61cc8062e5b7f752031",
"reference": "3d4e55cd2b8f1979a65eba9ab749d6466c316f71", "reference": "aa3bcf4f7674719df078e61cc8062e5b7f752031",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5176,7 +5179,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code", "description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/error-handler/tree/v6.4.19" "source": "https://github.com/symfony/error-handler/tree/v6.4.20"
}, },
"funding": [ "funding": [
{ {
@ -5192,7 +5195,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-02-02T20:16:33+00:00" "time": "2025-03-01T13:00:38+00:00"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
@ -5493,16 +5496,16 @@
}, },
{ {
"name": "symfony/http-kernel", "name": "symfony/http-kernel",
"version": "v6.4.19", "version": "v6.4.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/http-kernel.git", "url": "https://github.com/symfony/http-kernel.git",
"reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c" "reference": "6be6db31bc74693ce5516e1fd5e5ff1171005e37"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/88f2c9f7feff86bb7b9105c5151bc2c1404cd64c", "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6be6db31bc74693ce5516e1fd5e5ff1171005e37",
"reference": "88f2c9f7feff86bb7b9105c5151bc2c1404cd64c", "reference": "6be6db31bc74693ce5516e1fd5e5ff1171005e37",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -5587,7 +5590,7 @@
"description": "Provides a structured process for converting a Request into a Response", "description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/http-kernel/tree/v6.4.19" "source": "https://github.com/symfony/http-kernel/tree/v6.4.20"
}, },
"funding": [ "funding": [
{ {
@ -5603,7 +5606,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-02-26T10:51:37+00:00" "time": "2025-03-28T13:27:10+00:00"
}, },
{ {
"name": "symfony/mailer", "name": "symfony/mailer",
@ -6408,16 +6411,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v6.4.19", "version": "v6.4.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3" "reference": "e2a61c16af36c9a07e5c9906498b73e091949a20"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3", "url": "https://api.github.com/repos/symfony/process/zipball/e2a61c16af36c9a07e5c9906498b73e091949a20",
"reference": "7a1c12e87b08ec9c97abdd188c9b3f5a40e37fc3", "reference": "e2a61c16af36c9a07e5c9906498b73e091949a20",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -6449,7 +6452,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v6.4.19" "source": "https://github.com/symfony/process/tree/v6.4.20"
}, },
"funding": [ "funding": [
{ {
@ -6465,7 +6468,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-02-04T13:35:48+00:00" "time": "2025-03-10T17:11:00+00:00"
}, },
{ {
"name": "symfony/routing", "name": "symfony/routing",
@ -9655,16 +9658,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v6.4.18", "version": "v6.4.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5" "reference": "28ee818fce4a73ac1474346b94e4b966f665c53f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5", "url": "https://api.github.com/repos/symfony/yaml/zipball/28ee818fce4a73ac1474346b94e4b966f665c53f",
"reference": "bf598c9d9bb4a22f495a4e26e4c4fce2f8ecefc5", "reference": "28ee818fce4a73ac1474346b94e4b966f665c53f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -9707,7 +9710,7 @@
"description": "Loads and dumps YAML files", "description": "Loads and dumps YAML files",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/yaml/tree/v6.4.18" "source": "https://github.com/symfony/yaml/tree/v6.4.20"
}, },
"funding": [ "funding": [
{ {
@ -9723,7 +9726,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2025-01-07T09:44:41+00:00" "time": "2025-02-27T20:15:30+00:00"
}, },
{ {
"name": "theseer/tokenizer", "name": "theseer/tokenizer",

View File

@ -149,6 +149,10 @@
"type": "timestamp", "type": "timestamp",
"nullable": true, "nullable": true,
"comment": "Дата удаления" "comment": "Дата удаления"
},
"photo_id": {
"type": "int",
"validation": "nullable|int"
} }
} }
}, },
@ -300,6 +304,14 @@
"name": "owner_id", "name": "owner_id",
"label": "Владелец" "label": "Владелец"
} }
},
{
"size": 12,
"input": {
"name": "photo_id",
"label": "Фото",
"type": "file"
}
} }
] ]
} }
@ -384,6 +396,14 @@
"name": "owner_id", "name": "owner_id",
"label": "Владелец" "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(); $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": { "name": {
"type": "string" "type": "string"
},
"code": {
"type": "string"
} }
} }
}, },
@ -27,6 +30,10 @@
{ {
"name": "name", "name": "name",
"caption": "Название цвета" "caption": "Название цвета"
},
{
"name": "code",
"caption": "Код"
} }
], ],
"action": { "action": {
@ -49,6 +56,13 @@
"name": "name", "name": "name",
"label": "Название цвета" "label": "Название цвета"
} }
},
{
"size": 6,
"input": {
"name": "code",
"label": "Код"
}
} }
] ]
} }
@ -66,11 +80,18 @@
{ {
"cols": [ "cols": [
{ {
"size": 12, "size": 6,
"input": { "input": {
"name": "name", "name": "name",
"label": "Название" "label": "Название"
} }
},
{
"size": 6,
"input": {
"name": "code",
"label": "Код"
}
} }
] ]
} }
@ -86,11 +107,18 @@
{ {
"cols": [ "cols": [
{ {
"size": 12, "size": 6,
"input": { "input": {
"name": "name", "name": "name",
"label": "Название" "label": "Название"
} }
},
{
"size": 6,
"input": {
"name": "code",
"label": "Код"
}
} }
] ]
} }

View File

@ -33,6 +33,12 @@ return new class extends \A7kz\Platform\Commands\InstallScript {
$table->softDeletes(); $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", "module": "pipicar",
"name": "pipicar.auto_colors", "name": "pipicar.auto_tariffs",
"type": "crud", "type": "crud",
"title": "Цвета Автомобилей", "title": "Цвета Автомобилей",
"withHeader": false, "withHeader": false,
"data": { "data": {
"table": "pipi_auto_colors", "table": "pipi_auto_tariffs",
"pk": "id", "pk": "id",
"limit": 25, "limit": 25,
"segment": true, "segment": true,

View File

@ -63,6 +63,24 @@
], ],
"validation": "nullable|integer" "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": { "pipi_tariffs": {
"type": "subcrud", "type": "subcrud",
"module": "pipicar", "module": "pipicar",
@ -313,6 +331,22 @@
"label": "Год" "label": "Год"
} }
}, },
{
"size": 4,
"input": {
"name": "bodywork_id",
"label": "Кузов",
"readonly": true
}
},
{
"size": 4,
"input": {
"name": "class_id",
"label": "Класс",
"readonly": true
}
},
{ {
"size": 4, "size": 4,
"input": { "input": {
@ -411,6 +445,22 @@
"label": "Год" "label": "Год"
} }
}, },
{
"size": 4,
"input": {
"name": "bodywork_id",
"label": "Кузов",
"readonly": true
}
},
{
"size": 4,
"input": {
"name": "class_id",
"label": "Класс",
"readonly": true
}
},
{ {
"size": 4, "size": 4,
"input": { "input": {

View File

@ -67,6 +67,11 @@ return new class extends \A7kz\Platform\Commands\InstallScript {
$table->unsignedBigInteger('photo_id')->nullable()->comment('Фото'); $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; namespace App\Modules\main\Components;
use A7kz\Platform\Modules\Platform\Core\Services\Base\Component; 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 class Main extends Component
{ {
@ -17,5 +20,19 @@ class Main extends Component
{ {
parent::__construct($params, $module); parent::__construct($params, $module);
$this->template = 'pipicar::main.views.main'; $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') <div class="container text-center my-3 main-page">
@endsection <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'; import $ from 'jquery';
window.$ = window.jQuery = $; window.$ = window.jQuery = $;
require('select2'); require('select2');
import * as bootstrap from 'bootstrap';
window.bootstrap = bootstrap;

View File

@ -35,16 +35,15 @@ body {
} }
.main-container { .main-container {
margin-left: 50px; margin: 50px;
margin-top: 50px;
padding: 20px; padding: 20px;
} }
.menu-open{ //.menu-open{
.main-container{ // .main-container{
margin-left: 250px; // margin-left: 250px;
} // }
} //}
.global-line{ .global-line{
margin: 0 0 10px 0; margin: 0 0 10px 0;
@ -263,3 +262,54 @@ body {
.fkey{ .fkey{
background-color: white !important; 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 { .table-container.subcrud-table {
box-shadow: none; 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; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0; padding: 0;
margin: 0 1rem; margin: 0 auto;
.left-cont { .left-cont {
display: flex !important; display: flex !important;
justify-content: center; 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 { .right-cont {
display: flex !important; display: flex !important;
justify-content: center; justify-content: center;
@ -143,7 +158,7 @@
} }
@media screen and (max-width: 1400px) { @media screen and (max-width: 1400px) {
.navbar .container .left-cont .navbar-brand img { .navbar .nav-container .left-cont .navbar-brand img {
width: 140px; width: 140px;
} }
} }
@ -157,7 +172,19 @@
font-size: 14px; font-size: 14px;
} }
.navbar .container .left-cont .navbar-brand img{ .navbar .nav-container .left-cont .navbar-brand img{
width: 120px; 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> <!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head> <head>
@ -29,18 +33,11 @@
<div id="web_content"> <div id="web_content">
<div id="app" <div id="app"
@if(isset($_COOKIE['a7platform_open_window']) && $_COOKIE['a7platform_open_window']) class="menu-open" @endif> @if(isset($_COOKIE['a7platform_open_window']) && $_COOKIE['a7platform_open_window']) class="menu-open" @endif>
@auth
@include('platform.navigation::sidebar')
@endauth
<main class="main-container"> <main class="main-container">
<header class="navbar"> <header class="navbar">
<div class="nav-container py-1"> <div class="nav-container py-1">
<div class="left-cont d-flex"> <div class="left-cont d-flex">
@auth <a class="navbar-brand" href="{{ '/' . app()->getLocale() }}">
<i class="bi bi-list menu-trigger"></i>
@endauth
<a class="navbar-brand">
<img src="{{asset('img/logo.png')}}" alt="logo" class="logo"> <img src="{{asset('img/logo.png')}}" alt="logo" class="logo">
</a> </a>
<div class="item-nav lang"> <div class="item-nav lang">
@ -78,7 +75,38 @@
</div> </div>
<a class="header-phone" href="tel:87763504141"><i class="bi bi-telephone-fill"></i> +7 776 350 41 41</a> <a class="header-phone" href="tel:87763504141"><i class="bi bi-telephone-fill"></i> +7 776 350 41 41</a>
</div> </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"> <div class="right-cont d-flex justify-end align-center">
@if (Route::has('login')) @if (Route::has('login'))
<a class="item-nav btn btn-primary waves-effect" href="{{ lurl('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 App\Http\Controllers\Sync1cApiController;
use Illuminate\Support\Facades\Storage;
Route::prefix('1c')->group(function () { Route::prefix('1c')->group(function () {
Route::post('syncAutoData', [Sync1cApiController::class, 'syncAutoData']); Route::post('syncAutoData', [Sync1cApiController::class, 'syncAutoData']);
@ -29,9 +30,15 @@ Route::prefix('mobile')->group(function () {
Route::post('checkAvailableCar', [MobileApiController::class, 'checkAvailableCar']); Route::post('checkAvailableCar', [MobileApiController::class, 'checkAvailableCar']);
Route::post('sendApplication', [MobileApiController::class, 'sendApplication']); Route::post('sendApplication', [MobileApiController::class, 'sendApplication']);
Route::post('getApplications', [MobileApiController::class, 'getApplications']); Route::post('getApplications', [MobileApiController::class, 'getApplications']);
Route::post('getSum', [MobileApiController::class, 'getSum']);
Route::post('login', [MobileApiController::class, 'login']); Route::post('login', [MobileApiController::class, 'login']);
}); });
Route::get('/', function (Request $request) { Route::get('/', function (Request $request) {
dd(123); dd(123);
}); });
Route::get('/files/{path}', function ($path) {
return Storage::response($path);
})->where('path', '.*');