Commit e7b645de by 庄冰

aaa

parent 86abab38
var system = require("../../../system")
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
var cacheBaseComp = null;
class BusinesstypeCtl extends CtlBase {
constructor() {
super("configmag", CtlBase.getServiceName(BusinesstypeCtl));
}
async refQuery(pobj, qobj, req) {
pobj.refwhere.company_id = pobj.company_id;
let rtn = await this.service.refQuery(pobj);
return rtn
}
async create(pobj, qobj, req) {
if(!pobj.p_id || pobj.p_id.length<1){
pobj["p_id"] = 0;
}
const up = await this.service.create(pobj);
return system.getResult(up);
}
}
module.exports = BusinesstypeCtl;
......@@ -24,7 +24,6 @@ class TemplatelinkCtl extends CtlBase {
* @param {*} pobj
*/
async updateLaunchStatus(pobj){
var a=9;
var result = await this.service.updateLaunchStatus(pobj);
return result;
}
......
const system=require("../../../system");
const Dao=require("../../dao.base");
class BusinesstypeDao extends Dao{
constructor(){
super(Dao.getModelName(BusinesstypeDao));
}
async refQuery(qobj) {
var w = qobj.refwhere ? qobj.refwhere : {};
w["p_id"] = 0;
if (qobj.levelinfo) {
w[qobj.levelinfo.levelfield] = qobj.levelinfo.level;
}
if (qobj.parentinfo) {
w[qobj.parentinfo.parentfield] = qobj.parentinfo.parentcode;
}
//如果需要控制数据权限
if (qobj.datapriv) {
w["id"] = { [this.db.Op.in]: qobj.datapriv };
}
if (qobj.likestr) {
w[qobj.fields[0]] = { [this.db.Op.like]: "%" + qobj.likestr + "%" };
return this.model.findAll({ where: w, attributes: qobj.fields });
} else {
return this.model.findAll({ where: w, attributes: qobj.fields });
}
}
}
module.exports=BusinesstypeDao;
......@@ -7,6 +7,7 @@
module.exports = (db, DataTypes) => {
return db.define("businesstype", {
p_id: DataTypes.INTEGER(11),//产品一类id
p_name: DataTypes.STRING,//产品一类id
code: DataTypes.STRING(100),//渠道编码
name: DataTypes.STRING(100),//渠道名称
notes: DataTypes.STRING(255),//备注
......@@ -20,7 +21,7 @@ module.exports = (db, DataTypes) => {
freezeTableName: true,
timestamps: true,
updated_at: true,
tableName: 'c_launch_channel',
tableName: 'c_business_type',
validate: {},
indexes: []
});
......
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class BusinesstypeService extends ServiceBase {
constructor() {
super("configmag", ServiceBase.getDaoName(BusinesstypeService));
}
}
module.exports = BusinesstypeService;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment