| xqd
@@ -3,6 +3,7 @@
|
|
|
namespace App\Http\Controllers\Admin;
|
|
|
|
|
|
use App\Models\Course;
|
|
|
+use App\Models\RemarkDetail;
|
|
|
use App\Models\Teacher;
|
|
|
use App\Models\TeacherCourse;
|
|
|
use Illuminate\Http\Request;
|
| xqd
@@ -36,6 +37,11 @@ class TeacherController extends Controller
|
|
|
|
|
|
$list = $list->paginate()->withPath($this->getPaginateUrl());
|
|
|
|
|
|
+ foreach($list as $item) {
|
|
|
+ $item->average_score = RemarkDetail::where('remark_id', $item->id)->get()->avg('score');
|
|
|
+ $item->average_score = round($item->average_score, 1);
|
|
|
+ }
|
|
|
+
|
|
|
list($pre_uri, $model_name) = array($this->pre_uri, $this->model_name);
|
|
|
return view($this->view_path . 'index', compact('list', 'pre_uri', 'model_name'));
|
|
|
}
|