增加班级别名设置

This commit is contained in:
巴掌 committed 2020-08-07 16:20:54 +08:00
1 parent f64184eb0f
commit 62377de90f
12 files changed
+157 -18

No files matched your search

-3
View File
@@ -19,6 +19,3 @@ default_lang = zh-cn
[SESSION]
EXPIRE = 1200
[SHANGMA]
CLASSMAX = 30
+8 -7
View File
@@ -41,14 +41,15 @@
$thisday <= $jiedian ? $str = 1 : $str = 0;
$nian = $nian - $str;
$njlist = array();
$njlist[$nian] = '一年级';
$njlist[$nian - 1] = '二年级';
$njlist[$nian - 2] = '三年级';
$njlist[$nian - 3] = '四年级';
$njlist[$nian - 4] = '五年级';
$njlist[$nian - 5] = '六年级';
// 获取年级最大数
$sys = new \app\system\model\SystemBase;
$gradeMax = $sys->order('id')->value('grademax');
$njlist = array();
for($i = 0; $i < $gradeMax; $i ++)
{
$njlist[$nian - $i] = numToWord($i + 1) . '年级';
}
return $njlist;
}
+21 -4
View File
@@ -23,7 +23,7 @@ class Kaohao extends BaseModel
// 查询成绩
$data = $this->where('kaoshi_id', $src['kaoshi_id'])
->field('id, school_id, student_id, ruxuenian, paixu, kaoshi_id, nianji')
->field('id, school_id, student_id, ruxuenian, paixu, kaoshi_id, nianji, banji_id')
->where('banji_id', 'in', $src['banji_id'])
->when(strlen($src['searchval']) > 0, function($query) use($src){
$query->where(function($w) use ($src){
@@ -99,7 +99,7 @@ class Kaohao extends BaseModel
public function getBanjiTitleAttr()
{
$bj = banJiNamelist();
$title = $this->getAttr('nianji') . $bj[$this->getAttr('paixu')];
$title = $this->getAttr('nianji') . self::getBanTitleAttr();
return $title;
}
@@ -107,8 +107,25 @@ class Kaohao extends BaseModel
// 获取不带年级的班级名
public function getBanTitleAttr()
{
$bj = banJiNamelist();
$title = $bj[$this->getAttr('paixu')];
// 获取班级名显示样式
$sys = new \app\system\model\SystemBase;
$alias = $sys->order('id')->value('classalias');
if($alias == true)
{
$bj = new \app\teach\model\Banji;
$title = $bj->where('id', $this->getAttr('banji_id'))->value('alias');
if($title == '')
{
$bj = banJiNamelist();
$title = $bj[$this->getAttr('paixu')];
}else{
$title = $title . '班';
}
}else{
$bj = banJiNamelist();
$title = $bj[$this->getAttr('paixu')];
}
return $title;
}
Loaded 3 of 12 files, more files were not shown because too many files have changed in this diff. Show more