Added log for query execution time
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 9m47s
Laravel Larastan / larastan (pull_request) Failing after 16m31s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Pint / pint (pull_request) Successful in 9m47s
Laravel Larastan / larastan (pull_request) Failing after 16m31s
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Exports\ProductionPlanExport;
|
||||
use App\Models\ProductionPlan;
|
||||
use App\Models\ProductionQuantity;
|
||||
use App\Models\QualityValidation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Livewire\Component;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
@@ -29,7 +30,6 @@ class ProductionTargetPlan extends Component
|
||||
protected $listeners = [
|
||||
'loadData' => 'loadProductionData',
|
||||
'loadData1' => 'exportProductionData',
|
||||
'loadDataMonthly' => 'loadMonthlyPlan',
|
||||
];
|
||||
|
||||
public function getMonthDates($month, $year)
|
||||
@@ -468,6 +468,8 @@ class ProductionTargetPlan extends Component
|
||||
$dates = $this->getMonthDates($month, $year);
|
||||
$this->dates = $dates;
|
||||
|
||||
$start = microtime(true);
|
||||
|
||||
$plans = ProductionPlan::query()
|
||||
->join('items', 'items.id', '=', 'production_plans.item_id')
|
||||
->join('lines', 'lines.id', '=', 'production_plans.line_id')
|
||||
@@ -493,6 +495,8 @@ class ProductionTargetPlan extends Component
|
||||
)
|
||||
->get();
|
||||
|
||||
Log::info('Plans: ' . ((microtime(true) - $start) * 1000) . ' ms');
|
||||
|
||||
$leaveDates = [];
|
||||
|
||||
if ($plans->isNotEmpty() && $plans[0]->leave_dates) {
|
||||
@@ -501,6 +505,8 @@ class ProductionTargetPlan extends Component
|
||||
|
||||
$this->leaveDates = $leaveDates;
|
||||
|
||||
$start = microtime(true);
|
||||
|
||||
$producedData = QualityValidation::selectRaw("
|
||||
quality_validations.plant_id,
|
||||
quality_validations.line_id,
|
||||
@@ -530,6 +536,8 @@ class ProductionTargetPlan extends Component
|
||||
)
|
||||
->map(fn($group) => $group->keyBy('prod_date'));
|
||||
|
||||
Log::info('Quality: ' . ((microtime(true) - $start) * 1000) . ' ms');
|
||||
|
||||
$records = [];
|
||||
|
||||
foreach ($plans as $plan) {
|
||||
|
||||
Reference in New Issue
Block a user