How to use the orm.like function in orm

To help you get started, we’ve selected a few orm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gomeplusFED / DataPlatform / controllers / manage / videoStatis / details.js View on Github external
params(query, params) {
            params.live_play_id = params.live_play_id ? orm.like(`%${params.live_play_id ||""}%`) : orm.not_in(["all"]);
            params.ver = "all";

            return params;
        },
        //showDayUnit: true,
github HiJesse / Demeter / api / v1 / UserApi.js View on Github external
}).then(() => {
        return countUser({account: orm.like(accountLike)});
    }).then((count) => {
        userCount = count;
github HiJesse / Demeter / api / v1 / ArchiveApi.js View on Github external
}).then(count => {
        projectCount = count;
        const params = {
            projectId: splitProjectID(projectList),
            des: orm.like(archiveDesLike),
        };

        if (!isStringEmpty(platformId) && platformId !== 'null') {
            params.platformId = platformId;
        }
        return findArchiveByPage(params, pageSize, pageNum);
    }).then(archives => {
        res.json(buildResponse(RES_SUCCEED, {
github HiJesse / Demeter / api / v1 / ProjectApi.js View on Github external
}).then(() => {
        return countProject({projectName: orm.like(projectLike)});
    }).then((count) => {
        projectCount = count;
github gomeplusFED / DataPlatform / config / apiFunction / rebate.js View on Github external
rebate_shopPlan_01(query , params , sendData){

        if(query.search_key){
            if(query.search_key / 1){
                params.merchant_id = query.search_key;
            }else{
                params.shop_name = orm.like("%" + query.search_key + "%");
            }

            delete params.search_key;
            delete query.search_key;
        }
        return params;
    },
    rebate_shopPlan_01_second(query , params , sendData){
github gomeplusFED / DataPlatform / models / select.js View on Github external
module.exports.userFindAll = function(params, func) {
  var start = parseInt(params.start),
    end = parseInt(params.end),
    offset = end - start,
    model = params.model;

  var findParams = {
    is_admin: orm.ne('99')
  };
  if (params.query) {
      findParams.username = orm.like('%' + params.query + '%');
  }
  model.Users.count(findParams, function(err, count) {
    if (err) {
      func(err);
    } else {

      model.Users.find(findParams, {
        offset: start,
        limit: offset
      }, function(err, items) {
        if (err) {
          func(err);
        } else {
          func(err, items, count);
        }
      });

orm

NodeJS Object-relational mapping

MIT
Latest version published 10 months ago

Package Health Score

67 / 100
Full package analysis