This commit is contained in:
巴掌 committed 2020-12-22 12:38:13 +08:00
1 parent 494986da2c
commit f9ae842122
12 files changed
+856 -89

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ class Admin extends Validate
*/
protected $rule = [
'xingming|用户姓名' => 'require|chs|length:2,6',
'username|帐号' => ['require','uset'=>'/^[a-z][a-z0-9-_]*$/'],
'username|帐号' => ['require', 'uset'=>'/^[a-z][a-z0-9-_]*$/'],
'teacher_id|用户编号' => 'require|number|length:1,11',
'group_id|角色' => 'require|array',
'shengri|出生日期' => 'date',
+16 -1
View File
@@ -254,6 +254,7 @@ class TongjiBj extends BaseModel
,'zhongshu' => $val->zhongshu
,'zhongweishu' => $val->zhongweishu
,'chashenglv' => $val->chashenglv
,'canshilv' => $val->canshilv
];
}else{
$data[$value->banji_id]['quanke'] = [
@@ -631,7 +632,7 @@ class TongjiBj extends BaseModel
$ksid = $this->getAttr('kaoshi_id');
return $this->hasMany('\app\chengji\model\TongjiBj', 'banji_id', 'banji_id')
->where('kaoshi_id', $ksid)
->append(['youxiulv', 'jigelv', 'chashenglv']);
->append(['youxiulv', 'jigelv', 'chashenglv', 'canshilv']);
}
@@ -726,4 +727,18 @@ class TongjiBj extends BaseModel
return $chalv;
}
// 参试率
function getCanshilvAttr()
{
$cjCnt = $this->chengji_cnt;
$stu_cnt = $this->stu_cnt;
$canshilv = 0;
if ($stu_cnt > 0) {
$chalv = round($cjCnt / $stu_cnt * 100, 2);
}
return $chalv;
}
}
-20
View File
@@ -59,26 +59,6 @@
}
// // 单位列表
// function schoolXueduan($low = '幼儿园', $high = '其它学段', $order = 'asc')
// {
// // 实例化单位模型
// $sch = new \app\system\model\School;
// $data = $sch->srcSchool($low, $high, $order);
// return $data;
// }
// // 获取单位列表
// function srcSchool($src)
// {
// // 实例化单位模型
// $sch = new \app\system\model\School;
// $data = $sch->srcSchool($low, $high, $order);
// return $data;
// }
// 可以组织考试的单位列表
function kaoshiSchoolList()
{
Loaded 3 of 12 files, more files were not shown because too many files have changed in this diff. Show more