我有 2 个值 $minsRecoded 和 $totalMins,如果 minsRecorded 大于 totalMins,我想在危险徽章中显示 $totalMinsComplted。
这是我的控制器中的内容
$sumMins = \App\ProjectTimeLog::where('user_id', '=', '1')->pluck('total_minutes')->sum()/60;
$minsRecoded = Task::getTotalMinsCompleted()/60;
$totalMin = \App\ProjectTimeLog::where('user_id', '=', '1')->pluck('total_minutes')->sum()/60;
$this->totalMins = \App\ProjectTimeLog::where('user_id', '=', '1')->pluck('total_minutes')->sum()/60;
if ($minsRecoded < $totalMin) $this->totalMinsCompleted = '<span class="badge badge-danger">";
这是我的观点
{{$totalMinsCompleted}}/{{$totalMins}}
哔哔one