Commit 9e3ae63f by 庄冰

channel

parent f7a0fa02
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("launchchannel", { return db.define("launchchannel", {
only_code:DataTypes.STRING(255),//渠道唯一码
code: DataTypes.STRING(100),//表单编码 code: DataTypes.STRING(100),//表单编码
name: DataTypes.STRING(100),//表单名称 name: DataTypes.STRING(100),//表单名称
notes: DataTypes.STRING(255),//备注 notes: DataTypes.STRING(255),//备注
......
...@@ -47,13 +47,14 @@ class NeedinfoService extends ServiceBase { ...@@ -47,13 +47,14 @@ class NeedinfoService extends ServiceBase {
return system.getResultFail(-107,"联系电话不能为空!") return system.getResultFail(-107,"联系电话不能为空!")
} }
var channel = await this.launchchannelDao.model.findOne({ var channel = await this.launchchannelDao.model.findOne({
attributes:["code","name"], attributes:["code","name","only_code"],
where:{code:ab.channel_code},raw:true where:{code:ab.channel_code},raw:true
}); });
if(!channel || !channel.code){ if(!channel || !channel.code){
return system.getResultFail(-300,"渠道信息不存在") return system.getResultFail(-300,"渠道信息不存在")
} }
ab["channel_name"] = channel.name; ab["channel_name"] = channel.name;
ab["channel_only_code"] = channel.only_code || "";
return ab; return ab;
} }
//推送需求至队列 //推送需求至队列
......
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