fix(master-rule): fix view master rule
This commit is contained in:
parent
bcd9a86888
commit
9270eda907
|
@ -12,8 +12,9 @@ class RuleController extends Controller
|
|||
{
|
||||
public function index()
|
||||
{
|
||||
$rules = Rule::with('indicator')->orderBy('created_at', 'desc')->get();
|
||||
$rules = Indicator::with('rules')->get();
|
||||
$indicators = Indicator::select('id', 'name')->get();
|
||||
// dd($rules);
|
||||
return view('master-data.aturan.index', compact('rules', 'indicators'));
|
||||
}
|
||||
|
||||
|
|
|
@ -11,4 +11,10 @@ class Indicator extends Model
|
|||
|
||||
protected $table = 'indicators';
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return $this->hasMany(Rule::class, 'indicator_id', 'id');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,10 +61,9 @@
|
|||
<th class="sort" data-sort="indicator_name">
|
||||
Indikator
|
||||
</th>
|
||||
<th class="sort" data-sort="range_min">Ideal Min</th>
|
||||
<th class="sort" data-sort="range_max">Ideal Max</th>
|
||||
<th class="sort" data-sort="parameter_type">Jenis Indikator</th>
|
||||
<th class="sort" data-sort="status">
|
||||
Meansure Belief
|
||||
CF(e)
|
||||
</th>
|
||||
<th class="sort" data-sort="action">Action</th>
|
||||
</tr>
|
||||
|
@ -77,11 +76,20 @@
|
|||
<a href="javascript:void(0);"
|
||||
class="fw-medium link-primary">#VZ2101</a>
|
||||
</td>
|
||||
<td class="indicator_name">{{ $rule->indicator->name }}</td>
|
||||
<td class="range_min">{{ $rule->ideal_min }}</td>
|
||||
<td class="range_max">{{ $rule->ideal_max }}</td>
|
||||
<td class="indicator_name">{{ $rule->name }}</td>
|
||||
<td class="parameter_type">
|
||||
<ul class="list-unstyled mb-0">
|
||||
@foreach ($rule->rules as $item)
|
||||
<li class="mb-2">{{ $item->parameter_type }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</td>
|
||||
<td class="status">
|
||||
<span>{{ $rule->mb }}</span>
|
||||
<ul class="list-unstyled mb-0">
|
||||
@foreach ($rule->rules as $item)
|
||||
<li class="mb-2"><span>{{ $item->cf }}</span></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<div class="d-flex gap-2 justify-content-center">
|
||||
|
|
Loading…
Reference in New Issue