Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

2 anos atrás
123456789101112131415161718192021
  1. module.exports = {
  2. exists: async function(value, options) {
  3. if (!value) return true;
  4. const db = this.getDbConnection(options.connection);
  5. const results = await db.from(options.table).where(options.column, value).limit(1);
  6. return results.length > 0;
  7. },
  8. notexists: async function(value, options) {
  9. if (!value) return true;
  10. const db = this.getDbConnection(options.connection);
  11. const results = await db.from(options.table).where(options.column, value).limit(1);
  12. return results.length == 0;
  13. }
  14. };