Commit c90ecf23 authored by Mac's avatar Mac

1

parent fc346aea
......@@ -309,7 +309,7 @@
unique(arr) {
for (var i = 0, len = arr.length; i < len; i++) {
for (var j = i + 1, len = arr.length; j < len; j++) {
if (arr[i].NewGoodsId === arr[j].NewGoodsId && arr[i].NewSpecificationSort === arr[j].NewSpecificationSort) {
if (arr[i].NewGoodsId === arr[j].NewGoodsId && arr[i].NewSpecificationSort === arr[j].NewSpecificationSort&& arr[i].OrderGoodsId === arr[j].OrderGoodsId) {
arr.splice(j, 1);
j--; // 每删除一个数j的值就减1
len--; // j值减小时len也要相应减1(减少循环次数,节省性能)
......
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