$questions_id, 'is_correct' => 1])->count(); $data['yes'] = self::where(['questions_id' => $questions_id, 'is_correct' => 2])->count(); $data['total'] = bcadd($data['wrong'], $data['yes'], 0); return $data; } }