Added operator_id column
This commit is contained in:
@@ -19,6 +19,7 @@ class ProductionLineStop extends Model
|
|||||||
"to_datetime",
|
"to_datetime",
|
||||||
"stop_hour",
|
"stop_hour",
|
||||||
"stop_min",
|
"stop_min",
|
||||||
|
"operator_id",
|
||||||
];
|
];
|
||||||
|
|
||||||
public function plant(): BelongsTo
|
public function plant(): BelongsTo
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class ProductionPlan extends Model
|
|||||||
"line_id",
|
"line_id",
|
||||||
"plan_quantity",
|
"plan_quantity",
|
||||||
"production_quantity",
|
"production_quantity",
|
||||||
|
"operator_id",
|
||||||
];
|
];
|
||||||
|
|
||||||
public function plant(): BelongsTo
|
public function plant(): BelongsTo
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Filament\Facades\Filament;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
@@ -20,6 +21,7 @@ class ProductionQuantity extends Model
|
|||||||
"item_id",
|
"item_id",
|
||||||
"serial_number",
|
"serial_number",
|
||||||
"production_order",
|
"production_order",
|
||||||
|
"operator_id",
|
||||||
];
|
];
|
||||||
|
|
||||||
public function plant(): BelongsTo
|
public function plant(): BelongsTo
|
||||||
@@ -69,10 +71,13 @@ class ProductionQuantity extends Model
|
|||||||
->first();
|
->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$operatorName = Filament::auth()->user()->name;
|
||||||
|
|
||||||
if ($productionPlan) {
|
if ($productionPlan) {
|
||||||
$productionPlan->update([
|
$productionPlan->update([
|
||||||
'production_quantity' => $productionPlan->production_quantity + 1,
|
'production_quantity' => $productionPlan->production_quantity + 1,
|
||||||
'updated_at' => now(),
|
'updated_at' => now(),
|
||||||
|
'operator_id'=> $operatorName,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user