...
|
...
|
@@ -35,6 +35,8 @@ class User extends Backend |
|
|
$this->model = model('User');
|
|
|
$moblieExamList = Db::name('mobile_exam')->where('pid','>',0)->column('id,name');
|
|
|
$this->assignconfig('mobileExamList', $moblieExamList);
|
|
|
$studyList = Db::name('study')->column('id,examname');
|
|
|
$this->assignconfig('studyList', $studyList);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -50,6 +52,21 @@ class User extends Backend |
|
|
return $this->selectpage();
|
|
|
}
|
|
|
|
|
|
// 修改where条件,sql字段替换
|
|
|
$filter = json_decode($this->request->get("filter"),true);
|
|
|
$op = json_decode($this->request->get("op"),true);
|
|
|
if(isset($filter['studys'])){
|
|
|
$user_ids = Db::name('third_study')
|
|
|
->alias('a')
|
|
|
->join('study b','b.id = a.study_id')
|
|
|
->where('a.study_id',$filter['studys'])
|
|
|
->column('a.third_id');
|
|
|
$filter['id'] = !empty($user_ids) ? implode(',',$user_ids) : 0;
|
|
|
$op['id'] = $op['studys'];
|
|
|
unset($filter['studys'],$op['studys']);
|
|
|
$this->request->get(["filter"=>json_encode($filter),'op'=>json_encode($op)]);
|
|
|
}
|
|
|
|
|
|
list($where, $sort, $order, $offset, $limit) = $this->buildparams('user.id,user.username,user.nickname,user.password,user.card,user.work_address,user.studynum');
|
|
|
$total = $this->model
|
|
|
->with('group')
|
...
|
...
|
@@ -64,6 +81,11 @@ class User extends Backend |
|
|
->select();
|
|
|
foreach ($list as $k => &$v) {
|
|
|
$v['user.mobile_exam_ids'] = Db::name('mobile_exam')->whereIn('id',$v['mobile_exam_ids'])->column('name');
|
|
|
$v['studys'] = Db::name('third_study')
|
|
|
->alias('a')
|
|
|
->join('study b','b.id = a.study_id')
|
|
|
->where('a.third_id',$v['id'])
|
|
|
->column('b.examname');
|
|
|
}
|
|
|
$result = array("total" => $total, "rows" => $list);
|
|
|
|
...
|
...
|
|