Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
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
hf
9 years ago
Commit
412f746ff194714639856888d8c05ba108f1bca6
1 parent
90f71c13
code review by fei.hong : do modify product detail size choose parameter
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
library/Plugin/Helpers.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
library/Plugin/Helpers.php
View file @
412f746
...
...
@@ -129,7 +129,7 @@ class Helpers
*/
public
static
function
getShoppingKeyByCookie
()
{
$cookie
=
isset
(
$_COOKIE
[
'_
spk'
])
?
$_COOKIE
[
'_spk
'
]
:
''
;
$cookie
=
isset
(
$_COOKIE
[
'_
SPK'
])
?
$_COOKIE
[
'_SPK
'
]
:
''
;
return
$cookie
;
}
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
412f746
...
...
@@ -167,6 +167,7 @@ class DetailModel
$colorGroup
=
array
();
$sizeGroup
=
array
();
$goodsGroup
=
array
();
$sizeName
=
''
;
$colorList
=
array
();
$sizeList
=
array
();
$allSizeList
=
array
();
// 所有尺码列表
...
...
@@ -195,6 +196,7 @@ class DetailModel
// 商品的尺码列表
$colorStorageGroup
[
$value
[
'productSkc'
]
]
=
array
();
if
(
isset
(
$value
[
'goodsSizeBoList'
]))
{
$sizeName
=
''
;
foreach
(
$value
[
'goodsSizeBoList'
]
as
$size
)
{
$sizeList
[
$value
[
'productSkc'
]
][]
=
array
(
'id'
=>
$size
[
'id'
],
...
...
@@ -204,12 +206,14 @@ class DetailModel
'name'
=>
$size
[
'sizeName'
],
'sizeNum'
=>
$size
[
'goodsSizeStorageNum'
],
);
$sizeName
=
$size
[
'sizeName'
];
// 所有尺码列表,赋值用于前端展示默认尺码的时候 判断出没有库存则显示灰色
$allSizeList
[
$size
[
'sizeName'
]
]
=
empty
(
$allSizeList
[
$size
[
'sizeName'
]
])
?
$size
[
'goodsSizeStorageNum'
]
:
$allSizeList
[
$size
[
'sizeName'
]
];
$allSizeList
[
$sizeName
]
=
empty
(
$allSizeList
[
$sizeName
][
'storage'
])
?
array
(
'storage'
=>
$size
[
'goodsSizeStorageNum'
],
'id'
=>
$size
[
'id'
])
:
$allSizeList
[
$sizeName
];
$colorStorageNum
+=
intval
(
$size
[
'goodsSizeStorageNum'
]);
$colorStorageGroup
[
$value
[
'productSkc'
]][
$size
[
'sizeName'
]
]
=
$size
[
'goodsSizeStorageNum'
];
$colorStorageGroup
[
$value
[
'productSkc'
]
][
$sizeName
]
=
$size
[
'goodsSizeStorageNum'
];
}
// 颜色分组
...
...
@@ -235,7 +239,8 @@ class DetailModel
// 默认尺码
$sizeGroup
[
0
][
'size'
][]
=
array
(
'name'
=>
$sizeName
,
// 尺码名称
'sizeNum'
=>
empty
(
$value
)
?
false
:
true
,
// 是否有库存 (false:表示没有库存,true:表示有库存)
'sizeNum'
=>
empty
(
$value
[
'storage'
])
?
false
:
true
,
// 是否有库存 (false:表示没有库存,true:表示有库存)
'id'
=>
$value
[
'id'
],
);
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
...
...
@@ -243,7 +248,7 @@ class DetailModel
$colorArr
[
'colorNum'
]
=
isset
(
$colorStorageGroup
[
$colorArr
[
'skcId'
]
][
$sizeName
])
?
$colorStorageGroup
[
$colorArr
[
'skcId'
]
][
$sizeName
]
:
0
;
$colorGroup
[
$i
][
'color'
][]
=
$colorArr
;
}
$colorGroup
[
$i
][
'
sizeName'
]
=
$sizeName
;
$colorGroup
[
$i
][
'
id'
]
=
$value
[
'id'
]
;
++
$i
;
}
...
...
Please
register
or
login
to post a comment