@@ -28,12 +49,11 @@
-
-
-
{/foreach}
@@ -85,12 +105,10 @@
},
dataType: 'json',
success: function(data){
- myJson = {"name": "phpernote", "password": "1111"};
for (var val in data) {
for(var bj in data[val]['banji'])
{
$('#' + val).append('
';
-
}
}
diff --git a/application/renshi/model/Student.php b/application/renshi/model/Student.php
index 0eeef3d4..3dddc7b5 100644
--- a/application/renshi/model/Student.php
+++ b/application/renshi/model/Student.php
@@ -15,7 +15,7 @@ class Student extends Base
return getAgeByBirth($this->getdata('shengri'),2);
}
- // 班级获取器
+ // 年级、班级名称获取器
public function getBanjititleAttr()
{
$bj = Banji::get($this->banji);
@@ -48,5 +48,11 @@ class Student extends Base
return $sex[$value];
}
+ // 获取入学年
+ public function getNianjiAttr()
+ {
+ return db('banji')->where('id',$this->getData('banji'))->value('ruxuenian');
+ }
+
}
diff --git a/database/migrations/20181114055804_chengji.php b/database/migrations/20181114055804_chengji.php
new file mode 100644
index 00000000..0a8f70c5
--- /dev/null
+++ b/database/migrations/20181114055804_chengji.php
@@ -0,0 +1,49 @@
+table('chengji');
+
+ // 添加当前表字段
+ $table
+ ->addColumn('kaoshi','integer',['limit'=>11,'null'=>false,'comment'=>'考试'])
+ ->addColumn('school','integer',['limit'=>11,'null'=>false,'comment'=>'学校'])
+ ->addColumn('ruxuenian','integer',['limit'=>4,'null'=>false,'comment'=>'入学年'])
+ ->addColumn('banji','integer',['limit'=>11,'null'=>false,'comment'=>'班级'])
+ ->addColumn('student','integer',['limit'=>11,'null'=>false,'comment'=>'学生'])
+ ->addColumn('yuwen','integer',['limit'=>3,'null'=>false,'comment'=>'语文'])
+ ->addColumn('shuxue','integer',['limit'=>3,'null'=>false,'comment'=>'数学'])
+ ->addColumn('yingyu','integer',['limit'=>3,'null'=>false,'comment'=>'英语'])
+ ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间'])
+ ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常'])
+ ->addIndex(array('kaoshi','student'), array('unique' => true))
+ ->create();
+ }
+}
diff --git a/database/seeds/Rule.php b/database/seeds/Rule.php
index 755a531b..9147202b 100644
--- a/database/seeds/Rule.php
+++ b/database/seeds/Rule.php
@@ -42,7 +42,7 @@ class Rule extends Seeder
// 成绩采集
['id'=>51,'title'=>'扫码录入','name'=>'chengji/Index/malu','paixu'=>1,'ismenu' =>true,'pid' =>5,'url'=>'/chengji',],
['id'=>52,'title'=>'表格录入','name'=>'chengji/Student/biaolu','paixu'=>2,'ismenu' =>true,'pid' =>5,'url'=>'/chengji',],
- ['id'=>53,'title'=>'生成二维码','name'=>'chengji/Student/erweima','paixu'=>3,'ismenu' =>true,'pid' =>5,'url'=>'/chengji/erweima',],
+ ['id'=>53,'title'=>'生成考号','name'=>'chengji/Index/kaohao','paixu'=>3,'ismenu' =>true,'pid' =>5,'url'=>'/chengji/kaohao',],
// 教务管理
diff --git a/route/chengji.php b/route/chengji.php
index 064261dd..409960f5 100644
--- a/route/chengji.php
+++ b/route/chengji.php
@@ -12,6 +12,7 @@
//系统设置路由
Route::get('chengji/erweima','chengji/Index/erweima');
Route::get('chengji/kaohao','chengji/Index/kaohao');
+Route::post('chengji/kaohao','chengji/Index/kaohaosave');