|
@@ -54,7 +54,6 @@ class CardService extends CrudService {
|
|
|
async create(data) {
|
|
|
|
|
|
|
|
|
- console.log(moment().format('YYYY-MM-DD HH:mm:ss'));
|
|
|
const { password, mobile, set, r_mobile } = data;
|
|
|
const is_exists = await this.model.count({ mobile });
|
|
|
if (is_exists) { throw new BusinessError(ErrorCode.DATA_EXISTED, '手机号已存在'); }
|
|
@@ -62,7 +61,7 @@ class CardService extends CrudService {
|
|
|
let user;
|
|
|
try {
|
|
|
data.password = { secret: password };
|
|
|
- user = await this.model.create(data);
|
|
|
+ user = await this.model.create({ ...data, create_time: moment().format('YYYY-MM-DD HH:mm:ss') });
|
|
|
user = _.omit(user, [ 'password' ]);
|
|
|
} catch (e) {
|
|
|
this.ctx.logger.error(e);
|
|
@@ -121,7 +120,7 @@ class CardService extends CrudService {
|
|
|
record.opera = '1';
|
|
|
record.params = { name: user.name, mobile: user.mobile, level: user.level };
|
|
|
try {
|
|
|
- await this.record.create(record);
|
|
|
+ await this.record.create({ ...record, create_time: moment().format('YYYY-MM-DD HH:mm:ss') });
|
|
|
} catch (error) {
|
|
|
this.logger.error(`line-121-积分记录添加失败${JSON.stringify(record)}`);
|
|
|
}
|
|
@@ -202,7 +201,7 @@ class CardService extends CrudService {
|
|
|
record.points = this.car_point;
|
|
|
record.opera = '2';
|
|
|
try {
|
|
|
- await this.record.create(record);
|
|
|
+ await this.record.create({ ...record, create_time: moment().format('YYYY-MM-DD HH:mm:ss') });
|
|
|
} catch (error) {
|
|
|
this.logger.error(`line-202-积分记录添加失败${JSON.stringify(record)}`);
|
|
|
}
|
|
@@ -250,7 +249,7 @@ class CardService extends CrudService {
|
|
|
try {
|
|
|
record.points = 20;
|
|
|
record.opera = '3';
|
|
|
- await this.record.create(record);
|
|
|
+ await this.record.create({ ...record, create_time: moment().format('YYYY-MM-DD HH:mm:ss') });
|
|
|
} catch (error) {
|
|
|
this.logger.error(`line-250-积分记录添加失败${JSON.stringify(record)}`);
|
|
|
}
|
|
@@ -282,7 +281,7 @@ class CardService extends CrudService {
|
|
|
try {
|
|
|
record.points = points;
|
|
|
record.opera = '4';
|
|
|
- await this.record.create(record);
|
|
|
+ await this.record.create({ ...record, create_time: moment().format('YYYY-MM-DD HH:mm:ss') });
|
|
|
} catch (error) {
|
|
|
this.logger.error(`line-282-积分记录添加失败${JSON.stringify(record)}`);
|
|
|
}
|