123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 'use strict';
- const Controller = require('../extend/baseController');
- class ValueController extends Controller {
- tag() {
- return this.ctx.service.valueService;
- }
- async userValueDetails() {
- const { ctx, service } = this;
- const query = ctx.query;
- const result = await service.valueService.userValueDetails(query);
- ctx.success(result);
- }
- // 积分表添加地区字段
- // async addDept() {
- // const { ctx, service } = this;
- // ctx.setOrder('time', true); // 倒序
- // const result = await this.tag().list(ctx.query);
- // let index = 0;
- // for (const item of result) {
- // const user = await this.ctx.model.SysUserModel.findOne({ _id: this.app.mongoose.Types.ObjectId(item.userid) });
- // if (user) {
- // const addQuery = {};
- // addQuery.dept1 = user.dept1._id;
- // addQuery.dept2 = user.dept2._id;
- // addQuery.dept3 = user.dept3._id;
- // addQuery.dept4 = user.dept4._id;
- // addQuery.dept5 = user.dept5._id;
- // await service.valueService.update({ _id: item._id }, addQuery);
- // index++;
- // ctx.logger.error('已更改', index, '条数据');
- // } else {
- // index++;
- // ctx.logger.error(index, '条数据', '该用户不存在', item.userid);
- // }
- // }
- // // ctx.success(result);
- // }
- }
- module.exports = ValueController;
|