songxingwei 4 lat temu
rodzic
commit
55c158ec8b
2 zmienionych plików z 19 dodań i 2 usunięć
  1. 17 0
      app/admin/controller/School.php
  2. 2 2
      app/admin/view/school/index.html

+ 17 - 0
app/admin/controller/School.php

@@ -148,4 +148,21 @@ class School extends Controller
     }
 
 
+
+    /**
+     * 学生管理
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function student()
+    {
+        $this->title = '学生管理';
+        $query = $this->_query('students')->where('school_id',$this->request->get('id'));
+        $query->like('name,sex,id_card,student_number,grade,class');
+        // 列表排序并显示
+        $query->page();
+    }
+
+
 }

+ 2 - 2
app/admin/view/school/index.html

@@ -47,9 +47,9 @@
                     {if auth("admin/school/info")}
                     <a data-dbclick class="layui-btn layui-btn-sm" data-open='{:url("info")}?id={$vo.id}'>详 情</a>
                     {/if}
-<!--                    <a data-title="学生列表" class="layui-btn layui-btn-sm layui-btn-normal" data-open='{:url("student")}?school_id={$vo.id}'>学生列表</a>-->
+                    <a data-title="学生列表" class="layui-btn layui-btn-sm layui-btn-normal" data-open='{:url("student")}?school_id={$vo.id}'>学生列表</a>
 
-<!--                    <a data-title="教师列表" class="layui-btn layui-btn-sm layui-btn-normal" data-open='{:url("teacher")}?school_id={$vo.id}'>教师列表</a>-->
+                    <a data-title="教师列表" class="layui-btn layui-btn-sm layui-btn-normal" data-open='{:url("teacher")}?school_id={$vo.id}'>教师列表</a>
 
                     {if $vo.status eq 1 and auth("forbid")}
                     <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>