Commit 81866440 by 蒋勇

d

parent 2c932ab7
......@@ -19,8 +19,9 @@ class ProductpriceService extends ServiceBase {
let rs = await this.db.models.region.findAll({ attributes: ['code', 'name'], raw: true })
//获取地区JSON 对象
let psrtn = []
let cacheregions={}
ps.forEach(r => {
let rpathstr = r.pname.split("~")[0]
let rpathstr = r.pname.split("~")[1]
let rpatharray = rpathstr.split("/")
let lstindex = rpatharray.length - 1
let regionName = rpatharray[lstindex]
......@@ -34,8 +35,12 @@ class ProductpriceService extends ServiceBase {
return false
}
})
regioninfo["code"] = String(areainfos[0].code).padEnd(6,'0')
psrtn.push(regioninfo)
let codeval=String(areainfos[0].code).padEnd(6,'0')
if(!cacheregions[codeval]){
cacheregions[codeval]=regioninfo
regioninfo["code"] = codeval
psrtn.push(regioninfo)
}
})
return psrtn
}
......
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