Commit db93227d by 宋毅

tj

parent bea5d42e
......@@ -4,6 +4,33 @@ class AppProductDao extends Dao {
constructor() {
super(Dao.getModelName(AppProductDao));
}
async findOneByServiceItemCode(itemCode, appId) {
return this.model.findOne({
where: {
serviceItemCode: itemCode,
app_id: appId
},
attributes: ["id",
"app_id", // 应用id
"itemCode", // 产品编码
"itemName", // 产品名称
"picUrl", // 产品图片地址
"channelItemCode", // 渠道产品编码
"channelItemName", // 渠道产品名称
"status", // 状态 0禁用 1启用
"verifyPrice", // 是否验证价格 0不验证 1验证
"proPrice", // 产品价格
"serviceCharge", // 服务费
"publicExpense", // 官费
"rateConfig", // 税率
"discountsRateConfig",// 优惠税率
"channelProfitRate",// 渠道利润分成比率(只分订单中毛利润总额的分成)
"sort",
"productType_id",
"productOneType_id"],
raw: true
});
}
async findOneByCode(itemCode, appId) {
return this.model.findOne({
where: {
......
......@@ -9,6 +9,7 @@ module.exports = (db, DataTypes) => {
picUrl :DataTypes.STRING(500),// 产品图片地址
channelItemCode :DataTypes.STRING(100),// 渠道产品编码
channelItemName :DataTypes.STRING(100),// 渠道产品名称
serviceItemCode :DataTypes.STRING(100),// 服务商产品编码
status :DataTypes.BOOLEAN,// 状态 0禁用 1启用
verifyPrice :DataTypes.BOOLEAN,// 是否验证价格 0不验证 1验证
proPrice :DataTypes.DOUBLE,// 产品价格
......
......@@ -761,7 +761,7 @@ class OrderTmProductService extends ServiceBase {
return system.getResult(null, "itemCode参数错误");
}
// itemCode="zzsbzc";//测试
var productItem = await this.appproductDao.findOneByCode(itemCode, user.app_id);//获取产品
var productItem = await this.appproductDao.findOneByServiceItemCode(itemCode, user.app_id);//获取产品
if (!productItem) {
return system.getResult(null, "未知的产品");
}
......@@ -948,7 +948,7 @@ class OrderTmProductService extends ServiceBase {
if (!itemCode) {
return system.getResultFail(-106, "产品编码参数错误");
}
var productItem = await this.appproductDao.findOneByCode(itemCode, app.id);//获取产品
var productItem = await this.appproductDao.findOneByServiceItemCode(itemCode, app.id);//获取产品
if (!productItem) {
return system.getResultFail(-107, "未知的产品");
}
......
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