valueController.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. const Controller = require('../extend/baseController');
  3. class ValueController extends Controller {
  4. tag() {
  5. return this.ctx.service.valueService;
  6. }
  7. // 积分表添加地区字段
  8. // async addDept() {
  9. // const { ctx, service } = this;
  10. // ctx.setOrder('time', true); // 倒序
  11. // const result = await this.tag().list(ctx.query);
  12. // let index = 0;
  13. // for (const item of result) {
  14. // const user = await this.ctx.model.SysUserModel.findOne({ _id: this.app.mongoose.Types.ObjectId(item.userid) });
  15. // if (user) {
  16. // const addQuery = {};
  17. // addQuery.dept1 = user.dept1._id;
  18. // addQuery.dept2 = user.dept2._id;
  19. // addQuery.dept3 = user.dept3._id;
  20. // addQuery.dept4 = user.dept4._id;
  21. // addQuery.dept5 = user.dept5._id;
  22. // await service.valueService.update({ _id: item._id }, addQuery);
  23. // index++;
  24. // ctx.logger.error('已更改', index, '条数据');
  25. // } else {
  26. // index++;
  27. // ctx.logger.error(index, '条数据', '该用户不存在', item.userid);
  28. // }
  29. // }
  30. // // ctx.success(result);
  31. // }
  32. }
  33. module.exports = ValueController;