diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 868b0160..9de03bb9 100644 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -275,7 +275,7 @@ class Bjtongji extends BaseController $data = ['msg' => '各班级成绩统计完成', 'val' => 1]; $src = [ 'kaoshi_id' => $kaoshi_id, - 'category' => 'bjtj', + 'category_id' => 12001, ]; event('tjlog', $src); } else { @@ -302,7 +302,7 @@ class Bjtongji extends BaseController $data = ['msg' => '学生成绩在班级位置统计完成。', 'val' => 1]; $src = [ 'kaoshi_id' => $kaoshi_id - ,'category' => 'bjwz' + ,'category_id' => 12002 ]; event('tjlog', $src); } else { diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index 4f28932c..d1c59c98 100644 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -264,7 +264,7 @@ class Njtongji extends BaseController ]; $src = [ 'kaoshi_id' => $kaoshi_id - ,'category' => 'njtj' + ,'category_id' => 12003 ]; event('tjlog', $src); } else { @@ -297,7 +297,7 @@ class Njtongji extends BaseController ]; $src = [ 'kaoshi_id' => $kaoshi_id - ,'category' => 'njwz' + ,'category_id' => 12004 ]; event('tjlog', $src); } else { diff --git a/app/chengji/controller/Schtongji.php b/app/chengji/controller/Schtongji.php index 9abf2557..edaa403e 100644 --- a/app/chengji/controller/Schtongji.php +++ b/app/chengji/controller/Schtongji.php @@ -24,7 +24,7 @@ class Schtongji $data=['msg'=>'全区年级统计完成','val'=>1]; $src = [ 'kaoshi_id' => $kaoshi_id, - 'category' => 'schtj', + 'category_id' => 12005, ]; event('tjlog', $src); }else{ @@ -52,7 +52,7 @@ class Schtongji $data=['msg'=>'学生成绩在全区位置统计完成','val'=>1]; $src = [ 'kaoshi_id' => $kaoshi_id, - 'category' => 'schwz', + 'category_id' => 12006, ]; event('tjlog', $src); }else{ diff --git a/app/event/MyEvent.php b/app/event/MyEvent.php index f73f4889..b2180f92 100644 --- a/app/event/MyEvent.php +++ b/app/event/MyEvent.php @@ -20,13 +20,13 @@ class MyEvent // 添加考试统计日志 - public function addTongjiLog($kaoshi_id, $category) + public function addTongjiLog($kaoshi_id, $category_id) { // 添加统计日志 $tjLog = new TongjiLog; $log = $tjLog::withTrashed() ->where('kaoshi_id', $kaoshi_id) - ->where('category', $category) + ->where('category_id', $category_id) ->find(); if(true == $log) @@ -41,7 +41,7 @@ class MyEvent }else{ $data = $tjLog->save([ 'kaoshi_id' => $kaoshi_id, - 'category' => $category, + 'category_id' => $category_id, 'user_id' => session('userid'), ]); } diff --git a/app/kaoshi/model/TongjiLog.php b/app/kaoshi/model/TongjiLog.php index 9f25c8f6..e4392c77 100644 --- a/app/kaoshi/model/TongjiLog.php +++ b/app/kaoshi/model/TongjiLog.php @@ -64,7 +64,7 @@ class TongjiLog extends BaseModel 'schwz' => '/chengji/schtj/schorder', ]; - $val = $this->getData('category_id'); + $val = $this->getData('category'); return $src[$val]; } diff --git a/database/seeds/Category.php b/database/seeds/Category.php index d8e0fe25..b12222ed 100644 --- a/database/seeds/Category.php +++ b/database/seeds/Category.php @@ -253,6 +253,19 @@ class Category extends Seeder // 课题或荣誉角色 ['id' => 11901,'title' => '主持人','p_id' => 119,'paixu' => 1,'isupdate' => 0], ['id' => 11902,'title' => '参与人','p_id' => 119,'paixu' => 2,'isupdate' => 0], + ['id' => 120 + ,'title' => '成绩统计分类' + ,'p_id' => 0 + ,'paixu' => 20 + ,'isupdate' => 0 + ], + // 课题或荣誉角色 + ['id' => 12001,'title' => '班级统计','p_id' => 120,'paixu' => 1,'isupdate' => 0], + ['id' => 12002,'title' => '班级排序','p_id' => 120,'paixu' => 2,'isupdate' => 0], + ['id' => 12003,'title' => '学校统计','p_id' => 120,'paixu' => 3,'isupdate' => 0], + ['id' => 12004,'title' => '学校排序','p_id' => 120,'paixu' => 4,'isupdate' => 0], + ['id' => 12005,'title' => '区统计','p_id' => 120,'paixu' => 5,'isupdate' => 0], + ['id' => 12006,'title' => '区排序','p_id' => 120,'paixu' => 6,'isupdate' => 0], ]; // 保存数据 $this->table('category')->insert($rows)->save();