修改教师批传
This commit is contained in:
1 parent
be91aab61d
commit
968fb4f87a
7 files changed
+108
-39
No files matched your search
@@ -1,2 +1,66 @@
|
||||
<?php
|
||||
|
||||
// 性别
|
||||
function srcSex($str)
|
||||
{
|
||||
if($str == '男')
|
||||
{
|
||||
$sex = 1;
|
||||
}else if($str == '女'){
|
||||
$sex = 0;
|
||||
}else{
|
||||
$sex = 2;
|
||||
}
|
||||
return $sex;
|
||||
}
|
||||
|
||||
|
||||
// 查找学科
|
||||
function srcSubject($str)
|
||||
{
|
||||
// 实例化学科数据模型
|
||||
$subject = new \app\teach\model\Subject;
|
||||
|
||||
// 查询学科id
|
||||
$subjectId = $subject->where('title',$str)->value('id');
|
||||
|
||||
return $subjectId;
|
||||
}
|
||||
|
||||
// 查找职务
|
||||
function srcZw($str)
|
||||
{
|
||||
// 实例化类型数据模型
|
||||
$category = new \app\system\model\Category;
|
||||
|
||||
// 查询学科id
|
||||
$categoryId = $category->where('pid',107)->where('title',$str)->value('id');
|
||||
|
||||
return $categoryId;
|
||||
}
|
||||
|
||||
|
||||
// 查找学历
|
||||
function srcXl($str)
|
||||
{
|
||||
// 实例化类型数据模型
|
||||
$category = new \app\system\model\Category;
|
||||
|
||||
// 查询学科id
|
||||
$categoryId = $category->where('pid',105)->where('title',$str)->value('id');
|
||||
|
||||
return $categoryId;
|
||||
}
|
||||
|
||||
// 查找职称
|
||||
function srcZc($str)
|
||||
{
|
||||
// 实例化类型数据模型
|
||||
$category = new \app\system\model\Category;
|
||||
|
||||
// 查询学科id
|
||||
$categoryId = $category->where('pid',106)->where('title',$str)->value('id');
|
||||
|
||||
return $categoryId;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class Index extends Base
|
||||
}
|
||||
|
||||
$datacnt = $data->count();
|
||||
$data = $data->append(['age']);
|
||||
$data = $data->append(['age','gongling']);
|
||||
|
||||
|
||||
|
||||
@@ -276,32 +276,25 @@ class Index extends Base
|
||||
|
||||
// 整理数据
|
||||
$teacherlist[$i]['xingming'] = $value[1];
|
||||
if($value[2] == '男')
|
||||
{
|
||||
$teacherlist[$i]['sex'] = 1;
|
||||
}else if($value[2] == '女'){
|
||||
$teacherlist[$i]['sex'] = 0;
|
||||
}else{
|
||||
$teacherlist[$i]['sex'] = 2;
|
||||
}
|
||||
$teacherlist[$i]['sex'] = srcSex($value[2]);
|
||||
$teacherlist[$i]['shengri'] = $value[3];
|
||||
$teacherlist[$i]['worktime'] = $value[4];
|
||||
$teacherlist[$i]['zhiwu'] = $value[5];
|
||||
$teacherlist[$i]['zhiwu'] = srcZw($value[5]);
|
||||
$teacherlist[$i]['zhicheng'] = srcZc($value[6]);
|
||||
$teacherlist[$i]['danwei'] = $list['school'];
|
||||
$teacherlist[$i]['biey'] = $value[8];
|
||||
$teacherlist[$i]['biye'] = $value[8];
|
||||
$teacherlist[$i]['zhuanye'] = $value[9];
|
||||
$teacherlist[$i]['xueli'] = $value[10];
|
||||
$teacherlist[$i]['xueli'] = srcXl($value[10]);
|
||||
$teacherlist[$i]['quanpin'] = $value[11];
|
||||
$teacherlist[$i]['shoupin'] = $value[12];
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
// 实例化学生信息数据模型
|
||||
$teacher = new Teacher();
|
||||
|
||||
// dump($teacherlist);
|
||||
// dump($teacherinfo[0]);
|
||||
|
||||
// 保存或更新信息
|
||||
$data = $teacher->saveAll($teacherlist);
|
||||
|
||||
@@ -22,7 +22,7 @@ class Teacher extends Base
|
||||
// 参加工作时间获取器
|
||||
public function getWorktimeAttr($value)
|
||||
{
|
||||
return date('Y-m',$value);
|
||||
return date('Y-m-d',$value);
|
||||
}
|
||||
|
||||
// 参加工作时间修改器
|
||||
@@ -81,4 +81,11 @@ class Teacher extends Base
|
||||
}
|
||||
|
||||
|
||||
// 工龄获取器
|
||||
public function getGonglingAttr()
|
||||
{
|
||||
return getAgeByBirth($this->getdata('worktime'),2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loaded 3 of 7 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user