成绩录入完成

This commit is contained in:
win7 committed 2019-12-19 13:05:25 +08:00
1 parent 1395f15d36
commit d32c43b339
9 files changed
+31 -24

No files matched your search

+12 -8
View File
@@ -110,9 +110,9 @@ class Index extends BaseController
$data = $cjinfo->save();
}else{
$cj->defen = $list['newdefen'];
$cj->kaohaoId = $list['kaohao_id'];
$cj->subjectId = $subject_id;
$cj->userId = session('userid');
$cj->kaohao_id = $list['kaohao_id'];
$cj->subject_id = $subject_id;
$cj->user_id = session('userid');
$data = $cj->save();
}
@@ -183,7 +183,7 @@ class Index extends BaseController
'webtitle'=>'表格录入成绩',
'butname'=>'批传',
'formpost'=>'POST',
'url'=>'/chengji/biaolu',
'url'=>'/chengji/index/saveall',
);
// 模板赋值
@@ -205,12 +205,13 @@ class Index extends BaseController
$excel = new \app\renshi\controller\Myexcel;
// 读取表格数据
$cjinfo = $excel->readXls($url);
// 读取表格数据
$cjinfo = $excel->readXls(public_path().'public\\uploads\\'.$url);
// 删除空单元格得到学科列名数组
array_splice($cjinfo[1],0,4);
$xk = $cjinfo[1];
// 删除成绩采集表无用的标题行得到成绩数组
array_splice($cjinfo,0,3);
@@ -218,12 +219,13 @@ class Index extends BaseController
$kh = new Kaohao;
$ks = new \app\kaoshi\model\Kaoshi;
$user_id = session('userid');
// 重新组合成绩信息
foreach ($cjinfo as $key => $value) {
foreach ($xk as $k => $val) {
$thissbj = $val; # 当前学科
// $thissbj = $val; # 当前学科
$defen = $value[$k+4]; # 当前学科
// 如果不存在值,跳过这次循环
@@ -245,10 +247,12 @@ class Index extends BaseController
->where('kaohao_id',$value[1])
->where('subject_id',$val)
->find();
// 如果存在则删除
if($cj){
$cj->delete(true);
$cj->force()->delete();
}
$data = Chengji::create([
'kaohao_id'=>$value[1],
'subject_id'=>$val,
+1 -1
View File
@@ -14,7 +14,7 @@ use think\facade\Route;
// 成绩管理
Route::group('index', function () {
Route::rule('malu','Index/malu','get'); # 扫码界面
Route::rule('malusave','Index/malusave','post'); # 扫码保存
Route::rule('malusave','Index/malusave','put'); # 扫码保存
Route::rule('read','Index/read','post'); # 成绩读取
Route::rule('biaolu','Index/biaolu','get'); # 保存信息
Route::rule('saveall','Index/saveAll','post'); # 读取信息
+2 -2
View File
@@ -33,7 +33,7 @@ layui.use('upload', function(){
//执行实例
var uploadInst = upload.render({
elem: '#upload' //绑定元素
,url: "{:url('upload')}" //上传接口
,url: "/renshi/teacher/upload" //上传接口
,done: function(res){
if(res.val == 1){
$('#url').val(res.url);
@@ -42,7 +42,7 @@ layui.use('upload', function(){
}
,data: {
text: '考试成绩'
,serurl:'chengji\\'
,serurl:'chengji'
}
,acceptMime:'.xls,.xlsx'
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff. Show more