diff --git a/application/kaoshi/controller/Error.php b/application/kaoshi/controller/Error.php new file mode 100644 index 00000000..faceef77 --- /dev/null +++ b/application/kaoshi/controller/Error.php @@ -0,0 +1,11 @@ +assign('list', $list); + + // 渲染模板 + return $this->fetch(); + } + + /** + * 显示创建资源表单页. + * + * @return \think\Response + */ + public function create() + { + // + } + + /** + * 保存新建的资源 + * + * @param \think\Request $request + * @return \think\Response + */ + public function save(Request $request) + { + // + } + + /** + * 显示指定的资源 + * + * @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) + { + // + } +} diff --git a/application/keti/model/Keti.php b/application/keti/model/Keti.php new file mode 100644 index 00000000..8886e171 --- /dev/null +++ b/application/keti/model/Keti.php @@ -0,0 +1,11 @@ + ['规则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 new file mode 100644 index 00000000..5ffbe321 --- /dev/null +++ b/application/keti/view/index/create.html @@ -0,0 +1,77 @@ +{extend name="common@create" /} +{block name="mycss"} +{/block} +{block name="formaa"} +
+
+ +
+ +
+
+
+ +
+ + {php}$category = getCategory(112);{/php} + + +
+
+
+ +
+ + {php} $school = schlist('区级','其它级');{/php} + + +
+
+
+ +
+ +
+
+
+
+ +
+
+
+{/block} +{block name="yanzheng"} + +{/block} \ No newline at end of file diff --git a/application/rongyu/view/js_rongyu/createall.html b/application/keti/view/index/createall.html similarity index 100% rename from application/rongyu/view/js_rongyu/createall.html rename to application/keti/view/index/createall.html diff --git a/application/keti/view/index/edit.html b/application/keti/view/index/edit.html new file mode 100644 index 00000000..ee86b726 --- /dev/null +++ b/application/keti/view/index/edit.html @@ -0,0 +1,77 @@ +{extend name="common@create" /} +{block name="mycss"} +{/block} +{block name="formaa"} +
+
+ +
+ +
+
+
+ +
+ + {php}$category = getCategory(112);{/php} + + +
+
+
+ +
+ + {php} $school = schlist('区级','其它级');{/php} + + +
+
+
+ +
+ +
+
+
+
+ +
+
+
+{/block} +{block name="yanzheng"} + +{/block} \ No newline at end of file diff --git a/application/keti/view/index/index.html b/application/keti/view/index/index.html new file mode 100644 index 00000000..cf316dce --- /dev/null +++ b/application/keti/view/index/index.html @@ -0,0 +1,198 @@ +{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(112);{/php} + +
+
+ {foreach $category as $key=>$vo } + + {/foreach} +
+ +
+
+
+{/block} +{block name="tables"} + + + + + + + + + + + + + + + +
荣誉册名称颁奖单位荣誉类别荣誉数量颁奖时间状态操作
+ + +{/block} +{block name="myjs"} + +{/block} \ No newline at end of file diff --git a/application/renshi/controller/Index.php b/application/renshi/controller/Index.php index 740324dc..0d785a14 100644 --- a/application/renshi/controller/Index.php +++ b/application/renshi/controller/Index.php @@ -309,7 +309,7 @@ class Index extends Base // 返回添加结果 $data ? $data = ['msg'=>'数据上传成功','val'=>true] : ['msg'=>'数据上传失败','val'=>false]; - return json($data1); + return json($data); } diff --git a/application/rongyu/controller/Error.php b/application/rongyu/controller/Error.php new file mode 100644 index 00000000..9d798a66 --- /dev/null +++ b/application/rongyu/controller/Error.php @@ -0,0 +1,11 @@ +$list['url'],'rongyuce'=>$rongyuce]); + $data = ryinfo::create(['pic'=>$list['url'],'rongyuce'=>$rongyuce]); $id = $data->id; $id ? $data = array('msg'=>'上传成功','val'=>true,'url'=>$list['url'],'ryid'=>$id) : $data = array('msg'=>'保存文件信息失败','val'=>false,'url'=>null); @@ -238,9 +237,6 @@ class JsRongyuInfo extends Base ]) ->find(); - dump($list); - - $this->assign('list',$list); return $this->fetch(); diff --git a/application/rongyu/model/DwRongyu.php b/application/rongyu/model/DwRongyu.php index b38aa2da..e9dbff59 100644 --- a/application/rongyu/model/DwRongyu.php +++ b/application/rongyu/model/DwRongyu.php @@ -108,7 +108,16 @@ class DwRongyu extends Base // 发证时间获取器 public function getFzshijianAttr($value) { - return date('Y-m-d',$value); + // 判断发证时间是否为空 + if ($value>0) + { + $value = date('Y-m-d',$value); + }else{ + $value = ""; + } + + // 返回发证时间 + return $value; } } diff --git a/application/rongyu/model/DwRongyuCanyu.php b/application/rongyu/model/DwRongyuCanyu.php index 90cc2906..ff66ffd1 100644 --- a/application/rongyu/model/DwRongyuCanyu.php +++ b/application/rongyu/model/DwRongyuCanyu.php @@ -2,6 +2,7 @@ namespace app\rongyu\model; +// 引用数据模型基类 use think\Model; class DwRongyuCanyu extends Model diff --git a/application/rongyu/model/JsRongyu.php b/application/rongyu/model/JsRongyu.php index 9d4aff28..37470b13 100644 --- a/application/rongyu/model/JsRongyu.php +++ b/application/rongyu/model/JsRongyu.php @@ -85,7 +85,12 @@ class JsRongyu extends Base if ($value>0) { $value = date('Y-m-d',$value); + }else{ + $value = ""; } return $value; } + + + } diff --git a/application/rongyu/model/JsRongyuCanyu.php b/application/rongyu/model/JsRongyuCanyu.php index c24600df..b7a90777 100644 --- a/application/rongyu/model/JsRongyuCanyu.php +++ b/application/rongyu/model/JsRongyuCanyu.php @@ -2,12 +2,11 @@ namespace app\rongyu\model; +// 引用数据模型类 use think\Model; class JsRongyuCanyu extends Model { - // 关闭全局自动时间戳 - protected $autoWriteTimestamp = false; // 荣誉册关联 public function rongyu() diff --git a/application/rongyu/model/JsRongyuInfo.php b/application/rongyu/model/JsRongyuInfo.php index 47b6bb2b..451cf62a 100644 --- a/application/rongyu/model/JsRongyuInfo.php +++ b/application/rongyu/model/JsRongyuInfo.php @@ -48,10 +48,16 @@ class JsRongyuInfo extends Base }, 'ryTuce'=>function($query){ $query->field('id,title'); - } + }, + 'hjJsry'=>function($query){ + $query->field('rongyuid,teacherid') + ->with(['teacher'=>function($query){ + $query->field('id,xingming'); + }]); + }, ] ) - // ->append(['jibie']) + ->append(['hjJsName']) ->select(); @@ -136,7 +142,30 @@ class JsRongyuInfo extends Base if ($value>0) { $value = date('Y-m-d',$value); + }else{ + $value = ""; } return $value; } + + // 获奖教师名整理 + public function getHjJsNameAttr($value) + { + $teacherList = $this->getAttr('hjJsry'); + $teachNames = ""; + $i = 0; + foreach ($teacherList as $key => $value) { + # code... + if($i == 0) + { + $teachNames = $value['teacher']['xingming']; + }else{ + $teachNames = $teachNames . '、' .$value['teacher']['xingming']; + } + $i++; + } + + return $teachNames; + + } } diff --git a/application/rongyu/view/dw_rongyu/index.html b/application/rongyu/view/dw_rongyu/index.html index 2946bd13..1fe044c6 100644 --- a/application/rongyu/view/dw_rongyu/index.html +++ b/application/rongyu/view/dw_rongyu/index.html @@ -159,7 +159,7 @@ { "data": "jx_category.title","name":"jiangxiang","defaultContent": ""}, { "data": "fz_school.jiancheng" ,"name":"fzschool","defaultContent": ""}, { "data": "jibie","name":"fzschool","defaultContent": ""}, - { "data": "hjshijian" ,"defaultContent": ""}, + { "data": "fzshijian" ,"defaultContent": ""}, { "data": "status" }, { "data": "id" }, ]; diff --git a/application/rongyu/view/js_rongyu/index.html b/application/rongyu/view/js_rongyu/index.html index cf316dce..fc4c7ee4 100644 --- a/application/rongyu/view/js_rongyu/index.html +++ b/application/rongyu/view/js_rongyu/index.html @@ -148,7 +148,7 @@ startbut = ''; // 上图图片按钮 - picbut = ''; + picbut = ''; // 添加荣誉 addbut = ''; // 编辑按钮 diff --git a/application/rongyu/view/js_rongyu_info/edit.html b/application/rongyu/view/js_rongyu_info/edit.html index a838c2ff..e3be402d 100644 --- a/application/rongyu/view/js_rongyu_info/edit.html +++ b/application/rongyu/view/js_rongyu_info/edit.html @@ -23,7 +23,14 @@
-
+
+ {volist name="list.hj_jsry" id="vo"} + + + + + {/volist} +
@@ -31,7 +38,14 @@
-
+
+ {volist name="list.cy_jsry" id="vo"} + + + + + {/volist} +
diff --git a/application/rongyu/view/js_rongyu_info/index.html b/application/rongyu/view/js_rongyu_info/index.html index 57d4cd15..62d9f51b 100644 --- a/application/rongyu/view/js_rongyu_info/index.html +++ b/application/rongyu/view/js_rongyu_info/index.html @@ -148,7 +148,7 @@ // 定义列参数 var mycolumns = [ { "data": "id" }, - { "data": "teacherid" ,"name":"teacherid","defaultContent": ""}, + { "data": "hjJsName" ,"name":"teacherid","defaultContent": ""}, { "data": "hj_school.jiancheng" ,"name":"hjschool","defaultContent": ""}, { "data": "title","defaultContent": "" }, { "data": "ry_tuce.title" ,"name":"rongyuce","defaultContent": ""}, @@ -176,9 +176,6 @@ stopbut = ''; // 启用按钮 startbut = ''; - - // 上图图片按钮 - picbut = ''; // 编辑按钮 editbut = ''; delbut = ''; @@ -189,7 +186,7 @@ buts = stopbut; } - return buts + picbut + editbut + delbut; + return buts + editbut + delbut; } }, { diff --git a/config/keti/app.php b/config/keti/app.php new file mode 100644 index 00000000..3779064a --- /dev/null +++ b/config/keti/app.php @@ -0,0 +1,5 @@ +table('keti'); + + // 添加当前表字段 + $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('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'=>'结题证书图片']) + ->create(); + } +} diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index 320864bf..b237a8c8 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -22,9 +22,10 @@ class Rule extends Seeder ['id'=>3,'title' =>'考试管理','name'=>'kaoshi','paixu' =>3,'ismenu' =>true,'font'=>'Hui-iconfont-canshu'], ['id'=>4,'title' =>'师生名单','name'=>'renshi','paixu' =>4,'ismenu' =>true,'font'=>'Hui-iconfont-user-group'], ['id'=>5,'title' =>'教务管理','name'=>'teach','paixu' =>5,'ismenu' =>true,'font'=>'Hui-iconfont-yuyin2'], - ['id'=>6,'title' =>'管理员管理','name'=>'admin','paixu' =>7,'ismenu' =>true,'font'=>'Hui-iconfont-root'], - ['id'=>7,'title'=>'系统管理','name' =>'system','paixu' =>8,'ismenu'=>true,'font' =>'Hui-iconfont-system'], + ['id'=>6,'title' =>'管理员管理','name'=>'admin','paixu' =>8,'ismenu' =>true,'font'=>'Hui-iconfont-root'], + ['id'=>7,'title'=>'系统管理','name' =>'system','paixu' =>9,'ismenu'=>true,'font' =>'Hui-iconfont-system'], ['id'=>8,'title'=>'荣誉管理','name' =>'rongyu','paixu' =>6,'ismenu'=>true,'font' =>'Hui-iconfont-huangguan','status'=>false], + ['id'=>9,'title'=>'课题管理','name' =>'keti','paixu' =>7,'ismenu'=>true,'font' =>'Hui-iconfont-huangguan','status'=>false], // 二级菜单 // 成绩采集 ['id'=>101,'title'=>'扫码录入','name'=>'chengji/Index/malu','paixu'=>1,'ismenu' =>true,'pid' =>1,'url'=>'/chengji/malu',], @@ -61,6 +62,10 @@ class Rule extends Seeder ['id'=>802,'title'=>'教师荣誉册','name'=>'rongyu/JsRongyu/index','paixu'=>2,'ismenu' =>true,'pid' =>8,'url'=>'/jsry',], ['id'=>803,'title'=>'教师荣誉信息','name'=>'rongyu/JsRongyuInfo/index','paixu'=>3,'ismenu' =>true,'pid' =>8,'url'=>'/jsryinfo',], ['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',], + @@ -191,6 +196,15 @@ class Rule extends Seeder ['title'=>'批量上传','name'=>'rongyu/JsRongyuInfo/createAll','paixu'=>6,'pid'=>803], + // 课题管理 + ['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], + + ]; // 保存数据 diff --git a/route/keti.php b/route/keti.php new file mode 100644 index 00000000..ba071f30 --- /dev/null +++ b/route/keti.php @@ -0,0 +1,17 @@ + +// +---------------------------------------------------------------------- + +//系统设置路由 +Route::resource('kt','keti/Index'); + + + + diff --git a/route/rongyu.php b/route/rongyu.php index be0dab6f..66b7bc13 100644 --- a/route/rongyu.php +++ b/route/rongyu.php @@ -14,5 +14,6 @@ Route::resource('dwry','rongyu/DwRongyu'); Route::resource('jsry','rongyu/JsRongyu'); Route::resource('jsryinfo','rongyu/JsRongyuInfo'); Route::get('dwry/createall','rongyu/DwRongyu/createall'); -Route::get('jsry/:id/createall','rongyu/JsRongyu/createall'); -Route::get('jsryinfo/:id/create','rongyu/JsRongyuInfo/create'); \ No newline at end of file +// Route::get('jsry/:id/createall','rongyu/JsRongyu/createall'); +Route::get('jsryinfo/:id/create','rongyu/JsRongyuInfo/create'); +Route::get('jsryinfoall/:id/createall','rongyu/JsRongyuInfo/createall'); \ No newline at end of file