Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
f7e8416ddde2cf37e09a77e156f3e9dc9cc0d9c7
2 parents
20a8d865
ec5aa4e4
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
256 additions
and
178 deletions
library/LibModels/Web/Product/BrandData.php
library/LibModels/Web/Product/HotrankData.php
library/Plugin/HelperSearch.php
template/www.yohobuy.com/partials/product/list.phtml
yohobuy/www.yohobuy.com/application/Bootstrap.php
yohobuy/www.yohobuy.com/application/controllers/Common.php
yohobuy/www.yohobuy.com/application/models/Passport/Passport.php
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
yohobuy/www.yohobuy.com/application/models/Product/Hotrank.php
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Login.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
yohobuy/www.yohobuy.com/configs/routes.index.ini
library/LibModels/Web/Product/BrandData.php
View file @
f7e8416
...
...
@@ -18,7 +18,7 @@ class BrandData
{
const
URI_BRAND_TOPPOS
=
'operations/api/v5/resource/get'
;
const
URL_BRAND_LOGO
=
'/
shops/service/v1/brand
'
;
const
URL_BRAND_LOGO
=
'/
cmsproduct/service/v1/brands
'
;
const
URL_BRAND_FOLDER
=
'/cmsproduct/service/v1/brands'
;
const
URL_BRAND_NODECONTENT
=
'/operations/service/v6/htmlcontent'
;
...
...
@@ -76,9 +76,9 @@ class BrandData
* @param int $domain 品牌domain
* @return array
*/
public
static
function
getBrandLogoByDomain
(
$domain
)
public
static
function
getBrandLogoByDomain
(
$domain
,
$fields
=
'less'
)
{
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URL_BRAND_LOGO
,
'getBrandByDomain'
,
array
(
$domain
));
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URL_BRAND_LOGO
,
'getBrandByDomain'
,
array
(
$domain
,
$fields
));
}
/**
...
...
library/LibModels/Web/Product/HotrankData.php
View file @
f7e8416
...
...
@@ -9,7 +9,7 @@ use Api\Yohobuy;
*/
class
HotrankData
extends
\LibModels\Wap\Product\SearchData
{
const
URI_HOTRANK_TAG
=
'
http://test.service.api.yohobuy.com/
operations/service/v1/hotranktag'
;
const
URI_HOTRANK_TAG
=
'operations/service/v1/hotranktag'
;
/**
* 获取标签
...
...
@@ -19,7 +19,7 @@ class HotrankData extends \LibModels\Wap\Product\SearchData
public
static
function
getHotranktag
(
$client_type
=
'web'
,
$channel
=
0
,
$is_concurrent
=
true
)
{
$params
=
array
(
'client_type'
=>
$client_type
,
'channel'
=>
$channel
,
'is_concurrent'
=>
$is_concurrent
);
return
Yohobuy
::
yarClient
(
self
::
URI_HOTRANK_TAG
,
'getTag'
,
$params
);
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_HOTRANK_TAG
,
'getTag'
,
$params
);
}
/**
...
...
@@ -29,6 +29,6 @@ class HotrankData extends \LibModels\Wap\Product\SearchData
public
static
function
getTagById
(
$id
,
$is_concurrent
=
true
)
{
$params
[
'id'
]
=
$id
;
return
Yohobuy
::
yarClient
(
self
::
URI_HOTRANK_TAG
,
'getOneTag'
,
$params
);
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_HOTRANK_TAG
,
'getOneTag'
,
$params
);
}
}
\ No newline at end of file
...
...
library/Plugin/HelperSearch.php
View file @
f7e8416
...
...
@@ -83,7 +83,7 @@ class HelperSearch
//一周新品上架
$result
[
'leftContent'
][][
'newSales'
]
=
isset
(
$data
[
'recent'
])
?
self
::
recentShelve
(
$data
[
'recent'
][
'recent'
])
:
array
();
//品牌banner
$result
[
'brandBanner'
]
=
isset
(
$data
[
'b
anner'
])
&&
isset
(
$data
[
'brand'
])
?
self
::
getBannerFormat
(
$data
[
'banner'
],
$data
[
'brand
'
])
:
array
();
$result
[
'brandBanner'
]
=
isset
(
$data
[
'b
rand'
])
?
self
::
getBannerFormat
(
$data
[
'brand'
],
$options
[
'brandBanner
'
])
:
array
();
//总记录数
$result
[
'totalCount'
]
=
$data
[
'product'
][
'total'
];
//品牌店铺信息
...
...
@@ -1248,19 +1248,6 @@ class HelperSearch
return Yohobuy::httpBuildQuery(Yohobuy::API_URL,
$param
);
}
/**
* 并行调接口url获取(获取品牌banner数据)
*/
public static function getBannerUrl(
$customOptions
= array())
{
// 构建必传参数
$param
= Yohobuy::param();
$param['brand_id']
=
$customOptions['brandId']
;
$param['method']
= 'app.brand.banner';
$param['client_secret']
= Sign::getSign(
$param
);
return Yohobuy::httpBuildQuery(Yohobuy::API_URL,
$param
);
}
/**
...
...
@@ -1278,13 +1265,12 @@ class HelperSearch
*
* @return array 品牌banner条数据
*/
public static function getBannerFormat(
$b
anner
,
$brand
)
public static function getBannerFormat(
$b
rand
,
$brandBanner
)
{
// 根据品牌Id获取品牌banner图
if (isset(
$banner['banner']
)) {
$bannerImg
= Helpers::getImageUrl(
$banner['banner']
, '', 150);
}
$bannerImg
= Helpers::getImageUrl(
$brandBanner
, '', 150);
$brandHome
= Helpers::url('/product/index/brand', '',
$brand['brand_domain']
);
$brandIntro
= Helpers::url('/product/index/brandIntro', '',
$brand['brand_domain']
);
$is_favorite
= false;
if(isset(
$brand['is_favorite']
)){
// 获取是否收藏
...
...
@@ -1299,7 +1285,9 @@ class HelperSearch
return array(
'bannerHeight' => '150',
'coled' =>
$is_favorite
,
'banner' =>
$bannerImg
'banner' =>
$bannerImg
,
'brandHome' =>
$brandHome
,
'brandIntro' =>
$brandIntro
);
}
...
...
template/www.yohobuy.com/partials/product/list.phtml
View file @
f7e8416
...
...
@@ -25,9 +25,9 @@
<div
class=
"center-content clearfix"
>
{
{>
layout/path-nav
}
}
{
{#
brandAbout
}
}
{
{#
if
brandAbout
}
}
<div
class=
"brand-about"
>
{
{{brand
Intro
}
}}
{
{{brand
About
}
}}
</div>
{
{^
}
}
<div
class=
"list-left pull-left"
>
...
...
@@ -54,7 +54,7 @@
{
{>
product/latest-walk
}
}
</div>
{
{/
brandAbout
}
}
{
{/
if
}
}
</div>
{
{/
list
}
}
</div>
...
...
yohobuy/www.yohobuy.com/application/Bootstrap.php
View file @
f7e8416
...
...
@@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
$controller
=
'Index'
;
$action
=
'Index'
;
// 二级域名
if
(
2
===
$level
)
{
if
(
3
===
$level
)
{
$url
=
strtolower
(
$dispatcher
->
getRequest
()
->
getRequestUri
());
if
(
empty
(
$url
)
||
$url
==
'/index'
||
$url
==
'/'
)
{
$urlAction
=
'/index'
;
...
...
yohobuy/www.yohobuy.com/application/controllers/Common.php
View file @
f7e8416
...
...
@@ -159,5 +159,68 @@ class CommonController extends WebAction
return
$this
->
helpJsonCallbackResult
(
$callback
,
403
,
'意见反馈失败'
,
''
);
}
}
/*
* 简单头部
*/
public
function
getSimpleHeaderAction
()
{
$result
=
array
();
do
{
/* 判断是不是AJAX请求 */
if
(
!
$this
->
isAjax
())
{
break
;
}
//获取用户
$uid
=
$this
->
getUid
(
true
);
if
(
!
$uid
)
{
$isLogin
=
false
;
$username
=
''
;
}
else
{
$isLogin
=
true
;
$username
=
$this
->
_uname
;
}
//拼接简单头部
$tool
=
array
(
'favorite'
=>
Helpers
::
url
(
'/home/favorite?t='
.
time
()),
//我的收藏链接
'coupon'
=>
Helpers
::
url
(
'/home/coupons?t='
.
time
()),
//我的优惠券链接
'order'
=>
Helpers
::
url
(
'/home/orders?t='
.
time
()),
//订单中心连接
'help'
=>
Helpers
::
url
(
'/help'
),
);
if
(
$isLogin
)
{
$tool
+=
array
(
'user'
=>
$username
,
'userCenter'
=>
Helpers
::
url
(
'/home?t='
.
time
()),
//用户中心链接
'logout'
=>
Helpers
::
url
(
'/logout.html?t='
.
time
()),
//退出
);
}
else
{
$tool
+=
array
(
'login'
=>
Helpers
::
url
(
'/signin.html'
),
//登录链接,已登录不传
'register'
=>
Helpers
::
url
(
'/reg.html'
),
//注册链接,已登录不传
);
}
$simpleHeader
=
array
(
'user'
=>
$username
,
'href'
=>
$tool
,
'logo'
=>
array
(
'img'
=>
'http://static.yohobuy.com/newheader/img/logo_e.png'
,
'url'
=>
SITE_MAIN
),
);
$result
=
array
(
'code'
=>
200
,
'data'
=>
$simpleHeader
);
}
while
(
false
);
$this
->
echoJson
(
$result
);
}
}
\ No newline at end of file
...
...
yohobuy/www.yohobuy.com/application/models/Passport/Passport.php
View file @
f7e8416
...
...
@@ -20,26 +20,27 @@ use Plugin\Captcha;
class
PassportModel
{
const
REGISTER_LEFT_BANNER_CODE
=
'c479ec90120cae7f96e52922b4917064'
;
//注册左边的banner
const
BACK_LFFT_BANNER_CODE
=
'3bbaf502c447a2ddad60879042e286d8'
;
//找回密码左边的banner
const
SIGNIN_LEFT_BANNER_CODE
=
'db350894e01e90eac55cd3a13ad77331'
;
//登录页左边的banner
const
AUTOUSERINFO_LEFT_BANNER_CODE
=
'c62d5da06d843b6ed78d8d27e87fa143'
;
//完善信息页左边的banner
const
REGISTER_LEFT_BANNER_CODE
=
'c479ec90120cae7f96e52922b4917064'
;
//注册左边的banner
const
BACK_LFFT_BANNER_CODE
=
'3bbaf502c447a2ddad60879042e286d8'
;
//找回密码左边的banner
const
SIGNIN_LEFT_BANNER_CODE
=
'db350894e01e90eac55cd3a13ad77331'
;
//登录页左边的banner
const
AUTOUSERINFO_LEFT_BANNER_CODE
=
'c62d5da06d843b6ed78d8d27e87fa143'
;
//完善信息页左边的banner
const
BACK_FIND_SECRET_KEY
=
'_+@#$%^'
;
//简单头部
public
static
function
getSimpleHeader
(
$isLogin
,
$username
=
''
)
{
//拼接简单头部
$tool
=
array
(
'favoriteHref'
=>
Helpers
::
url
(
'/home/favorite/index'
),
//我的收藏链接
'couponHref'
=>
Helpers
::
url
(
'/home/coupons/index'
),
//我的优惠券链接
'orderHref'
=>
Helpers
::
url
(
'/home/orders/index'
),
//订单中心连接
'favoriteHref'
=>
Helpers
::
url
(
'/home/favorite?t='
.
time
()),
//我的收藏链接
'couponHref'
=>
Helpers
::
url
(
'/home/coupons?t='
.
time
()),
//我的优惠券链接
'orderHref'
=>
Helpers
::
url
(
'/home/orders?t='
.
time
()),
//订单中心连接
'helpHref'
=>
Helpers
::
url
(
'/help'
),
);
if
(
$isLogin
)
{
$tool
+=
array
(
'user'
=>
$username
,
'userCenter'
=>
Helpers
::
url
(
'/home/index'
),
//用户中心链接
'logoutHref'
=>
Helpers
::
url
(
'/passport/signout/index'
),
//退出
'userCenter'
=>
Helpers
::
url
(
'/home?t='
.
time
()),
//用户中心链接
'logoutHref'
=>
Helpers
::
url
(
'/logout.html?t='
.
time
()),
//退出
);
}
else
{
...
...
@@ -68,13 +69,13 @@ class PassportModel
*/
public
static
function
getLeftBanner
(
$code
)
{
$ret
=
array
(
'img'
=>
''
,
'url'
=>
''
);
$ret
=
array
(
'img'
=>
''
,
'url'
=>
''
);
$resource
=
IndexData
::
getResourceData
(
$code
);
if
(
isset
(
$resource
[
'data'
][
0
]))
{
if
(
$resource
[
'data'
][
0
][
'template_name'
]
==
'single_image'
)
{
if
(
isset
(
$resource
[
'data'
][
0
]))
{
if
(
$resource
[
'data'
][
0
][
'template_name'
]
==
'single_image'
)
{
$val
=
current
(
$resource
[
'data'
][
0
][
'data'
]);
}
else
if
(
$resource
[
'data'
][
0
][
'template_name'
]
==
'single_name_image'
)
{
}
else
if
(
$resource
[
'data'
][
0
][
'template_name'
]
==
'single_name_image'
)
{
$val
=
$resource
[
'data'
][
0
][
'data'
];
}
$ret
[
'img'
]
=
Images
::
getImageUrl
(
$val
[
'src'
],
252
,
190
);
...
...
@@ -86,7 +87,7 @@ class PassportModel
}
return
$ret
;
}
/**
* 校验验证码
*
...
...
@@ -98,12 +99,12 @@ class PassportModel
$verifyCode
=
strtolower
(
$verifyCode
);
$ret
=
true
;
//检测验证码不正确
if
(
$verifyCode
!=
strtolower
(
Captcha
::
getFromSession
(
'passport_istration'
)))
{
if
(
$verifyCode
!=
strtolower
(
Captcha
::
getFromSession
(
'passport_istration'
)))
{
$ret
=
false
;
}
return
$ret
;
}
/**
* 根据手机号获取用户信息
*
...
...
@@ -111,31 +112,34 @@ class PassportModel
* @param string $mobile
* @return array
*/
public
static
function
getUserInfoByMobile
(
$area
,
$mobile
)
{
public
static
function
getUserInfoByMobile
(
$area
,
$mobile
)
{
$ret
=
array
();
$data
=
UserData
::
getUserInfoByMobile
(
$area
,
$mobile
);
if
(
$data
[
'code'
]
==
200
)
{
if
(
!
empty
(
$data
[
'data'
]))
{
if
(
$data
[
'code'
]
==
200
)
{
if
(
!
empty
(
$data
[
'data'
]))
{
$ret
=
current
(
$data
[
'data'
]);
}
}
return
$ret
;
}
/**
* 根据邮箱获取用户信息
*
* @param string $email
* @return array
*/
public
static
function
getUserInfoByEmail
(
$email
)
{
public
static
function
getUserInfoByEmail
(
$email
)
{
$ret
=
array
();
$data
=
UserData
::
getUserInfoByEmail
(
$email
);
if
(
$data
[
'code'
]
==
200
)
{
if
(
!
empty
(
$data
[
'data'
]))
{
if
(
$data
[
'code'
]
==
200
)
{
if
(
!
empty
(
$data
[
'data'
]))
{
$ret
=
current
(
$data
[
'data'
]);
}
}
return
$ret
;
}
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
View file @
f7e8416
...
...
@@ -38,7 +38,7 @@ class BrandsModel
$adNav
=
self
::
getAdNav
(
$options
[
'brandId'
]);
$data
[
'leftContent'
][]
=
array
(
'picLink'
=>
$adNav
);
//获取静态内容
(eg:20141219-100447)
//获取静态内容
if
(
$options
[
'node'
])
{
$nodeContent
=
HelperSearch
::
formatNodeContent
(
$options
[
'node'
]);
$data
[
'leftContent'
][][
'picLink'
][
'list'
]
=
$nodeContent
;
...
...
@@ -46,7 +46,44 @@ class BrandsModel
return
$data
;
}
/**
* 品牌介绍页
* @param array $customCondition
* @param array $customOptions
* @return array
*/
public
static
function
getBrandIntro
(
$customCondition
=
array
(),
$customOptions
=
array
())
{
$urlList
=
array
();
//组合搜索品牌url
$urlList
[
'brand'
]
=
HelperSearch
::
getBrandUrl
(
$customOptions
);
//批量调接口
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
if
(
isset
(
$result
[
'brand'
]))
{
$banner
=
HelperSearch
::
getBannerFormat
(
$result
[
'brand'
],
$customOptions
[
'brandBanner'
]);
}
return
array
(
'brandBanner'
=>
$banner
,
'brandAbout'
=>
$customOptions
[
'brandAbout'
]
);
}
//获取品牌系列数据
public
static
function
getAdNav
(
$brandId
,
$status
=
1
)
{
...
...
@@ -86,18 +123,17 @@ class BrandsModel
//组合搜索品牌url
$urlList
[
'brand'
]
=
HelperSearch
::
getBrandUrl
(
$customOptions
);
//组合获取品牌banner url
$urlList
[
'banner'
]
=
HelperSearch
::
getBannerUrl
(
$customOptions
);
//组合用户浏览记录url
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
//批量调接口
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
//组织模板数据格式
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
return
$data
;
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Hotrank.php
View file @
f7e8416
...
...
@@ -9,6 +9,32 @@ use \LibModels\Web\Product\SearchData;
class
HotrankModel
{
/**
* 获取热销排行频道资源
*
* @param string $channel
* @return array
*/
static
public
function
getChannelResource
()
{
$channel
=
isset
(
$_COOKIE
[
'_Channel'
])
?
$_COOKIE
[
'_Channel'
]
:
'boys'
;
switch
(
$channel
)
{
case
'boys'
:
$resource
=
array
(
'channel'
=>
'boys'
,
'gender'
=>
'1,3'
,
'road'
=>
1
,
'code'
=>
'80d772d8dff25300a2a2e4c97165330c'
);
return
$resource
;
case
'girls'
:
$resource
=
array
(
'channel'
=>
'girls'
,
'gender'
=>
'2,3'
,
'road'
=>
2
,
'code'
=>
'8df64e505e94edb9881fd1e7efb702e9'
);
return
$resource
;
case
'lifestyle'
:
$resource
=
array
(
'channel'
=>
'lifestyle'
,
'gender'
=>
''
,
'road'
=>
4
,
'code'
=>
'd131aba83a84a6977eee3a7403a713de'
);
return
$resource
;
case
'kids'
:
$resource
=
array
(
'channel'
=>
'kids'
,
'gender'
=>
''
,
'road'
=>
3
,
'code'
=>
'bd6a06a08f8ca9b0db762f78e0bc5b68'
);
return
$resource
;
}
}
/**
* 人气单品 一周热卖
*/
static
public
function
getSearchData
(
$param
,
$page
,
$ajax
)
...
...
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Login.php
View file @
f7e8416
...
...
@@ -5,6 +5,7 @@ use LibModels\Web\Passport\RegData;
use
LibModels\Web\Passport\LoginData
;
use
Passport\PassportModel
as
PassportModel
;
use
Plugin\Helpers
;
class
LoginController
extends
WebAction
{
...
...
@@ -93,7 +94,6 @@ class LoginController extends WebAction
$account
=
trim
(
$this
->
post
(
'account'
));
$password
=
trim
(
$this
->
post
(
'password'
));
$isRemember
=
trim
(
$this
->
post
(
'isRemember'
));
$isRemember
=
false
;
if
(
!
is_numeric
(
$area
)
||
empty
(
$account
)
||
empty
(
$password
))
{
break
;
}
...
...
@@ -119,17 +119,6 @@ class LoginController extends WebAction
if
(
!
isset
(
$data
[
'code'
])
||
$data
[
'code'
]
!=
200
||
!
isset
(
$data
[
'data'
][
'uid'
]))
{
break
;
}
//登录成功记录账户信息
if
(
$isRemember
)
{
$this
->
setCookie
(
'account'
,
$this
->
encrypt
(
$account
),
time
()
+
3600
*
24
*
7
,
'/'
);
$this
->
setCookie
(
'userInfo'
,
$this
->
encrypt
(
$password
),
time
()
+
3600
*
24
*
7
,
'/'
);
$this
->
setCookie
(
'isRemember'
,
$isRemember
,
time
()
+
3600
*
24
*
7
);
}
else
{
$this
->
setCookie
(
'account'
,
''
,
-
1
,
'/'
);
$this
->
setCookie
(
'userInfo'
,
''
,
-
1
,
'/'
);
$this
->
setCookie
(
'isRemember'
,
''
,
-
1
,
'/'
);
}
$refer
=
$this
->
getCookie
(
'refer'
);
if
(
empty
(
$refer
)
||
strstr
(
$refer
,
'signin.html'
)
||
strstr
(
$refer
,
'passport/login/index'
))
{
...
...
@@ -138,7 +127,7 @@ class LoginController extends WebAction
else
{
$refer
=
rawurldecode
(
$refer
);
}
$data
[
'data'
][
'session'
]
=
Helpers
::
syncUserSession
(
$data
[
'data'
][
'uid'
],
$refer
);
$data
[
'data'
][
'session'
]
=
Helpers
::
syncUserSession
(
$data
[
'data'
][
'uid'
],
$refer
);
$data
[
'data'
][
'href'
]
=
$refer
;
$token
=
Helpers
::
makeToken
(
$data
[
'data'
][
'uid'
]);
...
...
@@ -172,59 +161,4 @@ class LoginController extends WebAction
$this
->
go
(
$refer
);
}
/*
* 加密算法
*/
private
function
encrypt
(
$data
,
$key
=
'yohobuy'
)
{
$key
=
md5
(
$key
);
$x
=
0
;
$str
=
''
;
$char
=
''
;
$len
=
strlen
(
$data
);
$l
=
strlen
(
$key
);
for
(
$i
=
0
;
$i
<
$len
;
$i
++
)
{
if
(
$x
==
$l
)
{
$x
=
0
;
}
$char
.=
$key
{
$x
};
$x
++
;
}
for
(
$i
=
0
;
$i
<
$len
;
$i
++
)
{
$str
.=
chr
(
ord
(
$data
{
$i
})
+
(
ord
(
$char
{
$i
}))
%
256
);
}
return
base64_encode
(
$str
);
}
/*
* 解密算法
*/
private
function
decrypt
(
$data
,
$key
=
'yohobuy'
)
{
$key
=
md5
(
$key
);
$x
=
0
;
$str
=
''
;
$char
=
''
;
$data
=
base64_decode
(
$data
);
$len
=
strlen
(
$data
);
$l
=
strlen
(
$key
);
for
(
$i
=
0
;
$i
<
$len
;
$i
++
)
{
if
(
$x
==
$l
)
{
$x
=
0
;
}
$char
.=
substr
(
$key
,
$x
,
1
);
$x
++
;
}
for
(
$i
=
0
;
$i
<
$len
;
$i
++
)
{
if
(
ord
(
substr
(
$data
,
$i
,
1
))
<
ord
(
substr
(
$char
,
$i
,
1
)))
{
$str
.=
chr
((
ord
(
substr
(
$data
,
$i
,
1
))
+
256
)
-
ord
(
substr
(
$char
,
$i
,
1
)));
}
else
{
$str
.=
chr
(
ord
(
substr
(
$data
,
$i
,
1
))
-
ord
(
substr
(
$char
,
$i
,
1
)));
}
}
return
$str
;
}
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
f7e8416
...
...
@@ -8,10 +8,6 @@ use LibModels\Web\Home\IndexData;
class
IndexController
extends
WebAction
{
public
$channel
;
public
$gender
;
public
$road
;
//频道
public
$code
;
/**
* 品牌首页
*/
...
...
@@ -24,10 +20,13 @@ class IndexController extends WebAction
}
$uid
=
$this
->
getUid
();
//根据品牌域名获取品牌id(同时判断品牌域名是否有效)
$brandInfo
=
BrandData
::
getBrandLogoByDomain
(
$domain
);
if
(
!
empty
(
$brandInfo
[
'data'
])
&&
$brandInfo
[
'code'
]
===
200
)
{
$fields
=
'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code'
;
$brandInfo
=
BrandData
::
getBrandLogoByDomain
(
$domain
,
$fields
);
if
(
!
empty
(
$brandInfo
[
'data'
])
&&
$brandInfo
[
'code'
]
==
200
)
{
$brandId
=
$brandInfo
[
'data'
][
'id'
];
$node
=
isset
(
$brandInfo
[
'static_content_code'
])
?
$brandInfo
[
'static_content_code'
]
:
false
;
$node
=
isset
(
$brandInfo
[
'data'
][
'static_content_code'
])
?
$brandInfo
[
'data'
][
'static_content_code'
]
:
false
;
$brandBanner
=
$brandInfo
[
'data'
][
'brand_banner'
];
}
else
{
$this
->
go
(
SITE_MAIN
);
}
...
...
@@ -42,6 +41,8 @@ class IndexController extends WebAction
$options
[
'uid'
]
=
$uid
;
$options
[
'brandId'
]
=
$brandId
;
$options
[
'node'
]
=
$node
;
$options
[
'brandBanner'
]
=
$brandBanner
;
$options
[
'reviewNum'
]
=
6
;
//调用模型获得数据
$data
=
Product\BrandsModel
::
getBrandSearchData
(
$condition
,
$options
);
...
...
@@ -56,46 +57,66 @@ class IndexController extends WebAction
$this
->
_view
->
display
(
'list'
,
$data
);
}
//品牌介绍页
public
function
brandIntroAction
()
{
//品牌域名
$domain
=
$this
->
param
(
'named'
);
if
(
empty
(
$domain
))
{
$this
->
go
(
SITE_MAIN
);
}
$uid
=
$this
->
getUid
();
//根据品牌域名获取品牌id(同时判断品牌域名是否有效)
$fields
=
'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro'
;
$brandInfo
=
BrandData
::
getBrandLogoByDomain
(
$domain
,
$fields
);
if
(
!
empty
(
$brandInfo
[
'data'
])
&&
$brandInfo
[
'code'
]
==
200
)
{
$brandId
=
$brandInfo
[
'data'
][
'id'
];
$brandBanner
=
$brandInfo
[
'data'
][
'brand_banner'
];
$brandAbout
=
$brandInfo
[
'data'
][
'brand_intro'
];
}
else
{
$this
->
go
(
SITE_MAIN
);
}
//品牌ID参数
$condition
=
array
();
$condition
[
'brand'
]
=
$brandId
;
//$options参数数组
$options
=
array
();
$options
[
'brandName'
]
=
$domain
;
$options
[
'uid'
]
=
$uid
;
$options
[
'brandId'
]
=
$brandId
;
$options
[
'brandBanner'
]
=
$brandBanner
;
$options
[
'brandAbout'
]
=
$brandAbout
;
//调用模型获得数据
$data
=
Product\BrandsModel
::
getBrandIntro
(
$condition
,
$options
);
$data
=
array
(
//初始化js
'searchListPage'
=>
true
,
'list'
=>
$data
);
$this
->
setWebNavHeader
();
//渲染模板
$this
->
_view
->
display
(
'list'
,
$data
);
}
/**
* 热销排行
*/
public
function
hotrankAction
()
{
//获取频道
$cookie
=
$this
->
getCookie
(
'_Channel'
);
$this
->
channel
=
isset
(
$cookie
)
?
$cookie
:
'boys'
;
switch
(
$this
->
channel
)
{
case
'boys'
:
$this
->
gender
=
'1,3'
;
$this
->
road
=
1
;
$this
->
code
=
'80d772d8dff25300a2a2e4c97165330c'
;
break
;
case
'girls'
:
$this
->
gender
=
'2,3'
;
$this
->
road
=
2
;
$this
->
code
=
'8df64e505e94edb9881fd1e7efb702e9'
;
break
;
case
'lifestyle'
:
$this
->
gender
=
''
;
$this
->
road
=
4
;
$this
->
code
=
'd131aba83a84a6977eee3a7403a713de'
;
break
;
case
'kids'
:
$this
->
gender
=
''
;
$this
->
road
=
3
;
$this
->
code
=
'bd6a06a08f8ca9b0db762f78e0bc5b68'
;
break
;
}
$this
->
setWebNavHeader
(
\Index\HomeModel
::
$this
->
channel
);
$channel
=
\product\HotrankModel
::
getChannelResource
();
$this
->
setWebNavHeader
(
$channel
[
'channel'
]);
$data
=
array
(
'hotrankPage'
=>
true
,
'footerTop'
=>
true
,
'hotrank'
=>
array
()
);
//焦点图 热门品牌
$focus
=
\Index\HomeModel
::
getChannelResource
(
$
this
->
channel
,
$this
->
code
);
$focus
=
\Index\HomeModel
::
getChannelResource
(
$
channel
[
'channel'
],
$channel
[
'code'
]
);
$data
[
'hotrank'
][
'slide'
]
=
$focus
[
0
][
'slide'
];
$data
[
'hotrank'
][
'hotBrands'
]
=
$focus
[
1
][
'hotBrands'
];
...
...
@@ -103,15 +124,15 @@ class IndexController extends WebAction
$page
=
$this
->
get
(
'page'
,
1
);
$sort_id
=
$this
->
get
(
'sid'
,
0
);
$viewNum
=
60
;
$param
=
array
(
'order'
=>
's_n_desc'
,
'viewNum'
=>
$viewNum
,
'page'
=>
$page
,
'stocknumber'
=>
1
,
'status'
=>
1
,
'gender'
=>
$
this
->
gender
,
'attribute_not'
=>
2
);
$param
=
array
(
'order'
=>
's_n_desc'
,
'viewNum'
=>
$viewNum
,
'page'
=>
$page
,
'stocknumber'
=>
1
,
'status'
=>
1
,
'gender'
=>
$
channel
[
'gender'
]
,
'attribute_not'
=>
2
);
if
(
$sort_id
!=
0
)
{
$param
[
'sort'
]
=
$sort_id
;
}
if
(
$
this
->
road
==
3
)
if
(
$
channel
[
'road'
]
==
3
)
{
$param
[
'msort'
]
=
365
;
}
elseif
(
$
this
->
road
==
4
){
}
elseif
(
$
channel
[
'road'
]
==
4
){
$param
[
'msort'
]
=
10
;
}
else
{
$param
[
'not_maxSortId'
]
=
'10,365'
;
...
...
@@ -119,9 +140,9 @@ class IndexController extends WebAction
$publiclist
=
\product\HotrankModel
::
getSearchData
(
$param
,
$page
,
0
);
$data
[
'hotrank'
][
'popular'
]
=
$publiclist
[
'popular'
];
$data
[
'hotrank'
][
'hotWeek'
]
=
$publiclist
[
'hotWeek'
];
//分类标签
$nav
=
\product\HotrankModel
::
getHotranktag
(
'web'
,
$
this
->
road
,
true
);
$nav
=
\product\HotrankModel
::
getHotranktag
(
'web'
,
$
channel
[
'road'
]
,
true
);
$data
[
'hotrank'
][
'hotWeek'
][
'nav'
]
=
$nav
;
$this
->
_view
->
display
(
'hotrank'
,
$data
);
}
...
...
@@ -131,6 +152,7 @@ class IndexController extends WebAction
*/
public
function
getdataAction
()
{
$page
=
$this
->
get
(
'page'
,
1
);
//加载到100个以后停止
if
(
$page
>
2
)
...
...
@@ -150,15 +172,17 @@ class IndexController extends WebAction
$sort
=
$info
[
'data'
][
'category_id'
];
}
}
$viewNum
=
60
;
$viewNum
=
60
;
//获取频道资源
$channel
=
\product\HotrankModel
::
getChannelResource
();
$param
=
array
(
'order'
=>
's_n_desc'
,
'viewNum'
=>
$viewNum
,
'page'
=>
$page
,
'sort'
=>
$sort
,
'stocknumber'
=>
1
,
'status'
=>
1
,
'gender'
=>
$
this
->
gender
,
'attribute_not'
=>
2
);
'gender'
=>
$
channel
[
'gender'
],
'attribute_not'
=>
2
,
);
if
(
empty
(
$param
[
'sort'
]))
{
if
(
$
this
->
road
==
3
)
if
(
$
channel
[
'road'
]
==
3
)
{
$param
[
'msort'
]
=
365
;
}
elseif
(
$
this
->
road
==
4
){
}
elseif
(
$
channel
[
'road'
]
==
4
){
$param
[
'msort'
]
=
10
;
}
else
{
$param
[
'not_maxSortId'
]
=
'10,365'
;
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
f7e8416
...
...
@@ -9,7 +9,8 @@ class ListController extends WebAction
$positionId
=
10
;
//搜素banner 位置id
$condition
=
array
();
$options
=
array
(
'positionId'
=>
$positionId
'positionId'
=>
$positionId
,
'reviewNum'
=>
6
);
$indexData
=
Product\IndexModel
::
getIndexData
(
$condition
,
$options
);
...
...
@@ -31,7 +32,8 @@ class ListController extends WebAction
);
$options
=
array
(
'specialsale_id'
=>
'Y'
,
'needDay'
=>
'Y'
'needDay'
=>
'Y'
,
'reviewNum'
=>
6
);
$newData
=
Product\NewModel
::
getNewSearchData
(
$condition
,
$options
);
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
View file @
f7e8416
...
...
@@ -41,7 +41,8 @@ class SaleController extends WebAction
$options
=
array
(
'specialsale_id'
=>
'Y'
,
'controller'
=>
$this
->
_request
->
controller
'controller'
=>
$this
->
_request
->
controller
,
'reviewNum'
=>
6
);
$saleData
=
Product\SaleModel
::
getSaleSearchData
(
$condition
,
$options
,
$specialInfo
);
...
...
yohobuy/www.yohobuy.com/configs/routes.index.ini
View file @
f7e8416
...
...
@@ -21,7 +21,7 @@ routes.login.route.action = Index
; 登录退出页
routes.logout.type
=
"rewrite"
routes.logout.match
=
"/
passport/signout/index
"
routes.logout.match
=
"/
logout.html
"
routes.logout.route.module
=
Passport
routes.logout.route.controller
=
Login
routes.logout.route.action
=
Out
...
...
Please
register
or
login
to post a comment