diff --git a/app/chengji/view/index/biaolu.html b/app/chengji/view/index/biaolu.html index 09edff8a..21fecb3f 100644 --- a/app/chengji/view/index/biaolu.html +++ b/app/chengji/view/index/biaolu.html @@ -41,7 +41,7 @@ layui.use('upload', function(){ layer.msg(res.msg); } ,data: { - text: '考试成绩' + category: '1011103' ,serurl:'chengji' } diff --git a/app/common.php b/app/common.php index f87385c2..cc14779c 100644 --- a/app/common.php +++ b/app/common.php @@ -245,9 +245,9 @@ function teacherNames($list = array()) $list['userid'] = session('userid'); $list['oldname'] = $file->getOriginalName(); $list['fieldsize'] = $file->getSize(); - $list['text'] = $list['text']; + $list['category'] = $list['category']; $list['bianjitime'] = $file->getMTime(); - $list['category'] = $file->getOriginalExtension(); + $list['extension'] = $file->getOriginalExtension(); $f = new \app\system\model\Fields; $saveinfo = $f::create($list); } diff --git a/app/renshi/view/student/create_all.html b/app/renshi/view/student/create_all.html index 7c2da379..5bda5a66 100644 --- a/app/renshi/view/student/create_all.html +++ b/app/renshi/view/student/create_all.html @@ -60,7 +60,7 @@ layui.use('upload', function(){ layer.msg(res.msg); } ,data: { - text: '学生信息' + category: '1011102' ,serurl:'student' } diff --git a/app/renshi/view/teacher/create_all.html b/app/renshi/view/teacher/create_all.html index 4f21bb8c..43980fd7 100644 --- a/app/renshi/view/teacher/create_all.html +++ b/app/renshi/view/teacher/create_all.html @@ -60,7 +60,7 @@ layui.use('upload', function(){ layer.msg(res.msg); } ,data: { - text: '教师信息' + category: '1011101' ,serurl:'teacher' } diff --git a/app/system/model/Fields.php b/app/system/model/Fields.php index 0bfbf9f7..87e97aeb 100644 --- a/app/system/model/Fields.php +++ b/app/system/model/Fields.php @@ -40,6 +40,10 @@ class Fields extends Base } ]); } + ,'flCategory'=>function($query){ + $query + ->field('id,title'); + } ]) ->select(); @@ -52,4 +56,10 @@ class Fields extends Base return $this->belongsTo('\app\admin\model\Admin','userid','id'); } + // 文件种类数模型关联 + public function flCategory() + { + return $this->belongsTo('\app\system\model\Category','category','id'); + } + } diff --git a/app/system/view/fields/index.html b/app/system/view/fields/index.html index df20ce27..6812000a 100644 --- a/app/system/view/fields/index.html +++ b/app/system/view/fields/index.html @@ -61,7 +61,14 @@ // 设置列 options.cols=[[ //表头 {type:'checkbox', fixed: 'left'}, - {field: 'text', title: '文件内容',sort: true, minWidth:100}, + {field: 'category', title: '文件种类',sort: true, minWidth:100,templet:function(d){ + var str=''; + if(d.flCategory) + { + str = d.flCategory.title; + } + return str; + }}, {field: 'oldname', title: '原文件名', minWidth:100,sort: true}, {field: "newname",title: '存储文件名', minWidth:280,sort: true}, {field: 'fieldsize', title: '文件大小', minWidth:100,sort: true,templet:function(d){ diff --git a/database/migrations/20181101040801_fields.php b/database/migrations/20181101040801_fields.php index 863a65f1..e32423d9 100644 --- a/database/migrations/20181101040801_fields.php +++ b/database/migrations/20181101040801_fields.php @@ -33,11 +33,11 @@ class Fields extends Migrator // 添加当前表字段 $table - ->addColumn('text','string',['limit'=>100,'null'=>false,'comment'=>'文件内容']) + ->addColumn('category','string',['limit'=>100,'null'=>false,'comment'=>'文件分类']) ->addColumn('oldname','string',['limit'=>100,'null'=>false,'comment'=>'原文件名']) ->addColumn('bianjitime','integer',['limit'=>11,'null'=>true,'comment'=>'最后编辑时间']) ->addColumn('newname','string',['limit'=>100,'null'=>false,'comment'=>'新文件名']) - ->addColumn('category','string',['limit'=>100,'null'=>false,'comment'=>'文件类型']) + ->addColumn('extension','string',['limit'=>100,'null'=>false,'comment'=>'文件扩展名']) ->addColumn('fieldsize','integer',['limit'=>11,'null'=>false,'comment'=>'文件大小']) ->addColumn('hash','string',['limit'=>100,'null'=>false,'comment'=>'散列值']) ->addColumn('userid','integer',['limit'=>11,'null'=>false,'comment'=>'用户ID'])