diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 381fe16f..6bc53355 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -63,6 +63,7 @@ class TongjiBj extends BaseModel $tongjiJg->q2 = $cj['sifenwei'][1]; $tongjiJg->q3 = $cj['sifenwei'][2]; $tongjiJg->zhongshu = $cj['zhongshu']; + $tongjiJg->zhongweishu = $cj['zhongweishu']; $tongjiJg->defenlv = $cj['defenlv']; $data = $tongjiJg->save(); }else{ @@ -84,6 +85,7 @@ class TongjiBj extends BaseModel ,'q2' => $cj['sifenwei'][1] ,'q3' => $cj['sifenwei'][2] ,'zhongshu' => $cj['zhongshu'] + ,'zhongweishu' => $cj['zhongweishu'] ,'defenlv' => $cj['defenlv'] ]; $data = $this::create($tongjiJg); diff --git a/app/chengji/model/TongjiNj.php b/app/chengji/model/TongjiNj.php index 41b2ce56..b7e7b576 100644 --- a/app/chengji/model/TongjiNj.php +++ b/app/chengji/model/TongjiNj.php @@ -65,6 +65,7 @@ class TongjiNj extends BaseModel $tongjiJg->q2 = $cj['sifenwei'][1]; $tongjiJg->q3 = $cj['sifenwei'][2]; $tongjiJg->zhongshu = $cj['zhongshu']; + $tongjiJg->zhongweishu = $cj['zhongweishu']; $tongjiJg->defenlv = $cj['defenlv']; $data = $tongjiJg->save(); }else{ @@ -87,6 +88,7 @@ class TongjiNj extends BaseModel 'q2' => $cj['sifenwei'][1], 'q3' => $cj['sifenwei'][2], 'zhongshu' => $cj['zhongshu'], + 'zhongweihu' => $cj['zhongweishu'], 'defenlv' => $cj['defenlv'], ]; @@ -137,7 +139,7 @@ class TongjiNj extends BaseModel }, 'njJieguo' => function ($query) { $query->field('subject_id, school_id, ruxuenian, stu_cnt, chengji_cnt, - avg, youxiu, jige, biaozhuncha, max, min, q1, q2, q3') + avg, youxiu, jige, biaozhuncha, max, min, q1, q2, q3, zhongshu, zhongweishu') ->with([ 'njSubject' => function($query){ $query->field('id, lieming, jiancheng, title'); diff --git a/app/chengji/model/TongjiSch.php b/app/chengji/model/TongjiSch.php index bf50f9ec..60c0d79c 100644 --- a/app/chengji/model/TongjiSch.php +++ b/app/chengji/model/TongjiSch.php @@ -55,6 +55,7 @@ class TongjiSch extends BaseModel $tongjiJg->q2 = $cj['sifenwei'][1]; $tongjiJg->q3 = $cj['sifenwei'][2]; $tongjiJg->zhongshu = $cj['zhongshu']; + $tongjiJg->zhongweishu = $cj['zhongweishu']; $tongjiJg->defenlv = $cj['defenlv']; $data = $tongjiJg->save(); }else{ @@ -76,6 +77,7 @@ class TongjiSch extends BaseModel ,'q2' => $cj['sifenwei'][1] ,'q3' => $cj['sifenwei'][2] ,'zhongshu' => $cj['zhongshu'] + ,'zhongweishu' => $cj['zhongweishu'] ,'defenlv' => $cj['defenlv'] ]; $data = $this::create($tongjiJg); diff --git a/database/migrations/20200106012240_tongji_nj.php b/database/migrations/20200106012240_tongji_nj.php index d1edf32d..9b866823 100644 --- a/database/migrations/20200106012240_tongji_nj.php +++ b/database/migrations/20200106012240_tongji_nj.php @@ -50,7 +50,8 @@ class TongjiNj extends Migrator ->addColumn('q1','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'下25%']) ->addColumn('q2','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'中间%25']) ->addColumn('q3','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'上面25%']) - ->addColumn('zhongshu','decimal',['precision'=>5,'scale'=>1,'null'=>true,'comment'=>'众数']) + ->addColumn('zhongshu','string',['limit'=>100,'null'=>true,'comment'=>'众数']) + ->addColumn('zhongweishu','decimal',['limit'=>100,'null'=>true,'comment'=>'中位数']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) diff --git a/database/migrations/20200106013922_tongji_bj.php b/database/migrations/20200106013922_tongji_bj.php index a43f8c9f..33648218 100644 --- a/database/migrations/20200106013922_tongji_bj.php +++ b/database/migrations/20200106013922_tongji_bj.php @@ -49,8 +49,9 @@ class TongjiBj extends Migrator ->addColumn('q1','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'下25%']) ->addColumn('q2','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'中间%25']) ->addColumn('q3','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'上面25%']) - ->addColumn('zhongshu','decimal',['precision'=>5,'scale'=>1,'default'=>Null,'null'=>true,'comment'=>'众数']) - ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) + ->addColumn('zhongshu','string',['limit'=>100,'null'=>true,'comment'=>'众数']) + ->addColumn('zhongweishu','decimal',['limit'=>100,'null'=>true,'comment'=>'中位数']) + ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常']) diff --git a/database/migrations/20200107045207_tongji_sch.php b/database/migrations/20200107045207_tongji_sch.php index 67d7c54d..2995e266 100644 --- a/database/migrations/20200107045207_tongji_sch.php +++ b/database/migrations/20200107045207_tongji_sch.php @@ -49,7 +49,8 @@ class TongjiSch extends Migrator ->addColumn('q1','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'下25%']) ->addColumn('q2','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'中间%25']) ->addColumn('q3','decimal',['precision'=>6,'scale'=>2,'null'=>true,'comment'=>'上面25%']) - ->addColumn('zhongshu','decimal',['precision'=>5,'scale'=>1,'null'=>true,'comment'=>'众数']) + ->addColumn('zhongshu','string',['limit'=>100,'null'=>true,'comment'=>'众数']) + ->addColumn('zhongweishu','decimal',['limit'=>100,'null'=>true,'comment'=>'中位数']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间'])