|
|
@ -40,7 +40,7 @@ class DingdanService extends Service { |
|
|
|
let chanpinItemB = await chanpinModel.find({ xiangtiaoxingma: updateItem.tiaoma }) |
|
|
|
let chanpinItemC = await chanpinModel.find({ zuidaxiangzhuangtiaoma: updateItem.tiaoma }) |
|
|
|
if (chanpinItemA.length || chanpinItemB.length || chanpinItemC.length) { |
|
|
|
updateItem = { ...updateItem, isNotSale: false } |
|
|
|
updateItem = { ...updateItem } |
|
|
|
let res = await modelLocal.updateOne({ _id: updateItem._id }, updateItem) |
|
|
|
returnData.hasError = false |
|
|
|
returnData.msg = "数据更新成功" |
|
|
@ -186,8 +186,11 @@ class DingdanService extends Service { |
|
|
|
item["chanpindaima"] = _.get(chanpinItemC, [0, "daima"], "") |
|
|
|
item["zuixiaodanweitiaoma"] = _.get(chanpinItemC, [0, "tiaoxingma"], "") |
|
|
|
item["xiaoshoushuliang"] = item.xiaoshoushuliang |
|
|
|
let zuidadanweixiangzhuangliang = Number((_.get(chanpinItemC, [0, "zuidadanweixiangzhuangliang"], 1) || 1)) |
|
|
|
item["xiugaihouxiaoshoushuliang"] = item.xiaoshoushuliang * zuidadanweixiangzhuangliang |
|
|
|
let guigexinghao = _.get(chanpinItemC, [0, "guigexinghao"], "") |
|
|
|
let guigexinghaoArr = _.split(guigexinghao, "*") |
|
|
|
let jishu = Number(guigexinghaoArr[2]) * Number(guigexinghaoArr[1]) |
|
|
|
// let zuidadanweixiangzhuangliang = Number((_.get(chanpinItemC, [0, "zuidadanweixiangzhuangliang"], 1) || 1))
|
|
|
|
item["xiugaihouxiaoshoushuliang"] = item.xiaoshoushuliang * Number(jishu) |
|
|
|
item["xiaoshoujine"] = item.xiaoshoujine |
|
|
|
item["zuigaocaigoujia"] = _.get(chanpinItemC, [0, "zuigaocaigoujia"], 0) |
|
|
|
item["xiangzhuangliang"] = _.get(chanpinItemC, [0, "xiangzhuangliang"], 0) |
|
|
|