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
yangyang
9 years ago
Commit
71ae3cb40742c2018d4693178b68fd9e599bf609
1 parent
8b47e033
ajax请求商品图片修改
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
23 deletions
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
yohobuy/www.yohobuy.com/application/models/Product/Index.php
yohobuy/www.yohobuy.com/application/models/Product/New.php
yohobuy/www.yohobuy.com/application/models/Product/Sale.php
yohobuy/www.yohobuy.com/application/models/Product/Search.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
View file @
71ae3cb
...
...
@@ -133,7 +133,7 @@ class BrandsModel
$urlList
[
'brand'
]
=
SearchData
::
getBrandUrl
(
$customOptions
);
//批量调接口
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
$result
=
Yohobuy
::
getMulti
(
$urlList
);
//组织模板数据格式
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
...
...
yohobuy/www.yohobuy.com/application/models/Product/Index.php
View file @
71ae3cb
...
...
@@ -26,7 +26,7 @@ class IndexModel
$urlList
[
'sort'
]
=
SearchData
::
getClassesUrl
(
$searchCondition
[
'sortCondition'
]);
//批量调接口获取数据
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
$result
=
Yohobuy
::
getMulti
(
$urlList
);
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
...
...
yohobuy/www.yohobuy.com/application/models/Product/New.php
View file @
71ae3cb
...
...
@@ -25,7 +25,7 @@ class NewModel
// 组合搜索最新上架url
$urlList
[
'recent'
]
=
SearchData
::
getRecentShelveUrl
(
$searchCondition
[
'condition'
]);
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
$result
=
Yohobuy
::
getMulti
(
$urlList
);
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
...
...
yohobuy/www.yohobuy.com/application/models/Product/Sale.php
View file @
71ae3cb
...
...
@@ -27,7 +27,7 @@ class SaleModel
$urlList
[
'sort'
]
=
SearchData
::
getClassesUrl
(
$searchCondition
[
'sortCondition'
]);
//批量调接口
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
$result
=
Yohobuy
::
getMulti
(
$urlList
);
//组织模板数据格式
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
71ae3cb
...
...
@@ -33,8 +33,8 @@ class SearchModel
'query'
=>
FILTER_SANITIZE_STRING
,
'brand'
=>
FILTER_SANITIZE_STRING
,
'sort'
=>
FILTER_VALIDATE_INT
,
'msort'
=>
FILTER_VALIDATE_INT
,
'misort'
=>
FILTER_VALIDATE_INT
,
'msort'
=>
FILTER_SANITIZE_STRING
,
'misort'
=>
FILTER_SANITIZE_STRING
,
'color'
=>
FILTER_VALIDATE_INT
,
'size'
=>
FILTER_DEFAULT
,
'style'
=>
FILTER_DEFAULT
,
...
...
@@ -156,7 +156,7 @@ class SearchModel
// 组合搜索折扣区间url
$urlList
[
'discount'
]
=
SearchData
::
getDiscountUrl
(
$searchCondition
[
'condition'
]);
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
$result
=
Yohobuy
::
getMulti
(
$urlList
);
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
return
$data
;
...
...
@@ -238,7 +238,7 @@ class SearchModel
'pics'
=>
$data
,
'isFavorite'
=>
$options
[
'isFavorite'
]
);
echo
json_encode
(
$res
)
;
return
$res
;
}
/**
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
71ae3cb
...
...
@@ -45,7 +45,10 @@ class ListController extends WebAction
$newData
=
NewModel
::
getNewSearchData
(
$condition
,
$options
);
$data
=
array
(
'productListPage'
=>
true
,
'newSale'
=>
$newData
'newSale'
=>
$newData
,
'title'
=>
'潮流商品搜索 | YOHO!有货'
,
'keywords'
=>
'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流'
,
'description'
=>
'潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜'
);
$this
->
setWebNavHeader
();
//渲染模板
...
...
@@ -72,7 +75,10 @@ class ListController extends WebAction
$data
=
array
(
//初始化js
'productListPage'
=>
true
,
'list'
=>
$list
'list'
=>
$list
,
'title'
=>
'潮流商品搜索 | YOHO!有货'
,
'keywords'
=>
'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流'
,
'description'
=>
'潮流商品搜索,上衣,衬衫,TEE,卫衣,冲锋衣,风衣,羽绒服,裤子,休闲鞋,板鞋,配饰,复古眼镜'
);
$this
->
setWebNavHeader
();
$this
->
_view
->
display
(
'list'
,
$data
);
...
...
@@ -85,13 +91,18 @@ class ListController extends WebAction
*/
public
function
getProductPicAction
()
{
$res
=
array
(
'code'
=>
400
);
if
(
!
$this
->
isAjax
())
{
$this
->
echoJson
(
$res
);
return
;
}
$product
_skn
=
$this
->
post
(
'skn'
);
//TODO
$product
Skn
=
$this
->
post
(
'skn'
);
$uid
=
$this
->
getUid
();
if
(
!
$product_skn
)
{
if
(
!
$productSkn
)
{
$this
->
echoJson
(
$res
);
return
;
}
//大图
...
...
@@ -114,43 +125,46 @@ class ListController extends WebAction
$isFavorite
=
false
;
if
(
$uid
)
{
$favorite
=
FavoriteData
::
getUidProductFav
(
$uid
,
$product
_s
kn
);
$favorite
=
FavoriteData
::
getUidProductFav
(
$uid
,
$product
S
kn
);
if
(
isset
(
$favorite
[
'code'
])
&&
$favorite
[
'code'
]
==
200
)
{
$isFavorite
=
true
;
}
}
$options
[
'isFavorite'
]
=
$isFavorite
;
SearchModel
::
getProductPic
(
$product_skn
,
$options
);
//TODO
$res
=
SearchModel
::
getProductPic
(
$productSkn
,
$options
);
$this
->
echoJson
(
$res
);
}
/**
* 根据product
_s
kn收藏
* 根据product
S
kn收藏
* @author
* @return json
*/
public
function
changeFavoriteAction
()
{
$result
=
array
(
'code'
=>
400
);
if
(
!
$this
->
isAjax
())
{
$this
->
echoJson
(
$resut
);
return
;
}
$product
_s
kn
=
$this
->
post
(
'skn'
);
$product
S
kn
=
$this
->
post
(
'skn'
);
$isFavorite
=
$this
->
post
(
'isFavorite'
);
$uid
=
$this
->
getUid
();
do
{
if
(
!
$product_skn
&&
!
$uid
)
{
break
;
//TODO
if
(
!
$productSkn
&&
!
$uid
)
{
break
;
}
if
(
$isFavorite
)
{
$result
=
FavoriteData
::
delUidProductFav
(
$uid
,
$product_skn
);
$this
->
echoJson
(
$result
);
$result
=
FavoriteData
::
delUidProductFav
(
$uid
,
$productSkn
);
break
;
}
else
{
$result
=
FavoriteData
::
addUidProductFav
(
$uid
,
$product_skn
);
$this
->
echoJson
(
$result
);
$result
=
FavoriteData
::
addUidProductFav
(
$uid
,
$productSkn
);
break
;
}
}
while
(
false
);
$this
->
echoJson
(
$result
);
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment