📜  knex 类似查询 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:09.945000             🧑  作者: Mango

代码示例1
const getResults = (options) => {
    let query = knex('table');
    if (options.where) {
        query = query.where('franchisee_name', 'like', '%jackmarker%');
    }

    if (options.other) {
        query = query.where('company', 'like', '%marker%');
    }

    return query.select();
};