Authored by 郭成尧

'codereviewmodified'

@@ -86,19 +86,27 @@ exports.getSaleGoodsData = (params) => { @@ -86,19 +86,27 @@ exports.getSaleGoodsData = (params) => {
86 86
87 switch (userInfo.curLevel) { 87 switch (userInfo.curLevel) {
88 case '1': 88 case '1':
89 - finalResult.goods[key].salePrice = value.vip1Price;  
90 - finalResult.goods[key].vip1 = true; 89 + finalResult.goods[key] = {
  90 + salePrice: value.vip1Price,
  91 + vip1: true
  92 + };
91 break; 93 break;
92 case '2': 94 case '2':
93 - finalResult.goods[key].salePrice = value.vip2Price;  
94 - finalResult.goods[key].vip2 = true; 95 + finalResult.goods[key] = {
  96 + salePrice: value.vip2Price,
  97 + vip2: true
  98 + };
95 break; 99 break;
96 case '3': 100 case '3':
97 - finalResult.goods[key].salePrice = value.vip3Price;  
98 - finalResult.goods[key].vip3 = true; 101 + finalResult.goods[key] = {
  102 + salePrice: value.vip3Price,
  103 + vip3: true
  104 + };
99 break; 105 break;
100 default: 106 default:
101 - finalResult.goods[key].vip = true; 107 + finalResult.goods[key] = {
  108 + vip: true
  109 + };
102 delete finalResult.goods[key].salesPrice; 110 delete finalResult.goods[key].salesPrice;
103 break; 111 break;
104 } 112 }
@@ -317,19 +325,27 @@ exports.getSaleOthersData = (params, channel) => { @@ -317,19 +325,27 @@ exports.getSaleOthersData = (params, channel) => {
317 325
318 switch (userInfo.curLevel) { 326 switch (userInfo.curLevel) {
319 case '1': 327 case '1':
320 - finalResult.goods[key].salePrice = value.vip1_price;  
321 - finalResult.goods[key].vip1 = true; 328 + finalResult.goods[key] = {
  329 + salePrice: value.vip1_price,
  330 + vip1: true
  331 + };
322 break; 332 break;
323 case '2': 333 case '2':
324 - finalResult.goods[key].salePrice = value.vip2_price;  
325 - finalResult.goods[key].vip2 = true; 334 + finalResult.goods[key] = {
  335 + salePrice: value.vip2_price,
  336 + vip2: true
  337 + };
326 break; 338 break;
327 case '3': 339 case '3':
328 - finalResult.goods[key].salePrice = value.vip3_price;  
329 - finalResult.goods[key].vip3 = true; 340 + finalResult.goods[key] = {
  341 + salePrice: value.vip3_price,
  342 + vip3: true
  343 + };
330 break; 344 break;
331 default: 345 default:
332 - finalResult.goods[key].vip = true; 346 + finalResult.goods[key] = {
  347 + vip: true
  348 + };
333 delete finalResult.goods[key].salesPrice; 349 delete finalResult.goods[key].salesPrice;
334 break; 350 break;
335 } 351 }