Commit 75d36e4a by v_vjyjiang

d

parent 178020b8
...@@ -484,20 +484,17 @@ class UserService extends ServiceBase { ...@@ -484,20 +484,17 @@ class UserService extends ServiceBase {
let productpricetmp = await self.db.models.productprice.findOne({ let productpricetmp = await self.db.models.productprice.findOne({
where: { skucode: skucode }, where: { skucode: skucode },
include: [ include: [
{ model: self.db.models.productcost, as: "costs", attributes: ['id', 'expensetype', 'costamount'] } { model: self.db.models.productcost, where: { expensetype: 'service' }, as: "costs", attributes: ['id', 'expensetype', 'costamount'] }
], ],
raw: true,
transaction: t transaction: t
} }
) )
let serviceCost = productpricetmp.costs.filter(c => {
if (c.expensetype == "service") {
return true
}
})
let costAmount = 0 let costAmount = 0
//获取服务费成本 //获取服务费成本
if (serviceCost.length > 0) { if (productpricetmp['costs.costamount']) {
costAmount = serviceCost[0].costamount costAmount = Number(productpricetmp['costs.costamount'])
} }
//先检查缓存是否存在bizuser todo key再加个字母d //先检查缓存是否存在bizuser todo key再加个字母d
...@@ -575,7 +572,7 @@ class UserService extends ServiceBase { ...@@ -575,7 +572,7 @@ class UserService extends ServiceBase {
} }
module.exports = UserService; module.exports = UserService;
// let userS=new UserService() // let userS = new UserService()
// userS.getBizUserForBizChance("13381139519",'好生日','工商注册').then(rtn=>{ // userS.findCosts().then(rtn => {
// console.log(rtn) // console.log(rtn['costs.costamount'])
// }) // })
\ 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