Commit f860431c by v_vjyjiang

d

parent 7bfc6049
...@@ -490,7 +490,7 @@ class UserService extends ServiceBase { ...@@ -490,7 +490,7 @@ class UserService extends ServiceBase {
if (productpricetmp['costs.costamount']) { if (productpricetmp['costs.costamount']) {
costAmount = Number(productpricetmp['costs.costamount']) costAmount = Number(productpricetmp['costs.costamount'])
} }
console.log("skucode==================", costAmount,productpricetmp) console.log("skucode==================", costAmount, productpricetmp)
//先检查缓存是否存在bizuser todo key再加个字母d //先检查缓存是否存在bizuser todo key再加个字母d
var resultcache = await self.cacheManager["ClientBindBizUserCache"].getCache(clientMobile) var resultcache = await self.cacheManager["ClientBindBizUserCache"].getCache(clientMobile)
...@@ -576,21 +576,19 @@ class UserService extends ServiceBase { ...@@ -576,21 +576,19 @@ 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'])
} }
console.log("skucode==================", costAmount, productpricetmp)
// console.log('------------1:', JSON.stringify(productpricetmp.costs)); // console.log('------------1:', JSON.stringify(productpricetmp.costs));
//检查缓存是否存在bizuser //检查缓存是否存在bizuser
......
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