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