diff --git a/application/keti/controller/Index.php b/application/keti/controller/Index.php index 3c39fea1..bec0d710 100644 --- a/application/keti/controller/Index.php +++ b/application/keti/controller/Index.php @@ -6,7 +6,7 @@ namespace app\keti\controller; use app\common\controller\Base; // 引用课题数据模型 -use app\keti\model\Keti as kt; +use app\keti\model\Keti as keti; class Index extends Base { @@ -18,7 +18,7 @@ class Index extends Base public function index() { // 设置数据总数 - $list['count'] = kt::count(); + $list['count'] = keti::count(); // 设置页面标题 $list['title'] = '课题列表'; @@ -29,6 +29,68 @@ class Index extends Base return $this->fetch(); } + + + /** + * 显示课题册列表 + * + * @return \think\Response + */ + public function ajaxData() + { + // 获取DT的传值 + $getdt = request()->param(); + + //得到排序的方式 + $order = $getdt['order'][0]['dir']; + //得到排序字段的下标 + $order_column = $getdt['order'][0]['column']; + //根据排序字段的下标得到排序字段 + $order_field = $getdt['columns'][$order_column]['name']; + if($order_field=='') + { + $order_field = $getdt['columns'][$order_column]['data']; + } + //得到limit参数 + $limit_start = $getdt['start']; + $limit_length = $getdt['length']; + + //得到搜索的关键词 + $search = [ + 'lxdanweiid'=>$getdt['lxdanweiid'], + 'category'=>$getdt['category'], + 'search'=>$getdt['search']['value'], + 'order'=>$order, + 'order_field'=>$order_field + ]; + + // 实例化 + $keti = new keti; + + // 获取荣誉总数 + $cnt = $keti->select()->count(); + + // 查询数据 + $data = $keti->search($search); + $datacnt = $data->count(); + + // 获取当前页数据 + $data = $data->slice($limit_start,$limit_length); + + + // 重组返回内容 + $data = [ + 'draw'=> $getdt["draw"] , // ajax请求次数,作为标识符 + 'recordsTotal'=>$cnt, // 获取到的结果数(每页显示数量) + 'recordsFiltered'=>$datacnt, // 符合条件的总数据量 + 'data'=>$data, //获取到的数据结果 + ]; + + return json($data); + } + + + /** * 显示创建资源表单页. * @@ -36,7 +98,14 @@ class Index extends Base */ public function create() { - // + // 设置页面标题 + $list['title'] = '添加课题册'; + + // 模板赋值 + $this->assign('list',$list); + + // 渲染 + return $this->fetch(); } /** @@ -45,9 +114,29 @@ class Index extends Base * @param \think\Request $request * @return \think\Response */ - public function save(Request $request) + public function save() { - // + // 获取表单数据 + $list = request()->only(['title','category','lxshijian','lxdanweiid'],'post'); + + // 实例化验证模型 + $validate = new \app\keti\validate\Keti; + // 验证表单数据 + $result = $validate->check($list); + $msg = $validate->getError(); + // 如果验证不通过则停止保存 + if(!$result){ + return json(['msg'=>$msg,'val'=>0]);; + } + + // 保存数据 + $data = keti::create($list); + + // 根据更新结果设置返回提示信息 + $data ? $data=['msg'=>'添加成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; + + // 返回信息 + return json($data); } /** @@ -69,7 +158,15 @@ class Index extends Base */ public function edit($id) { - // + // 获取荣誉册信息 + $list = keti::where('id',$id) + ->field('id,title,category,lxshijian,lxdanweiid') + ->find(); + + + $this->assign('list',$list); + + return $this->fetch(); } /** @@ -79,9 +176,33 @@ class Index extends Base * @param int $id * @return \think\Response */ - public function update(Request $request, $id) + public function update($id) { - // + // 获取表单数据 + $list = request()->only(['title','category','lxshijian','lxdanweiid'],'put'); + $list['id'] = $id; + + + // 实例化验证类 + $validate = new \app\keti\validate\Keti; + // 验证表单数据 + $result = $validate->check($list); + $msg = $validate->getError(); + + // 如果验证不通过则停止保存 + if(!$result){ + return json(['msg'=>$msg,'val'=>0]);; + } + + + // 更新数据 + $data = keti::update($list); + + // 根据更新结果设置返回提示信息 + $data ? $data=['msg'=>'更新成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; + + // 返回信息 + return json($data); } /** @@ -92,6 +213,39 @@ class Index extends Base */ public function delete($id) { - // + if($id == 'm') + { + $id = request()->delete('ids/a');// 获取delete请求方式传送过来的数据并转换成数据 + } + + $data = keti::destroy($id); + + // 根据更新结果设置返回提示信息 + $data ? $data=['msg'=>'删除成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; + + // 返回信息 + return json($data); } + + + + // 设置荣誉状态 + public function setStatus() + { + + // 获取id变量 + $id = request()->post('id'); + $value = request()->post('value'); + + // 获取学生信息 + $data = keti::where('id',$id)->update(['status'=>$value]); + + // 根据更新结果设置返回提示信息 + $data ? $data=['msg'=>'状态设置成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; + + // 返回信息 + return json($data); + } + + } diff --git a/application/keti/controller/KetiInfo.php b/application/keti/controller/KetiInfo.php new file mode 100644 index 00000000..ceff9100 --- /dev/null +++ b/application/keti/controller/KetiInfo.php @@ -0,0 +1,184 @@ +assign('list', $list); + + // 渲染模板 + return $this->fetch(); + } + + + + /** + * 显示课题信息列表 + * + * @return \think\Response + */ + public function ajaxData() + { + // 获取DT的传值 + $getdt = request()->param(); + + //得到排序的方式 + $order = $getdt['order'][0]['dir']; + //得到排序字段的下标 + $order_column = $getdt['order'][0]['column']; + //根据排序字段的下标得到排序字段 + $order_field = $getdt['columns'][$order_column]['name']; + if($order_field=='') + { + $order_field = $getdt['columns'][$order_column]['data']; + } + //得到limit参数 + $limit_start = $getdt['start']; + $limit_length = $getdt['length']; + + //得到搜索的关键词 + $search = [ + 'lxdanweiid'=>$getdt['lxdanweiid'], + 'category'=>$getdt['category'], + 'fzschool'=>$getdt['fzschool'], + 'search'=>$getdt['search']['value'], + 'order'=>$order, + 'order_field'=>$order_field + ]; + + // 实例化 + $keti = new ktinfo; + + // 获取荣誉总数 + $cnt = $keti->select()->count(); + + // 查询数据 + $data = $keti->search($search); + $datacnt = $data->count(); + + // 获取当前页数据 + $data = $data->slice($limit_start,$limit_length); + + + // 重组返回内容 + $data = [ + 'draw'=> $getdt["draw"] , // ajax请求次数,作为标识符 + 'recordsTotal'=>$cnt, // 获取到的结果数(每页显示数量) + 'recordsFiltered'=>$datacnt, // 符合条件的总数据量 + 'data'=>$data, //获取到的数据结果 + ]; + + return json($data); + } + + + + + /** + * 显示创建资源表单页. + * + * @return \think\Response + */ + public function create($id=0) + { + // 设置页面标题 + $list['title'] = '添加课题信息'; + $list['ketice'] = $id; + + // 模板赋值 + $this->assign('list',$list); + + // 渲染 + return $this->fetch(); + } + + /** + * 保存新建的资源 + * + * @param \think\Request $request + * @return \think\Response + */ + public function save(Request $request) + { + // + } + + + // 批量上传立项通知书 + public function createall($id){ + dump($id); + } + + + /** + * 显示指定的资源 + * + * @param int $id + * @return \think\Response + */ + public function read($id) + { + // + } + + /** + * 显示编辑资源表单页. + * + * @param int $id + * @return \think\Response + */ + public function edit($id) + { + // + } + + /** + * 保存更新的资源 + * + * @param \think\Request $request + * @param int $id + * @return \think\Response + */ + public function update(Request $request, $id) + { + // + } + + /** + * 删除指定资源 + * + * @param int $id + * @return \think\Response + */ + public function delete($id) + { + // + } + + + + // 课题册 + public function KetiCe($id) + { + dump($id); + } +} diff --git a/application/keti/model/Keti.php b/application/keti/model/Keti.php index 8886e171..ada2c6d1 100644 --- a/application/keti/model/Keti.php +++ b/application/keti/model/Keti.php @@ -5,7 +5,99 @@ namespace app\keti\model; // 引用数据模型基类 use app\common\model\Base; + class Keti extends Base { - // + //搜索课题册 + public function search($search) + { + // 获取参数 + $lxdanweiid = $search['lxdanweiid']; + $category = $search['category']; + $order_field = $search['order_field']; + $order = $search['order']; + $category = $search['category']; + $search = $search['search']; + + $data = $this->order([$order_field =>$order]) + ->when(!empty($lxdanweiid),function($query) use($lxdanweiid){ + $query->where('lxdanweiid','in',$lxdanweiid); + }) + ->when(!empty($category),function($query) use($category){ + $query->where('category','in',$category); + }) + ->when(!empty($search),function($query) use($search){ + $query->where('title','like',$search); + }) + ->with( + [ + 'ktCategory'=>function($query){ + $query->field('id,title'); + }, + 'ktLxdanwei'=>function($query){ + $query->field('id,title'); + }, + ] + ) + ->append(['ktcnt','jtcnt']) + ->select(); + + + return $data; + } + + + // 类型关联 + public function ktCategory() + { + return $this->belongsTo('\app\system\model\Category','category','id'); + } + + + // 立项单位关联 + public function ktLxdanwei() + { + return $this->belongsTo('\app\system\model\School','lxdanweiid','id'); + } + + + // 课题信息关联 + public function ktInfo() + { + return $this->hasMany('KetiInfo','ketice','id'); + } + + + // 立项时间获取器 + public function getLxshijianAttr($value) + { + if ($value>0) + { + $value = date('Y-m-d',$value); + }else{ + $value = ""; + } + return $value; + } + + + // 立项时间 + public function setLxshijianAttr($value) + { + return strtotime($value); + } + + + // 课题数量 + public function getKtcntAttr() + { + return $this->ktInfo->count(); + } + + + // 结题课题数量 + public function getJtcntAttr() + { + return $this->ktInfo->where('jddengji','>',0)->where('jtshijian','>',0)->count(); + } } diff --git a/application/keti/model/KetiCanyu.php b/application/keti/model/KetiCanyu.php new file mode 100644 index 00000000..816fdb5b --- /dev/null +++ b/application/keti/model/KetiCanyu.php @@ -0,0 +1,10 @@ +order([$order_field =>$order]) + ->when(!empty($lxdanweiid),function($query) use($lxdanweiid){ + $query->where('lxdanweiid','in',$lxdanweiid); + }) + ->when(!empty($category),function($query) use($category){ + $query->where('category','in',$category); + }) + ->when(!empty($fzschool),function($query) use($fzschool){ + $query->where('title','in',$fzschool); + }) + ->when(!empty($search),function($query) use($search){ + $query->where('title','like',$search); + }) + // ->with( + // [ + // 'ktCategory'=>function($query){ + // $query->field('id,title'); + // }, + // 'ktLxdanwei'=>function($query){ + // $query->field('id,title'); + // }, + // ] + // ) + // ->append(['ktcnt','jtcnt']) + ->select(); + + + return $data; + } +} diff --git a/application/keti/validate/Keti.php b/application/keti/validate/Keti.php index bc76e2cf..4ac222aa 100644 --- a/application/keti/validate/Keti.php +++ b/application/keti/validate/Keti.php @@ -12,7 +12,12 @@ class Keti extends Validate * * @var array */ - protected $rule = []; + protected $rule = [ + 'title|课题册标题' => 'require|length:1,30', + 'category|课题类型' => 'require|number', + 'lxshijian|立项时间' => 'require|date', + 'lxdanweiid|立项单位' => 'require|number', + ]; /** * 定义错误信息 diff --git a/application/keti/validate/KetiInfo.php b/application/keti/validate/KetiInfo.php new file mode 100644 index 00000000..9d72bc1c --- /dev/null +++ b/application/keti/validate/KetiInfo.php @@ -0,0 +1,24 @@ + ['规则1','规则2'...] + * + * @var array + */ + protected $rule = []; + + /** + * 定义错误信息 + * 格式:'字段名.规则名' => '错误信息' + * + * @var array + */ + protected $message = []; +} diff --git a/application/keti/view/index/create.html b/application/keti/view/index/create.html index 5ffbe321..b4c30cdc 100644 --- a/application/keti/view/index/create.html +++ b/application/keti/view/index/create.html @@ -2,20 +2,20 @@ {block name="mycss"} {/block} {block name="formaa"} -
+
- +
- +
- +
- {php}$category = getCategory(112);{/php} + {php}$category = getCategory(115);{/php} - + +
@@ -61,9 +61,10 @@ // 设置表单验证规则 var myrules = { title:{ - maxlength:30, + required:true, + maxlength:60, }, - fzshijian:{ + lxshijian:{ required:true, dateISO:true }, diff --git a/application/keti/view/index/edit.html b/application/keti/view/index/edit.html index ee86b726..c7c09184 100644 --- a/application/keti/view/index/edit.html +++ b/application/keti/view/index/edit.html @@ -2,20 +2,20 @@ {block name="mycss"} {/block} {block name="formaa"} - +
- +
- +
- +
- {php}$category = getCategory(112);{/php} + {php}$category = getCategory(115);{/php} - +
- +
- +
@@ -61,9 +61,10 @@ // 设置表单验证规则 var myrules = { title:{ - maxlength:30, + required:true, + maxlength:60, }, - fzshijian:{ + lxshijian:{ required:true, dateISO:true }, diff --git a/application/keti/view/index/index.html b/application/keti/view/index/index.html index cf316dce..44d42cfa 100644 --- a/application/keti/view/index/index.html +++ b/application/keti/view/index/index.html @@ -2,8 +2,8 @@ {block name="topnav"}
-
筛选荣誉册
+
筛选课题册
{php} $school = schlist('区级','部级'); {/php} - +
{foreach $school as $key=>$vo } {/foreach} @@ -50,8 +50,8 @@
- {php}$category = getCategory(112);{/php} - + {php}$category = getCategory(115);{/php} +
{foreach $category as $key=>$vo } @@ -71,11 +71,12 @@ - 荣誉册名称 - 颁奖单位 - 荣誉类别 - 荣誉数量 - 颁奖时间 + 课题册名称 + 立项单位 + 课题类别 + 课题数量 + 结题数量 + 立项时间 状态 操作 @@ -94,9 +95,9 @@ url: "{:url('ajaxdata')}", type: "post", data: { - fzschool:function(){ + lxdanweiid:function(){ var chk = []; - $('input[name="fzschool"]:checked').each(function(){ + $('input[name="lxdanweiid"]:checked').each(function(){ if(typeof($(this).val()) != "undefined") { chk.push($(this).val()); @@ -121,10 +122,11 @@ var mycolumns = [ { "data": "id" }, { "data": "title","defaultContent": "" }, - { "data": "fz_school.jiancheng" ,"name":"fzschool","defaultContent": ""}, - { "data": "lx_category.title","name":"category","defaultContent": ""}, - { "data": "cnt","name":"id","defaultContent": ""}, - { "data": "fzshijian" ,"defaultContent": ""}, + { "data": "kt_lxdanwei.title" ,"name":"lxdanweiid","defaultContent": ""}, + { "data": "kt_category.title","name":"category","defaultContent": ""}, + { "data": "ktcnt","name":"id","defaultContent": ""}, + { "data": "jtcnt","name":"id","defaultContent": ""}, + { "data": "lxshijian","name":"lxshijian","defaultContent": ""}, { "data": "status" }, { "data": "id" }, ]; @@ -138,6 +140,12 @@ return '' } }, + { + "targets": 1, + "render": function(data, type, row, meta) { + return ''+row.title+'册' + } + }, { "targets": -1, "className":'.td-manage', @@ -148,12 +156,12 @@ startbut = ''; // 上图图片按钮 - picbut = ''; + picbut = ''; // 添加荣誉 - addbut = ''; + addbut = ''; // 编辑按钮 - editbut = ''; - delbut = ''; + editbut = ''; + delbut = ''; if(row.status == '已停用') { buts = startbut; diff --git a/application/keti/view/keti_info/create.html b/application/keti/view/keti_info/create.html new file mode 100644 index 00000000..fe71fd70 --- /dev/null +++ b/application/keti/view/keti_info/create.html @@ -0,0 +1,77 @@ +{extend name="common@create" /} +{block name="mycss"} +{/block} +{block name="formaa"} + +
+ +
+ +
+
+
+ +
+ + {php}$category = getCategory(115);{/php} + + +
+
+
+ +
+ + {php} $school = schlist('区级','其它级');{/php} + + +
+
+
+ +
+ +
+
+
+
+ +
+
+
+{/block} +{block name="yanzheng"} + +{/block} \ No newline at end of file diff --git a/application/keti/view/index/createall.html b/application/keti/view/keti_info/createall.html similarity index 100% rename from application/keti/view/index/createall.html rename to application/keti/view/keti_info/createall.html diff --git a/application/keti/view/keti_info/edit.html b/application/keti/view/keti_info/edit.html new file mode 100644 index 00000000..22696216 --- /dev/null +++ b/application/keti/view/keti_info/edit.html @@ -0,0 +1,77 @@ +{extend name="common@create" /} +{block name="mycss"} +{/block} +{block name="formaa"} +
+
+ +
+ +
+
+
+ +
+ + {php}$category = getCategory(115);{/php} + + +
+
+
+ +
+ + {php} $school = schlist('区级','其它级');{/php} + + +
+
+
+ +
+ +
+
+
+
+ +
+
+
+{/block} +{block name="yanzheng"} + +{/block} \ No newline at end of file diff --git a/application/keti/view/keti_info/index.html b/application/keti/view/keti_info/index.html new file mode 100644 index 00000000..1ace0044 --- /dev/null +++ b/application/keti/view/keti_info/index.html @@ -0,0 +1,226 @@ +{extend name="common@list" /} +{block name="topnav"} + +{/block} +{block name="bouttons"} +
+ + + + + 批量删除 + + + + + 共有数据:{$list.count} 条 + +
+
+
筛选课题册
+
+
+ {php} + $school = schlist('区级','部级'); + {/php} + +
+
+ {foreach $school as $key=>$vo } + + {/foreach} +
+ +
+
+ {php}$category = getCategory(115);{/php} + +
+
+ {foreach $category as $key=>$vo } + + {/foreach} +
+ +
+
+ {php} + $school = schlist('校级','区级'); + {/php} + +
+
+ {foreach $school as $key=>$vo } + + {/foreach} +
+ +
+
+
+{/block} +{block name="tables"} + + + + + + + + + + + + + + + + +
课题册名称立项单位课题类别课题数量结题数量立项时间状态操作
+ + +{/block} +{block name="myjs"} + +{/block} \ No newline at end of file diff --git a/application/rongyu/controller/JsRongyu.php b/application/rongyu/controller/JsRongyu.php index e4cad51d..d30b0bbf 100644 --- a/application/rongyu/controller/JsRongyu.php +++ b/application/rongyu/controller/JsRongyu.php @@ -177,7 +177,7 @@ class JsRongyu extends Base */ public function edit($id) { - // 获取学生信息 + // 获取荣誉册信息 $list = jsry::where('id',$id) ->field('id,title,category,fzshijian,fzschool') ->find(); diff --git a/application/rongyu/controller/JsRongyuInfo.php b/application/rongyu/controller/JsRongyuInfo.php index 41a632f3..32d1092e 100644 --- a/application/rongyu/controller/JsRongyuInfo.php +++ b/application/rongyu/controller/JsRongyuInfo.php @@ -95,7 +95,7 @@ class JsRongyuInfo extends Base public function create($id = 0) { // 设置页面标题 - $list['title'] = '添加教师荣誉册'; + $list['title'] = '添加教师荣誉'; $list['id'] = $id; // 模板赋值 diff --git a/application/rongyu/model/JsRongyu.php b/application/rongyu/model/JsRongyu.php index 37470b13..b02c7a48 100644 --- a/application/rongyu/model/JsRongyu.php +++ b/application/rongyu/model/JsRongyu.php @@ -7,7 +7,7 @@ use app\common\model\Base; class JsRongyu extends Base { - //搜索单位获奖荣誉 + //搜索教师获奖荣誉 public function search($search) { // 获取参数 diff --git a/application/rongyu/view/js_rongyu/index.html b/application/rongyu/view/js_rongyu/index.html index eec151c1..b49ba262 100644 --- a/application/rongyu/view/js_rongyu/index.html +++ b/application/rongyu/view/js_rongyu/index.html @@ -21,7 +21,7 @@ 批量删除 - + 添加荣誉册 diff --git a/application/rongyu/view/js_rongyu_info/index.html b/application/rongyu/view/js_rongyu_info/index.html index d435fb1e..ea01ed52 100644 --- a/application/rongyu/view/js_rongyu_info/index.html +++ b/application/rongyu/view/js_rongyu_info/index.html @@ -178,7 +178,7 @@ startbut = ''; // 编辑按钮 editbut = ''; - delbut = ''; + delbut = ''; if(row.status == '已停用') { buts = startbut; diff --git a/database/migrations/20190214052203_js_rongyu_canyu.php b/database/migrations/20190214052203_js_rongyu_canyu.php index ac7ac46f..b9be8a0f 100644 --- a/database/migrations/20190214052203_js_rongyu_canyu.php +++ b/database/migrations/20190214052203_js_rongyu_canyu.php @@ -34,8 +34,8 @@ class JsRongyuCanyu extends Migrator // 添加当前表字段 $table ->addColumn('category','integer',['limit'=>1,'null'=>false,'default'=>0,'comment'=>'获奖人或参与人,1=>获奖人,2=>参与人']) - ->addColumn('rongyuid','integer',['limit'=>11,'null'=>false,'comment'=>'荣誉id']) - ->addColumn('teacherid','integer',['limit'=>11,'null'=>false,'comment'=>'获奖单位']) + ->addColumn('rongyuid','integer',['limit'=>11,'null'=>false,'comment'=>'荣誉id'])// rongyuid应该改成rongyuinfoid + ->addColumn('teacherid','integer',['limit'=>11,'null'=>false,'comment'=>'教师id']) ->create(); } } diff --git a/database/migrations/20190218055858_keti.php b/database/migrations/20190218055858_keti.php index 0faf2ac8..21b6858c 100644 --- a/database/migrations/20190218055858_keti.php +++ b/database/migrations/20190218055858_keti.php @@ -33,23 +33,15 @@ class Keti extends Migrator // 添加当前表字段 $table - ->addColumn('title','integer',['limit'=>1,'null'=>false,'default'=>0,'comment'=>'课题名称']) - ->addColumn('bianhao','string',['limit'=>11,'null'=>false,'comment'=>'课题编号']) - ->addColumn('lxpic','string',['limit'=>100,'null'=>false,'comment'=>'立项证书图片']) + ->addColumn('title','string',['limit'=>60,'null'=>false,'default'=>0,'comment'=>'课题册名称']) ->addColumn('lxshijian','integer',['limit'=>11,'null'=>false,'comment'=>'立项时间']) - ->addColumn('subject','integer',['limit'=>11,'null'=>false,'comment'=>'学科分类']) - ->addColumn('fzdanweiid','integer',['limit'=>11,'null'=>false,'comment'=>'负责单位id']) ->addColumn('lxdanweiid','integer',['limit'=>11,'null'=>false,'comment'=>'立项单位id']) ->addColumn('category','integer',['limit'=>11,'null'=>false,'comment'=>'课题类型']) - ->addColumn('fangxiang','integer',['limit'=>11,'null'=>false,'comment'=>'研究方向']) - ->addColumn('jhjtshijian','integer',['limit'=>11,'null'=>false,'comment'=>'计划结题时间']) - ->addColumn('jtshijian','integer',['limit'=>11,'null'=>false,'comment'=>'结题时间']) - ->addColumn('jddengji','integer',['limit'=>11,'null'=>false,'comment'=>'鉴定等级']) - ->addColumn('jtpic','string',['limit'=>100,'null'=>false,'comment'=>'结题证书图片']) ->addColumn('create_time','integer',['limit'=>11,'null'=>true,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'null'=>true,'comment'=>'更新时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) ->addColumn('beizhu','string',['limit'=>80,'null'=>true,'comment'=>'备注']) + ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常']) ->create(); } } diff --git a/database/migrations/20190222040223_keti_info.php b/database/migrations/20190222040223_keti_info.php new file mode 100644 index 00000000..5e36d137 --- /dev/null +++ b/database/migrations/20190222040223_keti_info.php @@ -0,0 +1,54 @@ +table('keti_info'); + + // 添加当前表字段 + $table + ->addColumn('title','string',['limit'=>60,'null'=>false,'default'=>0,'comment'=>'课题名称']) + ->addColumn('ketice','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'课题册id']) + ->addColumn('bianhao','string',['limit'=>11,'null'=>false,'comment'=>'课题编号']) + ->addColumn('lxpic','string',['limit'=>100,'null'=>false,'comment'=>'立项证书图片']) + ->addColumn('subject','integer',['limit'=>11,'null'=>false,'comment'=>'学科分类']) + ->addColumn('fzdanweiid','integer',['limit'=>11,'null'=>false,'comment'=>'负责单位id']) + ->addColumn('fangxiang','integer',['limit'=>11,'null'=>false,'comment'=>'研究方向']) + ->addColumn('jhjtshijian','integer',['limit'=>11,'null'=>false,'comment'=>'计划结题时间']) + ->addColumn('jtshijian','integer',['limit'=>11,'null'=>false,'comment'=>'结题时间']) + ->addColumn('jddengji','integer',['limit'=>1,'null'=>false,'default'=>0,'comment'=>'鉴定等级:0=>未结题,1=>合格,2=>优秀,3=>流失']) + ->addColumn('jtpic','string',['limit'=>100,'null'=>false,'comment'=>'结题证书图片']) + ->addColumn('create_time','integer',['limit'=>11,'null'=>true,'comment'=>'创建时间']) + ->addColumn('update_time','integer',['limit'=>11,'null'=>true,'comment'=>'更新时间']) + ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) + ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常']) + ->addColumn('beizhu','string',['limit'=>200,'null'=>true,'comment'=>'备注']) + ->create(); + } +} diff --git a/database/migrations/20190222041040_keti_canyu.php b/database/migrations/20190222041040_keti_canyu.php new file mode 100644 index 00000000..78af0361 --- /dev/null +++ b/database/migrations/20190222041040_keti_canyu.php @@ -0,0 +1,41 @@ +table('keti_canyu'); + + // 添加当前表字段 + $table + ->addColumn('category','integer',['limit'=>1,'null'=>false,'default'=>0,'comment'=>'主持人或参与人,1=>主持人,2=>参与人']) + ->addColumn('ketiinfoid','integer',['limit'=>11,'null'=>false,'comment'=>'课题信息id']) + ->addColumn('teacherid','integer',['limit'=>11,'null'=>false,'comment'=>'教师id']) + ->create(); + } +} diff --git a/database/seeds/Category.php b/database/seeds/Category.php index aa78aa96..d5b98686 100644 --- a/database/seeds/Category.php +++ b/database/seeds/Category.php @@ -28,10 +28,11 @@ class Category extends Seeder ['id'=>109,'title'=>'考试','pid'=>0,'paixu'=>9], ['id'=>110,'title'=>'学科','pid'=>0,'paixu'=>10], ['id'=>111,'title'=>'文件','pid'=>0,'paixu'=>11], - ['id'=>112,'title'=>'单位荣誉','pid'=>0,'paixu'=>12], + ['id'=>112,'title'=>'单位荣誉类型','pid'=>0,'paixu'=>12], ['id'=>113,'title'=>'单位荣誉奖项','pid'=>0,'paixu'=>13], - ['id'=>114,'title'=>'教师荣誉','pid'=>0,'paixu'=>14], - ['id'=>115,'title'=>'教师荣誉奖项','pid'=>0,'paixu'=>15], + ['id'=>114,'title'=>'教师荣誉类型','pid'=>0,'paixu'=>14], + ['id'=>115,'title'=>'课题类型','pid'=>0,'paixu'=>15], + // 二级类别 // 大学科 @@ -120,13 +121,18 @@ class Category extends Seeder ['title'=>'二等奖','pid'=>113,'paixu'=>3], ['title'=>'三等奖','pid'=>113,'paixu'=>4], ['title'=>'优秀奖','pid'=>113,'paixu'=>5], + ['title'=>'百十佳','pid'=>113,'paixu'=>6], // 教师荣誉分类 ['title'=>'优质课','pid'=>114,'paixu'=>1], ['title'=>'技能大赛','pid'=>114,'paixu'=>2], ['title'=>'论文','pid'=>114,'paixu'=>3], ['title'=>'教科研','pid'=>114,'paixu'=>4], - - + ['title'=>'荣誉称号','pid'=>114,'paixu'=>4], + // 课题类型 + ['title'=>'一般课题','pid'=>115,'paixu'=>1], + ['title'=>'专项课题','pid'=>115,'paixu'=>2], + ['title'=>'重大或重点课题','pid'=>115,'paixu'=>3], + ]; // 保存数据 $this->table('category')->insert($rows)->save(); diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index b237a8c8..a01f0edd 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -64,7 +64,8 @@ class Rule extends Seeder ['id'=>804,'title'=>'学生荣誉','name'=>'rongyu/StuRongyu/index','paixu'=>7,'ismenu' =>true,'pid' =>8,'url'=>'/xsry','status'=>0], // 荣誉管理 - ['id'=>901,'title'=>'课题管理','name'=>'keti/Index/index','paixu'=>1,'ismenu' =>true,'pid' =>9,'url'=>'/kt',], + ['id'=>901,'title'=>'课题册','name'=>'keti/Index/index','paixu'=>1,'ismenu' =>true,'pid' =>9,'url'=>'/kt',], + ['id'=>902,'title'=>'课题列表','name'=>'ketiinfo/Index/index','paixu'=>2,'ismenu' =>true,'pid' =>9,'url'=>'/ktinfo',], @@ -197,12 +198,20 @@ class Rule extends Seeder // 课题管理 + // 课题册 ['title'=>'添加','name'=>'keti/index/create','paixu' =>1,'pid'=>901], ['title'=>'删除','name'=>'keti/index/delete','paixu'=>2,'pid'=>901], ['title'=>'编辑','name'=>'keti/index/edit','paixu'=>3,'pid'=>901,], - ['title'=>'查看','name'=>'keti/index/read','paixu'=>4,'pid'=>901,], - ['title'=>'状态','name'=>'keti/index/setStatus','paixu'=>5,'pid'=>901], - ['title'=>'批量上传','name'=>'keti/index/createAll','paixu'=>6,'pid'=>901], + ['title'=>'课题信息','name'=>'keti/ketiinfo/KetiCe','paixu'=>4,'pid'=>901,], + ['title'=>'查看','name'=>'keti/index/read','paixu'=>5,'pid'=>901,], + ['title'=>'状态','name'=>'keti/index/setStatus','paixu'=>6,'pid'=>901], + // 课题信息 + ['title'=>'添加','name'=>'ketiinfo/index/create','paixu' =>1,'pid'=>902], + ['title'=>'删除','name'=>'ketiinfo/index/delete','paixu'=>2,'pid'=>902], + ['title'=>'编辑','name'=>'ketiinfo/index/edit','paixu'=>3,'pid'=>902,], + ['title'=>'查看','name'=>'ketiinfo/index/read','paixu'=>4,'pid'=>902,], + ['title'=>'状态','name'=>'ketiinfo/index/setStatus','paixu'=>5,'pid'=>902], + ['title'=>'批量上传','name'=>'ketiinfo/index/createAll','paixu'=>6,'pid'=>902], diff --git a/route/keti.php b/route/keti.php index ba071f30..fd05c75b 100644 --- a/route/keti.php +++ b/route/keti.php @@ -11,6 +11,13 @@ //系统设置路由 Route::resource('kt','keti/Index'); +Route::resource('ktinfo','keti/KetiInfo'); +// 课题册中的课题信息 +Route::get('ktinfo/:id/ketice','keti/KetiInfo/ketiCe'); +// 添加立项信息 +Route::get('ktinfo/:id/create','keti/KetiInfo/create'); +// 批量添加立项图片 +Route::get('ktinfoall/:id/createall','keti/KetiInfo/createall');