sysDictService.js 394 B

123456789101112131415161718
  1. 'use strict';
  2. const Service = require('../service/baseService');
  3. class SysDictService extends Service {
  4. tag() {
  5. return this.ctx.model.SysDictModel;
  6. }
  7. async deleteWithSub(id) {
  8. const dbDictArr = await this.ctx.model.SysDictModel.find({ fid: id });
  9. if (dbDictArr.length > 0) {
  10. return null;
  11. }
  12. return await this.delete(id);
  13. }
  14. }
  15. module.exports = SysDictService;