From 44833b07a8d2c753856411de94ba966f6a36f0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Mon, 24 Dec 2018 15:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=A3=E8=AA=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/rongyu/common.php | 1 + application/rongyu/controller/DwRongyu.php | 96 ++++++++ application/rongyu/controller/JsRongyu.php | 87 +++++++ .../rongyu/controller/JsRongyuInfo.php | 87 +++++++ application/rongyu/model/DwRongyu.php | 11 + application/rongyu/model/JsRongyu.php | 11 + application/rongyu/model/JsRongyuInfo.php | 11 + application/rongyu/view/dw_rongyu/create.html | 194 +++++++++++++++ application/rongyu/view/dw_rongyu/edit.html | 174 ++++++++++++++ application/rongyu/view/dw_rongyu/index.html | 221 ++++++++++++++++++ application/system/controller/Category.php | 2 +- application/teach/controller/Subject.php | 6 +- application/teach/view/subject/index.html | 2 +- config/rongyu/app.php | 5 + .../migrations/20181218041034_dw_rongyu.php | 9 +- .../migrations/20181221041509_js_rongyu.php | 46 ++++ ....php => 20181221041523_js_rongyu_info.php} | 4 +- database/seeds/Rule.php | 7 + route/rongyu.php | 15 ++ 19 files changed, 980 insertions(+), 9 deletions(-) create mode 100644 application/rongyu/common.php create mode 100644 application/rongyu/controller/DwRongyu.php create mode 100644 application/rongyu/controller/JsRongyu.php create mode 100644 application/rongyu/controller/JsRongyuInfo.php create mode 100644 application/rongyu/model/DwRongyu.php create mode 100644 application/rongyu/model/JsRongyu.php create mode 100644 application/rongyu/model/JsRongyuInfo.php create mode 100644 application/rongyu/view/dw_rongyu/create.html create mode 100644 application/rongyu/view/dw_rongyu/edit.html create mode 100644 application/rongyu/view/dw_rongyu/index.html create mode 100644 config/rongyu/app.php create mode 100644 database/migrations/20181221041509_js_rongyu.php rename database/migrations/{20181218075455_dw_rongyu_info.php => 20181221041523_js_rongyu_info.php} (95%) create mode 100644 route/rongyu.php diff --git a/application/rongyu/common.php b/application/rongyu/common.php new file mode 100644 index 00000000..b3d9bbc7 --- /dev/null +++ b/application/rongyu/common.php @@ -0,0 +1 @@ +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/rongyu/controller/JsRongyu.php b/application/rongyu/controller/JsRongyu.php new file mode 100644 index 00000000..feeb75a7 --- /dev/null +++ b/application/rongyu/controller/JsRongyu.php @@ -0,0 +1,87 @@ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ + {php} $school = schlist('校级','校级');{/php} + + +
+
+
+ +
+ + {php} + $njlist = nianjiList(); + {/php} + + +
+
+
+ +
+ + + +
+
+
+
+ +
+
+ +{/block} +{block name="yanzheng"} + +{/block} \ No newline at end of file diff --git a/application/rongyu/view/dw_rongyu/edit.html b/application/rongyu/view/dw_rongyu/edit.html new file mode 100644 index 00000000..43870ee6 --- /dev/null +++ b/application/rongyu/view/dw_rongyu/edit.html @@ -0,0 +1,174 @@ +{extend name="common@create" /} +{block name="formaa"} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ + {php} + $school = schlist('校级','校级'); + {/php} + + +
+
+
+ +
+ + {php} + $njlist = nianjiList(); + $banji = new \app\teach\model\Banji; + $bj = $banji::get($list['banji']); + {/php} + + +
+
+ {php} + $bjlist = $banji::where('ruxuenian',$bj->ruxuenian)->select(); + $bjlist = $bjlist->append(['title'])->visible(['id','title']); + {/php} +
+ +
+ + + +
+
+
+
+ +
+
+
+{/block} +{block name="yanzheng"} + +{/block} \ No newline at end of file diff --git a/application/rongyu/view/dw_rongyu/index.html b/application/rongyu/view/dw_rongyu/index.html new file mode 100644 index 00000000..c59bead7 --- /dev/null +++ b/application/rongyu/view/dw_rongyu/index.html @@ -0,0 +1,221 @@ +{extend name="common@list" /} +{block name="topnav"} + +{/block} +{block name="bouttons"} +
+ + + + + 批量删除 + + + + + 添加荣誉 + + + + 共有数据:{$list.count} 条 + +
+
+
筛选荣誉
+
+
+ {php} + $school = schlist('校级','校级'); + {/php} + +
+
+ {foreach $school as $key=>$vo } + + {/foreach} +
+ +
+
+ {php} + $school = schlist('区级','部级'); + {/php} + +
+
+ {foreach $school 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/system/controller/Category.php b/application/system/controller/Category.php index 63ac38af..c53205a6 100644 --- a/application/system/controller/Category.php +++ b/application/system/controller/Category.php @@ -66,7 +66,7 @@ class Category extends Base }) ->order([$order_field=>$order]) ->limit($limit_start,$limit_length) - ->all(); + ->select(); } $datacnt = $data->count(); diff --git a/application/teach/controller/Subject.php b/application/teach/controller/Subject.php index 50397bc4..d7b33c56 100644 --- a/application/teach/controller/Subject.php +++ b/application/teach/controller/Subject.php @@ -39,7 +39,11 @@ class Subject extends Base //得到排序字段的下标 $order_column = $getdt['order'][0]['column']; //根据排序字段的下标得到排序字段 - $order_field = $getdt['columns'][$order_column]['data']; + $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']; diff --git a/application/teach/view/subject/index.html b/application/teach/view/subject/index.html index ebd276d0..aa0b37c5 100644 --- a/application/teach/view/subject/index.html +++ b/application/teach/view/subject/index.html @@ -66,7 +66,7 @@ { "data": "id" }, { "data": "title" }, { "data": "jiancheng" }, - { "data": "suj_category.title"}, + { "data": "suj_category.title","name":"category"}, { "data": "paixu"}, { "data": "kaoshi"}, { "data": "status" }, diff --git a/config/rongyu/app.php b/config/rongyu/app.php new file mode 100644 index 00000000..3779064a --- /dev/null +++ b/config/rongyu/app.php @@ -0,0 +1,5 @@ +table('rongyuce'); + $table = $this->table('dw_rongyu'); // 添加当前表字段 $table - ->addColumn('title','string',['limit'=>30,'null'=>false,'comment'=>'荣誉册名称']) + ->addColumn('title','string',['limit'=>30,'null'=>false,'comment'=>'单位荣誉名称']) + ->addColumn('hjzhengdw','integer',['limit'=>11,'null'=>false,'comment'=>'获奖单位']) ->addColumn('fazhengdw','integer',['limit'=>11,'null'=>false,'comment'=>'发证单位']) ->addColumn('fazhengsj','integer',['limit'=>11,'null'=>false,'comment'=>'发证时间']) - ->addColumn('leixing','integer',['limit'=>15,'null'=>false,'comment'=>'类型']) + ->addColumn('leixing','integer',['limit'=>15,'null'=>false,'comment'=>'荣誉类型']) ->addColumn('create_time','integer',['limit'=>11,'null'=>true,'comment'=>'创建时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) ->addColumn('update_time','integer',['limit'=>11,'null'=>true,'comment'=>'更新时间']) diff --git a/database/migrations/20181221041509_js_rongyu.php b/database/migrations/20181221041509_js_rongyu.php new file mode 100644 index 00000000..7b25a6ff --- /dev/null +++ b/database/migrations/20181221041509_js_rongyu.php @@ -0,0 +1,46 @@ +table('js_rongyu'); + + // 添加当前表字段 + $table + ->addColumn('title','string',['limit'=>30,'null'=>false,'comment'=>'荣誉册名称']) + ->addColumn('fazhengdw','integer',['limit'=>11,'null'=>false,'comment'=>'发证单位']) + ->addColumn('fazhengsj','integer',['limit'=>11,'null'=>false,'comment'=>'发证时间']) + ->addColumn('leixing','integer',['limit'=>15,'null'=>false,'comment'=>'类型']) + ->addColumn('create_time','integer',['limit'=>11,'null'=>true,'comment'=>'创建时间']) + ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) + ->addColumn('update_time','integer',['limit'=>11,'null'=>true,'comment'=>'更新时间']) + ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常']) + ->create(); + } +} diff --git a/database/migrations/20181218075455_dw_rongyu_info.php b/database/migrations/20181221041523_js_rongyu_info.php similarity index 95% rename from database/migrations/20181218075455_dw_rongyu_info.php rename to database/migrations/20181221041523_js_rongyu_info.php index e5f12a7d..da7f5568 100644 --- a/database/migrations/20181218075455_dw_rongyu_info.php +++ b/database/migrations/20181221041523_js_rongyu_info.php @@ -3,7 +3,7 @@ use think\migration\Migrator; use think\migration\db\Column; -class RongyuInfo extends Migrator +class JsRongyuInfo extends Migrator { /** * Change Method. @@ -29,7 +29,7 @@ class RongyuInfo extends Migrator public function change() { // 定义数据表名称 - $table = $this->table('rongyu_info'); + $table = $this->table('js_rongyu_info'); // 添加当前表字段 $table diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php index 22709cfc..3eef7c1e 100644 --- a/database/seeds/Rule.php +++ b/database/seeds/Rule.php @@ -54,6 +54,13 @@ class Rule extends Seeder ['id'=>701,'title'=>'类别管理','name'=>'system/Category/index','paixu'=>1,'ismenu' =>true,'pid' =>7,'url'=>'/category',], ['id'=>702,'title'=>'单位管理','name'=>'system/School/index','paixu'=>2,'ismenu' =>true,'pid' =>7,'url'=>'/school',], ['id'=>703,'title'=>'系统设置','name'=>'system/SystemBase/index','paixu'=>3,'ismenu' =>true,'pid' =>7,'url'=>'/sysbase',], + + + // 荣誉管理 + ['id'=>801,'title'=>'单位荣誉','name'=>'rongyu/DwRongyu/index','paixu'=>1,'ismenu' =>true,'pid' =>8,'url'=>'/jsry',], + ['id'=>802,'title'=>'教师荣誉册','name'=>'rongyu/JsRongyu/index','paixu'=>2,'ismenu' =>true,'pid' =>8,'url'=>'/dwry',], + ['id'=>802,'title'=>'教师荣誉信息','name'=>'rongyu/JsRongyuInfo/index','paixu'=>3,'ismenu' =>true,'pid' =>8,'url'=>'/dwry',], + ['id'=>803,'title'=>'学生荣誉','name'=>'rongyu/JsRongyu/index','paixu'=>7,'ismenu' =>true,'pid' =>8,'url'=>'/xsry',], diff --git a/route/rongyu.php b/route/rongyu.php new file mode 100644 index 00000000..24940261 --- /dev/null +++ b/route/rongyu.php @@ -0,0 +1,15 @@ + +// +---------------------------------------------------------------------- + +//系统设置路由 +Route::resource('dwry','rongyu/DwRongyu'); +Route::resource('jsry','rongyu/JsRongyu'); +Route::resource('jsryinfo','rongyu/JsRongyuInfo'); \ No newline at end of file