michealwoo 2 年 前
コミット
2ae8016cf3
1 ファイル変更16 行追加6 行削除
  1. 16 6
      app/Admin/Controllers/LeaveController.php

+ 16 - 6
app/Admin/Controllers/LeaveController.php

xqd
@@ -42,12 +42,22 @@ class LeaveController extends AdminController
     protected function detail($id)
     {
         return Show::make($id, new Leave(), function (Show $show) {
-            $show->field('student_id')->using(config('map.students'));
-            $show->field('reason');
-            $show->field('leave_type')->using(config('map.leave_type'));
-            $show->field('start_time');
-            $show->field('end_time');
-            $show->field('created_at');
+            $show->row(function (Show\Row $show) {
+              $show->field('content','请假详情')
+                  ->width(8)
+                  ->unescape()
+                  ->as(function () {
+                  $html = '';
+                  $html .= '<div style="text-align:left">';
+                  $html .= '<div style="margin-top:5px">请假人:' . config('map.students')[$this->student_id] . '</div>';
+                  $html .= '<div style="margin-top:5px">请假原因:' . $this->reason . '</div>';
+                  $html .= '<div style="margin-top:5px">请假类型:' .  config('map.leave_type')[$this->leave_type] . '</div>';
+                  $html .= '<div style="margin-top:5px">开始时间:' . $this->start_time . '</div>';
+                  $html .= '<div style="margin-top:5px">结束时间:' . $this->end_time . '</div>';
+                  $html .= '</div>';
+                  return $html;
+              });
+          });
         });
     }