合并auth
This commit is contained in:
commit
d46d91f2ac
10 files changed
+304
-15
No files matched your search
@@ -523,7 +523,15 @@ class Index extends BaseController
|
||||
$sheet->setCellValue('A' . $i, $i - 3);
|
||||
$sheet->setCellValue('B' . $i, $md5::encrypt((string)$kh->id, 'dlbz'));
|
||||
$sheet->setCellValue('C' . $i, $bj->banjiTitle);
|
||||
$sheet->setCellValue('D' . $i, $kh->cjStudent->xingming);
|
||||
$sheet->setCellValue('D' . $i, $kh->cjStudent['xingming']);
|
||||
// if(isset($kh->cjStudent->xingming))
|
||||
// {
|
||||
// $sheet->setCellValue('D' . $i, $kh->cjStudent->xingming);
|
||||
// }else{
|
||||
// halt($kh->toArray());
|
||||
// $sheet->setCellValue('D' . $i, '学生已经被删除');
|
||||
// }
|
||||
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ class Student extends BaseModel
|
||||
// 获取电子表格中身份证号
|
||||
$xlsStuList = array_column($value, 2);
|
||||
$xlsStuList = array_map('strtoupper', $xlsStuList); # 将小写字母转换成大写字母
|
||||
$xlsStuList = array_map('trim', $xlsStuList); # 将大写字母转换成小写字母
|
||||
$xlsStuList = array_map('trim', $xlsStuList); # 过滤空格
|
||||
|
||||
// 获取数据库中身份证号
|
||||
$serStulist = self::withTrashed()
|
||||
@@ -230,8 +230,10 @@ class Student extends BaseModel
|
||||
$add = array_diff($xlsStuList, $sfzh);
|
||||
$del = array_diff($sfzh, $xlsStuList);
|
||||
|
||||
|
||||
|
||||
// 从新增的数据中查找是否有已经存在,但是班级不正确的信息。
|
||||
$add_temp = self::onlyTrashed()
|
||||
$add_temp = self::withTrashed()
|
||||
->where('shenfenzhenghao', 'in', $add)
|
||||
->field('shenfenzhenghao')
|
||||
->column('shenfenzhenghao', 'id');
|
||||
@@ -259,7 +261,7 @@ class Student extends BaseModel
|
||||
$shoupin = $pinyin->abbr($value[$jj_k][1]);
|
||||
|
||||
$oneStu->xingming = $value[$jj_k][1];
|
||||
$oneStu->banji = $key;
|
||||
$oneStu->banji_id = $key;
|
||||
$oneStu->quanpin = trim(strtolower(str_replace(' ', '', $quanpin)));
|
||||
$oneStu->shoupin = trim(strtolower(str_replace(' ', '', $shoupin)));
|
||||
$oneStu->save();
|
||||
|
||||
@@ -95,4 +95,197 @@ class SystemBase extends AdminBase
|
||||
return json($data);
|
||||
}
|
||||
|
||||
|
||||
// 系统初始化
|
||||
public function resetMayi()
|
||||
{
|
||||
|
||||
$data = ['msg' => '初始化成功', 'val' => 1];
|
||||
try {
|
||||
// 删除管理员
|
||||
$obj = new \app\admin\model\Admin;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 2);
|
||||
});
|
||||
|
||||
// 删除用户组
|
||||
$obj = new \app\admin\model\AuthGroup;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 1);
|
||||
});
|
||||
|
||||
// 删除用户与用户组对应
|
||||
$obj = new \app\admin\model\AuthGroupAccess;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除班主任
|
||||
$obj = new \app\teach\model\BanZhuRen;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除班级
|
||||
$obj = new \app\teach\model\Banji;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除成绩
|
||||
$obj = new \app\chengji\model\Chengji;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除单位荣誉
|
||||
$obj = new \app\rongyu\model\DwRongyu;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除单位荣誉参与
|
||||
$obj = new \app\rongyu\model\DwRongyuCanyu;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// // 删除分工
|
||||
// $obj = new \app\rongyu\model\FenGong;
|
||||
// $list = $obj::destroy(function ($query) {
|
||||
// $query->where('id', '>', 0);
|
||||
// });
|
||||
//
|
||||
// 删除文件
|
||||
$obj = new \app\system\model\Fields;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除教师荣誉
|
||||
$obj = new \app\rongyu\model\JsRongyu;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除教师荣誉参与
|
||||
$obj = new \app\rongyu\model\JsRongyuCanyu;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除教师荣誉信息
|
||||
$obj = new \app\rongyu\model\JsRongyuInfo;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除考号
|
||||
$obj = new \app\kaohao\model\Kaohao;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除考试
|
||||
$obj = new \app\kaoshi\model\Kaoshi;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除单位荣誉参与
|
||||
$obj = new \app\kaoshi\model\KaoshiSet;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除课程表
|
||||
// $obj = new \app\rongyu\model\DwRongyuCanyu;
|
||||
// $list = $obj::destroy(function ($query) {
|
||||
// $query->where('id', '>', 0);
|
||||
// });
|
||||
//
|
||||
// 删除课程表临时表
|
||||
// $obj = new \app\rongyu\model\DwRongyuCanyu;
|
||||
// $list = $obj::destroy(function ($query) {
|
||||
// $query->where('id', '>', 0);
|
||||
// });
|
||||
//
|
||||
// 删除课节
|
||||
// $obj = new \app\rongyu\model\DwRongyuCanyu;
|
||||
// $list = $obj::destroy(function ($query) {
|
||||
// $query->where('id', '>', 0);
|
||||
// });
|
||||
//
|
||||
// 删除课题删
|
||||
$obj = new \app\keti\model\Keti;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除课题参与
|
||||
$obj = new \app\keti\model\KetiCanyu;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除课题信息
|
||||
$obj = new \app\keti\model\ketiInfo;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除单位
|
||||
$obj = new \app\system\model\School;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除学生信息
|
||||
$obj = new \app\student\model\Student;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除教师信息
|
||||
$obj = new \app\teacher\model\Teacher;
|
||||
$list = $obj::where('id', '>', 1)->delete();
|
||||
|
||||
// 删除班级成绩统计
|
||||
$obj = new \app\chengji\model\TongjiBj;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除统计记录
|
||||
$obj = new \app\kaoshi\model\TongjiLog;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除年级成绩统计
|
||||
$obj = new \app\chengji\model\TongjiNj;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除学校成绩统计
|
||||
$obj = new \app\chengji\model\TongjiSch;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 0);
|
||||
});
|
||||
|
||||
// 删除学期
|
||||
$obj = new \app\teach\model\Xueqi;
|
||||
$list = $obj::destroy(function ($query) {
|
||||
$query->where('id', '>', 1);
|
||||
});
|
||||
|
||||
} catch (ValidateException $e) {
|
||||
$data = ['msg' => '初始化失败', 'val' => 0];
|
||||
}
|
||||
|
||||
// 返回信息
|
||||
return json($data);
|
||||
}
|
||||
|
||||
}
|
||||
Loaded 3 of 10 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user