AttributeDAO.js 637 B

123456789101112131415161718192021
  1. var path = require("path");
  2. daoModule = require("./DAO");
  3. databaseModule = require(path.join(process.cwd(),"modules/database"));
  4. /**
  5. * 获取参数列表数据
  6. *
  7. * @param {[type]} cat_id 分类ID
  8. * @param {[type]} sel 类型
  9. * @param {Function} cb 回调函数
  10. */
  11. module.exports.list = function(cat_id,sel,cb) {
  12. db = databaseModule.getDatabase();
  13. sql = "SELECT * FROM sp_attribute WHERE cat_id = ? AND attr_sel = ? AND delete_time is NULL";
  14. database.driver.execQuery(
  15. sql
  16. ,[cat_id,sel],function(err,attributes){
  17. if(err) return cb("查询执行出错");
  18. cb(null,attributes);
  19. });
  20. }