pull/7/head
Rustem 2025-03-27 11:16:56 +05:00
parent ab9013c32a
commit a156e81a8b
2 changed files with 13 additions and 6 deletions

View File

@ -204,20 +204,21 @@ class MobileApiController extends Controller
if ($mark->name === 'Ввод остатков') { if ($mark->name === 'Ввод остатков') {
continue; continue;
} }
//
if (!$this->checkAvailableCar($started_at, $ended_at, $mark->id)) { // if (!$this->checkAvailableCar($started_at, $ended_at, $mark->id)) {
continue; // 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); $class = UniModel::model('pipi_auto_classes')->find($mark->class_id);
$bodywork = UniModel::model('pipi_auto_bodywork')->find($mark->bodywork_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) {

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']);
@ -35,3 +36,8 @@ Route::prefix('mobile')->group(function () {
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', '.*');