Toggle navigation
Toggle navigation
This project
Loading...
Sign in
chenchao
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
a951b9407308bd4c88116af5de462db4c0b79369
1 parent
b7195dea
修改加价购商品详情返回的数据格式“
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
a951b94
...
...
@@ -63,7 +63,6 @@ class CartModel
// 调用接口获取购物车的数据
$cartData
=
CartData
::
cartData
(
$uid
,
$shoppingKey
);
print_r
(
$cartData
);
// 处理普通购物车和预售购物车的数据
do
{
...
...
@@ -657,6 +656,7 @@ class CartModel
$oneColor
=
array
();
$sizes
=
array
();
$oneSize
=
array
();
$sizeList
=
array
();
$thumbImageList
=
array
();
$colorNum
=
0
;
$totalStorageNum
=
0
;
// 总库存数
...
...
@@ -678,14 +678,16 @@ class CartModel
$colorNum
+=
$one
[
'storage_number'
];
$sizeStorageStr
.=
$one
[
'storage_number'
]
.
'/'
;
$size
s
[]
=
$oneSize
;
$size
List
[
$val
[
'color_id'
]]
[]
=
$oneSize
;
$colorStorageGroup
[
$one
[
'size_name'
]][
$val
[
'color_name'
]]
=
$one
[
'storage_number'
];
}
// 统计尺码对应的各个颜色的库存量
foreach
(
$sizes
as
&
$sizeArr
)
{
$sizeArr
[
'colorNumStr'
]
=
implode
(
'/'
,
array_values
(
$colorStorageGroup
[
$sizeArr
[
'name'
]
])
);
foreach
(
$sizes
as
$colorId
=>
$sizeArr
)
{
foreach
(
$sizeArr
as
$key
=>
$value
)
{
$sizeList
[
$colorId
][
$key
][
'colorNumStr'
]
=
implode
(
'/'
,
array_values
(
$colorStorageGroup
[
$sizeArr
[
'name'
]
])
);
}
}
// 颜色
...
...
@@ -709,6 +711,11 @@ class CartModel
$totalStorageNum
+=
$colorNum
;
}
// 格式化尺码对应的各个颜色分组
foreach
(
$colors
as
$color
)
{
$sizes
[][
'size'
]
=
$sizeList
[
$color
[
'id'
]];
}
$data
[
'thumbs'
]
=
$thumbImageList
;
$data
[
'colors'
]
=
$colors
;
$data
[
'sizes'
]
=
$sizes
;
...
...
Please
register
or
login
to post a comment