fixed createLocations Action not working
This commit is contained in:
@@ -28,6 +28,7 @@ class WarehouseAdministrationController extends mfBaseController {
|
||||
protected function createLocationsAction(): void {
|
||||
$existingLocations = WarehouseLocationModel::getAll();
|
||||
$companyCars = TimerecordingCarModel::getAll();
|
||||
$beforeCount = WarehouseLocationModel::count();
|
||||
|
||||
|
||||
$wantedCarLocations = [];
|
||||
@@ -73,7 +74,7 @@ class WarehouseAdministrationController extends mfBaseController {
|
||||
"title" => $wantedCarLocation,
|
||||
"description" => "Automatisch erstellt",
|
||||
"assignedTo" => $assignedTo,
|
||||
"createdBy" => $this->me->id,
|
||||
"createBy" => $this->me->id,
|
||||
"create" => time()
|
||||
]);
|
||||
}
|
||||
@@ -97,14 +98,18 @@ class WarehouseAdministrationController extends mfBaseController {
|
||||
"title" => $user->name . "'s Lagerort",
|
||||
"description" => "Automatisch erstellt",
|
||||
"assignedTo" => $user->id,
|
||||
"createdBy" => $this->me->id,
|
||||
"createBy" => $this->me->id,
|
||||
"create" => time()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
var_dump($existingLocations);
|
||||
die();
|
||||
$afterCount = WarehouseLocationModel::count();
|
||||
|
||||
if ($afterCount - $beforeCount === 0) {
|
||||
$this->returnJSON(["success" => true, "message" => "Alle Lagerorte existieren bereits"]);
|
||||
} else {
|
||||
$this->returnJSON(["success" => true, "message" => "Es wurden " . ($afterCount - $beforeCount) . " neue Lagerorte erstellt"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@ class WarehouseLocationModel extends TTCrudBaseModel {
|
||||
public string $title;
|
||||
public string $description;
|
||||
public int $assignedTo;
|
||||
public int $createdBy;
|
||||
public int $createBy;
|
||||
public int $create;
|
||||
}
|
||||
Reference in New Issue
Block a user