增加学生信息查看
This commit is contained in:
1 parent
8712a7cbc5
commit
60529919ee
6 files changed
+203
-6
No files matched your search
@@ -19,8 +19,6 @@ class Kaoshi extends Base
|
||||
// 用新值替换初始值
|
||||
$src = array_cover( $srcfrom , $src ) ;
|
||||
|
||||
|
||||
|
||||
// 整理变量
|
||||
// $xingzhi = $src['xingzhi'];
|
||||
$searchval = $src['searchval'];
|
||||
@@ -44,6 +42,10 @@ class Kaoshi extends Base
|
||||
);
|
||||
}
|
||||
,'ksNianji'
|
||||
,'ksZuzhi'=>function($q)
|
||||
{
|
||||
$q->field('id,title,jiancheng');
|
||||
}
|
||||
]
|
||||
)
|
||||
->select();
|
||||
@@ -89,7 +91,7 @@ class Kaoshi extends Base
|
||||
{
|
||||
return $this->hasMany('KaoshiSubject','kaoshiid','id');
|
||||
}
|
||||
// 参考学科关联表
|
||||
// 参考类别关联表
|
||||
public function ksCategory()
|
||||
{
|
||||
return $this->belongsTo('\app\system\model\Category','category','id');
|
||||
@@ -101,6 +103,12 @@ class Kaoshi extends Base
|
||||
return $this->hasMany('\app\chengji\model\Chengji','kaoshi','id');
|
||||
}
|
||||
|
||||
// 考试组织单位关联表
|
||||
public function ksZuzhi()
|
||||
{
|
||||
return $this->belongsTo('\app\system\model\School','zuzhi','id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ class Auth
|
||||
'upload','myinfo',
|
||||
'mybanji','banjilist',
|
||||
'editpassword','updatepassword',
|
||||
// 学生信息查询
|
||||
'ajaxdatachengji',
|
||||
// 教师信息查询
|
||||
'srcteacher','srcry','srckt',
|
||||
// 查询班级成绩、查询年级成绩、查询录入成绩人员信息
|
||||
|
||||
@@ -157,7 +157,89 @@ class Student extends BaseController
|
||||
//
|
||||
public function read($id)
|
||||
{
|
||||
//
|
||||
// 查询教师信息
|
||||
$myInfo = STU::where('id',$id)
|
||||
->with([
|
||||
'stuBanji'=>function($query)
|
||||
{
|
||||
$query->field('id,school,ruxuenian,paixu')->append(['banjiTitle']);
|
||||
},
|
||||
'stuSchool'=>function($query)
|
||||
{
|
||||
$query->field('id,title');
|
||||
}
|
||||
])
|
||||
->find();
|
||||
// 设置页面标题
|
||||
$myInfo['webtitle'] = $myInfo->xingming.' 信息';
|
||||
|
||||
|
||||
// 模板赋值
|
||||
$this->view->assign('list',$myInfo);
|
||||
// 渲染模板
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 获取考试成绩
|
||||
public function ajaxDatachengji()
|
||||
{
|
||||
// 获取表单参数
|
||||
// 获取参数
|
||||
$src = $this->request
|
||||
->only([
|
||||
'page'=>'1',
|
||||
'limit'=>'10',
|
||||
'field'=>'update_time',
|
||||
'type'=>'desc',
|
||||
'studentid'=>'',
|
||||
],'POST');
|
||||
|
||||
// 获取学生成绩
|
||||
$kh = new \app\kaoshi\model\Kaohao;
|
||||
$khList = $kh
|
||||
->where('student',$src['studentid'])
|
||||
->field('id,kaoshi,school,ruxuenian,banji,paixu,student')
|
||||
->with([
|
||||
'cjSchool'=>function($query){
|
||||
$query->field('id,jiancheng');
|
||||
}
|
||||
,'cjKaoshi'=>function($query)
|
||||
{
|
||||
$query->field('id,title,category,zuzhi,bfdate,enddate')
|
||||
->with([
|
||||
'ksCategory'=>function($query){
|
||||
$query->field('id,title');
|
||||
}
|
||||
,'ksZuzhi'=>function($query)
|
||||
{
|
||||
$query->field('id,title,jiancheng');
|
||||
}
|
||||
]);
|
||||
}
|
||||
,'ksChengji'
|
||||
])
|
||||
->append(['banjiTitle'])
|
||||
->select();
|
||||
|
||||
// 获取符合条件记录总数
|
||||
$cnt = $khList->count();
|
||||
// 获取当前页数据
|
||||
$limit_start = $src['page'] * $src['limit'] - $src['limit'];
|
||||
$limit_length = $src['limit'];
|
||||
$khList = $khList->slice($limit_start,$limit_length);
|
||||
|
||||
// 重组返回内容
|
||||
$data = [
|
||||
'code'=> 0 , // ajax请求次数,作为标识符
|
||||
'msg'=>"", // 获取到的结果数(每页显示数量)
|
||||
'count'=>$cnt, // 符合条件的总数据量
|
||||
'data'=>$khList, //获取到的数据结果
|
||||
];
|
||||
|
||||
|
||||
return json($data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loaded 3 of 6 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user