Browse Source

增加考勤签到功能

liuyu 5 năm trước cách đây
mục cha
commit
b527f547ec
3 tập tin đã thay đổi với 7 bổ sung0 xóa
  1. 5 0
      app/controller/attendance.js
  2. 1 0
      app/router.js
  3. 1 0
      app/service/uploadquestion.js

+ 5 - 0
app/controller/attendance.js

@@ -13,6 +13,11 @@ class AttendanceController extends Controller {
     this.service = this.ctx.service.attendance;
   }
 
+  // 考勤专用页面
+  async wxauth(){
+    console.log(this.ctx.query);
+    this.ctx.ok({ 'ok' });
+  }
 
 }
 

+ 1 - 0
app/router.js

@@ -108,6 +108,7 @@ module.exports = app => {
   router.post('uploadquestion', '/api/train/uploadquestion/update/:id', controller.uploadquestion.update);
 
   // 考勤表设置路由
+  router.get('/api/train/attendance/wxauth', controller.attendance.wxauth); // 统计完成度
   router.resources('attendance', '/api/train/attendance', controller.attendance); // index、create、show、destroy
   router.post('attendance', '/api/train/attendance/update/:id', controller.attendance.update);
 

+ 1 - 0
app/service/uploadquestion.js

@@ -19,6 +19,7 @@ class UploadquestionService extends CrudService {
   // 完成度查询
   async completion(data) {
     const { type, typeid, trainplanid } = data;
+    assert(type && typeid, '缺少部分信息项');
     const datas = [];
     let answertotal = '';
     let alltotal = '';