Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
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
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
a6fad003bd5a013ec3713aba054fe496b596c66c
2 parents
0801ddd9
3db3d450
search
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
349 additions
and
313 deletions
framework
library/Plugin/HelperSearch.php
static/js/cart/order-ensure.js
template/www.yohobuy.com/actions/index/boys/index.phtml
template/www.yohobuy.com/partials/index/boy-recommend.phtml
template/www.yohobuy.com/partials/index/boy-singlehot.phtml
template/www.yohobuy.com/partials/index/category-floor.phtml
template/www.yohobuy.com/partials/index/girl-recommend.phtml
template/www.yohobuy.com/partials/index/girl-singlehot.phtml
template/www.yohobuy.com/partials/index/preference-brand.phtml
template/www.yohobuy.com/partials/passport/register.phtml
template/www.yohobuy.com/partials/product/good.phtml
template/www.yohobuy.com/partials/product/left-content.phtml
web-static/js/common/new-arrivls.js
web-static/js/home/home.js
web-static/js/passport/reg.js
web-static/js/product/filter.js
web-static/sass/home/_index-pliffy.scss
web-static/sass/passport/_register.scss
web-static/sass/product/_filter-box.scss
web-static/sass/product/_good.scss
web-static/sass/product/_sort-pager.scss
yohobuy/www.yohobuy.com/application/models/Product/Search.php
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Register1.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
framework
@
75bbc3b0
Subproject commit
e9d066dd88a8e7e37103021c427a205a5cfcdcec
Subproject commit
75bbc3b075de19f239532f60c5995d06c5f814e2
...
...
library/Plugin/HelperSearch.php
View file @
a6fad00
...
...
@@ -102,15 +102,15 @@ class HelperSearch
$result
[
'opts'
][
'pageCount'
]
=
$data
[
'product'
][
'page_total'
];
$result
[
'opts'
][
'nextHref'
]
=
(
$next
=
self
::
next
(
$data
[
'product'
][
'page_total'
],
$data
[
'product'
][
'filter'
]))
?
$next
[
'href'
]
:
''
;
$result
[
'hasNextPage'
]
=
self
::
next
(
$data
[
'product'
][
'page_total'
]);
//全部折扣
$result
[
'leftContent'
][][
'allDiscount'
]
=
isset
(
$data
[
'discount'
])
?
self
::
getDiscount
(
$data
[
'discount'
][
'discount'
])
:
array
();
//分类条件
$result
[
'filters'
][
'sort'
]
=
isset
(
$data
[
'sort'
])
?
self
::
searchSort
(
$data
[
'sort'
][
'sort'
])
:
array
();
//左侧分类分类
$result
[
'leftContent'
][][
'allSort'
]
=
isset
(
$data
[
'sort'
])
?
self
::
groupSort
(
$data
[
'sort'
][
'sort'
])
:
array
();
//一周新品上架
$result
[
'leftContent'
][][
'newSales'
]
=
isset
(
$data
[
'recent'
])
?
self
::
recentShelve
(
$data
[
'recent'
][
'recent'
])
:
array
();
//全部折扣
$result
[
'leftContent'
][][
'allDiscount'
]
=
isset
(
$data
[
'discount'
])
?
self
::
getDiscount
(
$data
[
'discount'
][
'discount'
])
:
array
();
//总记录数
//总记录数
$result
[
'totalCount'
]
=
$data
[
'product'
][
'total'
];
//品牌店铺信息
$result
[
'shopEntry'
]
=
isset
(
$data
[
'shop'
])
&&
!
empty
(
$data
[
'shop'
])
?
self
::
shop
(
$data
[
'shop'
],
$data
[
'sort'
][
'sort'
])
:
array
();
...
...
static/js/cart/order-ensure.js
View file @
a6fad00
...
...
@@ -86,6 +86,7 @@ $('.invoice').on('touchend', '.checkbox', function() {
if
(
$this
.
hasClass
(
'icon-checkbox'
))
{
$
(
'.invoice'
).
removeClass
(
'focus'
);
}
return
false
;
});
function
orderCompute
(
firstEnter
)
{
...
...
template/www.yohobuy.com/actions/index/boys/index.phtml
View file @
a6fad00
...
...
@@ -8,7 +8,7 @@
{
{!
新品速报
}
}
{
{#
newReport
}
}
<div
class=
"new-report clearfix"
>
<div
class=
"new-report
imgopacity
clearfix"
>
{
{>
index/floor-header
}
}
<ul
class=
"report-list clearfix"
>
...
...
@@ -40,7 +40,7 @@
<div
class=
"preference-brand"
>
{
{>
index/floor-header
}
}
<div
class=
"img-brand"
>
<ul
class=
"img-list clearfix"
>
<ul
class=
"img-list
imgopacity
clearfix"
>
{
{#
imgBrand
}
}
<li
class=
"img-item"
>
<a
href=
"{{href}}"
target=
"_blank"
>
...
...
@@ -58,7 +58,7 @@
</a>
</div>
</div>
<div
class=
"logo-brand"
data-url=
"{{brandUrl}}"
></div>
<div
class=
"logo-brand
imgopacity
"
data-url=
"{{brandUrl}}"
></div>
</div>
{
{/
preferenceBrands
}
}
...
...
template/www.yohobuy.com/partials/index/boy-recommend.phtml
View file @
a6fad00
...
...
@@ -14,14 +14,14 @@
{
{/
category
}
}
</div>
</div>
<div
class=
"tpl-brands clearfix"
>
<div
class=
"tpl-brands
imgopacity
clearfix"
>
<ul>
{
{#each
brands
}
}
<li><a
title=
"{{name}}"
href=
"{{href}}"
target=
"_blank"
><img
class=
"lazy"
data-original=
"{{img}}"
/></a></li>
{
{/each
}
}
</ul>
</div>
<div
class=
"tpl-types clearfix"
>
<div
class=
"tpl-types
imgopacity
clearfix"
>
<ul>
{
{#each
types
}
}
<li><a
title=
"{{name}}"
href=
"{{href}}"
target=
"_blank"
><img
class=
"lazy"
data-original=
"{{img}}"
/></a></li>
...
...
@@ -29,7 +29,7 @@
</ul>
</div>
</div>
<div
class=
"tpl-products clearfix"
>
<div
class=
"tpl-products
imgopacity
clearfix"
>
<ul>
{
{#each
products
}
}
<li><a
href=
"{{href}}"
title=
"{{name}}"
target=
"_blank"
><img
class=
"lazy"
data-original=
"{{img}}"
/></a></li>
...
...
template/www.yohobuy.com/partials/index/boy-singlehot.phtml
View file @
a6fad00
<div class="singlehot clearfix">
{{> index/floor-header}}
<ul class="g-list">
<ul class="g-list
imgopacity
">
{{#each imgHot}}
<li><a class="impo{{@index}}" href="{{href}}" target= "_blank"><img class="lazy" data-original="{{img}}"/></a></li>
{{/each}}
...
...
template/www.yohobuy.com/partials/index/category-floor.phtml
View file @
a6fad00
{
{>
index/floor-header
}
}
<div
class=
"categorys-list"
>
<div
class=
"categorys-list
imgopacity
"
>
<ul
class=
"clearfix"
>
{
{#
list
}
}
<li
class=
"cate-item{{@index}}"
>
...
...
template/www.yohobuy.com/partials/index/girl-recommend.phtml
View file @
a6fad00
...
...
@@ -14,12 +14,12 @@
{
{/
category
}
}
</div>
</div>
<div
class=
"tpl-brands clearfix"
>
<div
class=
"tpl-brands
imgopacity
clearfix"
>
{
{#each
brands
}
}
<a
title=
"{{name}}"
href=
"{{href}}"
target=
"_blank"
><img
class=
"lazy"
data-original=
"{{img}}"
/></a>
{
{/each
}
}
</div>
<div
class=
"tpl-types clearfix"
>
<div
class=
"tpl-types
imgopacity
clearfix"
>
<ul>
{
{#each
types
}
}
<li><a
title=
"{{name}}"
href=
"{{href}}"
target=
"_blank"
><img
class=
"lazy"
data-original=
"{{img}}"
/></a></li>
...
...
template/www.yohobuy.com/partials/index/girl-singlehot.phtml
View file @
a6fad00
<div class="commodity clearfix">
{{> index/floor-header}}
<div class="commodity-list">
<ul class="g-list clearfix">
<ul class="g-list
imgopacity
clearfix">
{{#each imgHot}}
<li>
<a href="{{href}}" target= "_blank"><div class="commodity-img">
...
...
@@ -16,7 +16,7 @@
{{/each}}
</ul>
</div>
<div class="commodity-brands clearfix">
<div class="commodity-brands
imgopacity
clearfix">
{{#each brands}}
<a href="{{href}}" title="{{name}}" target= "_blank"><img class="lazy" data-original="{{img}}"/></a>
{{/each}}
...
...
template/www.yohobuy.com/partials/index/preference-brand.phtml
View file @
a6fad00
{
{>
index/floor-header
}
}
<div
class=
"preference-brand"
>
<div
class=
"preference-brand
imgopacity
"
>
<div
class=
"img-slider-wrapper clearfix"
>
<div
class=
"img-brand-switch"
>
<a
class=
"prev iconfont"
href=
"javascript:;"
>
60
f;</a>
...
...
@@ -15,6 +15,6 @@
</ul>
</div>
</div>
<div
class=
"logo-brand"
data-url=
"{{brandUrl}}"
>
<div
class=
"logo-brand
"
data-url=
"{{brandUrl}}"
>
</div>
</div>
\ No newline at end of file
...
...
template/www.yohobuy.com/partials/passport/register.phtml
View file @
a6fad00
<div class="register-page">
<!--<form id="register-form" class="register-form" method="POST" action="{{actionUrl}}" autocomplete="off">-->
<ul>
<li class="clearfix">
<select id="region" class="region" name="region">
{{#each region}}
<option {{#if selected}}selected="selected"{{/if}} value="{{areaCode}}">{{name}}</option>
{{/each}}
</select>
</li>
<li class="clearfix" data-index="0">
<span id="country-code" class="country-code">{{location}}</span>
<input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off">
</li>
<li class="w330 clearfix" data-index="1">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
<a class="link change-captcha">换一张</a>
</li>
<li class="clearfix" data-index="2">
<input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4">
<input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码">
<span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span>
</li>
<li class="clearfix" data-index="3">
<input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password">
<div class="pwd-intensity-container">
<span class="pwd-intensity low">低</span>
<span class="pwd-intensity mid">中</span>
<span class="pwd-intensity high">高</span>
</div>
<div id="pwd-tips" class="hide pwd-tips">
<div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div>
</div>
</li>
<ul>
<li class="clearfix">
<select id="region" class="region" name="region">
{{#each region}}
<option {{#if selected}}selected="selected"{{/if}} value="{{areaCode}}">{{name}}</option>
{{/each}}
</select>
</li>
<li class="clearfix" data-index="0">
<span id="country-code" class="country-code">{{location}}</span>
<input value="" id="phone-num" class="input va phone-num" type="text" name="phoneNum" placeholder="请输入手机号码" autocomplete="off">
</li>
<li class="w330 clearfix" data-index="1">
<input id="captcha" class="input va captcha" type="text" name="captcha" placeholder="图形验证码" autocomplete="off" maxlength="4">
<img id="captcha-img" class="captcha-img" src="{{captchaUrl}}" alt="">
<a class="link change-captcha">换一张</a>
</li>
<li class="clearfix" data-index="2">
<input id="msg-captcha" class="input va msg-captcha" type="text" name="msgCaptcha" placeholder="短信验证码" autocomplete="off" maxlength="4">
<input id="send-captcha" class="btn send-captcha disable" type="button" value="获取短信验证码">
<span id="msg-tip" class="hide msg-tip">短信验证码已发送至您的手机,请查收</span>
</li>
<li class="clearfix" data-index="3">
<input id="pwd" class="input va pwd" name="pwd" placeholder="设置密码" autocomplete="off" maxlength="20" type="password">
<div class="pwd-intensity-container">
<span class="pwd-intensity low">低</span>
<span class="pwd-intensity mid">中</span>
<span class="pwd-intensity high">高</span>
</div>
<div id="pwd-tips" class="hide pwd-tips">
<div class="default" id="pwd-tip1"><i></i>密码只支持6-20位字符</div>
<div class="default" id="pwd-tip2"><i></i>建议由字母、 数字、 符号两种以上组合</div>
</div>
</li>
<li class="items-container clearfix">
<input id="agree-terms" class="agree-terms" type="checkbox" checked="">
<span>
我已阅读并同意遵守
<a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a>
</span>
</li>
<li class="clearfix">
<input name="refer" id="refer" type="hidden" value="{{referUrl}}">
<input id="register-btn" class="btn register-btn disable" type="submit" value="{{regBtnText}}" disabled="">
</li>
{{# loginUrl}}
<li class="quick-login-container">
我已注册YOHO!有货账号
<a class="link go-login" href="{{.}}">完善信息</a>
</li>
{{/loginUrl}}
<li class="items-container clearfix">
<input id="agree-terms" class="agree-terms" type="checkbox" checked="">
<span>
我已阅读并同意遵守
<a class="link go-yoho-items" href="{{itemUrl}}">YOHO!有货服务条款</a>
</span>
</li>
<li class="clearfix">
<input name="refer" id="refer" type="hidden" value="{{referUrl}}">
<input id="register-btn" class="btn register-btn disable" type="submit" value="{{regBtnText}}" disabled="">
</li>
{{# loginUrl}}
<li class="quick-login-container">
我已注册YOHO!有货账号
<a class="link go-login" href="{{.}}">快速登录</a>
</li>
{{/loginUrl}}
{{# skipUrl}}
<li class="skip-user-info">
<a href="{{.}}">跳过此步</a>
</li>
{{/skipUrl}}
{{# skipUrl}}
<li class="skip-user-info">
<a href="{{.}}">跳过此步</a>
</li>
{{/skipUrl}}
</ul>
<div id="err-tip" class="err-tip hide">
<span></span>
<b></b>
</div>
<!--</form>-->
</ul>
<div id="err-tip" class="err-tip hide">
<span></span>
<b></b>
</div>
</div>
\ No newline at end of file
...
...
template/www.yohobuy.com/partials/product/good.phtml
View file @
a6fad00
...
...
@@ -39,12 +39,12 @@
<div class="good-detail-text">
<a href="{{url}}">{{name}}</a>
<p class="price">
<span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">
¥{{salePrice}}
</span>
{{# marketPrice}}
<span class="market-price">¥{{.}}</span>
{{/ marketPrice}}
<span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">
¥{{salePrice}}
</span>
</p>
</div>
</div>
\ No newline at end of file
...
...
template/www.yohobuy.com/partials/product/left-content.phtml
View file @
a6fad00
...
...
@@ -9,7 +9,7 @@
<span>
{
{updateNum
}
}</span>
</li>
{
{#each
list
}
}
<li
{
{#if
active
}
}
active
{
{/if
}
}>
<li
{
{#if
active
}
}
class=
"active"
{
{/if
}
}>
<a
href=
"{{href}}"
>
{
{name
}
}</a>
<span>
{
{num
}
}</span>
</li>
...
...
@@ -80,4 +80,4 @@
{
{/each
}
}
</ul>
{
{/
picLink
}
}
{
{/
leftContent
}
}
\ No newline at end of file
{
{/
leftContent
}
}
...
...
web-static/js/common/new-arrivls.js
View file @
a6fad00
...
...
@@ -165,7 +165,7 @@ module.exports = function(data) {
load
.
tpl
=
'{{#each this}}'
;
load
.
tpl
+=
'<div class="good-info" data-skn="{{skn}}">'
;
load
.
tpl
+=
'<div class="good-info
imgopacity
" data-skn="{{skn}}">'
;
load
.
tpl
+=
' <div class="tag-container clearfix">'
;
load
.
tpl
+=
' {{# tags}}'
;
load
.
tpl
+=
' {{# isNew}}'
;
...
...
web-static/js/home/home.js
View file @
a6fad00
...
...
@@ -16,6 +16,13 @@ require('../common/logo-brand');
require
(
'../common/accordion'
);
$
(
document
).
on
(
'mouseenter'
,
'.imgopacity a img'
,
function
()
{
$
(
this
).
css
(
'opacity'
,
0.8
);
});
$
(
document
).
on
(
'mouseout'
,
'.imgopacity a img'
,
function
()
{
$
(
this
).
css
(
'opacity'
,
1
);
});
if
(
homePage
===
'brands'
)
{
require
(
'./brands'
);
}
...
...
web-static/js/passport/reg.js
View file @
a6fad00
...
...
@@ -29,7 +29,9 @@ var $pwdIntensity = $('.pwd-intensity'),
//signup验证
var
$region
=
$
(
'#country-code'
),
$regionSelect
=
$
(
'#region'
);
$regionSelect
=
$
(
'#region'
),
isPwd
=
false
,
pwdVal
;
setTimeout
(
function
()
{
$pn
.
val
(
''
);
...
...
@@ -43,10 +45,13 @@ setTimeout(function() {
$ca
.
attr
(
'maxlength'
,
caCount
);
//密码规则提示
$pwd
.
focus
(
function
()
{
$pwd
.
focus
(
function
(
event
)
{
$pwdTips
.
removeClass
(
'hide'
);
isPwd
=
true
;
pwdVal
=
$
(
this
).
val
();
}).
blur
(
function
()
{
$pwdTips
.
addClass
(
'hide'
);
isPwd
=
false
;
});
...
...
@@ -509,6 +514,23 @@ exports.init = function(page) {
});
});
// 防止粘贴密码
/*$('#pwd, #repwd').keydown(function (event) {
console.log(event.ctrlKey);
console.log(isPwd);
console.log(event.keyCode);
if (event.ctrlKey && isPwd && event.keyCode === 86) {
$(this).val(pwdVal);
}
});*/
$pwd
[
0
].
onpaste
=
function
()
{
return
false
;
};
//ajax表单提交
$registerBtn
.
click
(
function
()
{
...
...
web-static/js/product/filter.js
View file @
a6fad00
...
...
@@ -105,7 +105,7 @@ $brandMulti.click(function() {
if
(
$brandPanel
.
css
(
'display'
)
===
'none'
)
{
//显示品牌面板
brandShowMore
(
);
$brandMore
.
trigger
(
'click'
);
}
$brandPanel
.
addClass
(
'multi'
);
//显示出checkbox
...
...
@@ -178,9 +178,9 @@ $('.multi-select-cancel').click(function() {
var
$panel
=
$
(
this
).
closest
(
'.multi'
);
if
(
$panel
.
hasClass
(
'brand-panel'
))
{
brandHideMore
();
$brandMulti
.
removeClass
(
'hide'
);
//显示多选按钮
$brandMore
.
trigger
(
'click'
);
}
$panel
.
removeClass
(
'multi'
);
...
...
web-static/sass/home/_index-pliffy.scss
View file @
a6fad00
...
...
@@ -221,6 +221,7 @@
background-color
:
rgb
(
255
,
87
,
92
);
color
:
#fff
;
border-radius
:
30px
;
z-index
:
2
;
}
.commodity-img
{
position
:
relative
;
...
...
web-static/sass/passport/_register.scss
View file @
a6fad00
...
...
@@ -27,7 +27,7 @@
outline
:
none
;
}
input
{
input
.input
{
height
:
43px
;
line-height
:
43px
;
font-size
:
16px
;
...
...
@@ -53,28 +53,26 @@
float
:
left
;
}
&
.send-captcha
{
top
:
0
;
background
:
#ff1901
;
position
:
absolute
;
width
:
100px
;
right
:
0
;
font-size
:
12px
;
text-indent
:
0
;
letter-spacing
:
0
;
&
.disable
{
background
:
#555
;
}
}
&
.agree-terms
{
width
:
initial
;
height
:
initial
;
vertical-align
:
middle
;
}
}
input
.send-captcha
{
top
:
0
;
background
:
#ff1901
;
position
:
absolute
;
width
:
100px
;
right
:
0
;
font-size
:
12px
;
text-indent
:
0
;
letter-spacing
:
0
;
&
.disable
{
background
:
#555
;
}
}
.link
{
text-decoration
:
underline
;
color
:
#ff1901
;
...
...
web-static/sass/product/_filter-box.scss
View file @
a6fad00
...
...
@@ -3,7 +3,7 @@
.section
{
padding
:
10px
15px
;
font-size
:
1
4
px
;
font-size
:
1
2
px
;
border-top
:
1px
solid
#dfdfdf
;
&
:first-child
{
...
...
web-static/sass/product/_good.scss
View file @
a6fad00
...
...
@@ -52,6 +52,11 @@
>
.price
{
margin-top
:
10px
;
}
.market-price
{
text-decoration
:
line-through
;
color
:
#999
;
}
}
.col-btn
{
...
...
web-static/sass/product/_sort-pager.scss
View file @
a6fad00
...
...
@@ -7,11 +7,11 @@
.sort-type
,
.checks
{
color
:
#ccc
;
font-size
:
1
4
px
;
font-size
:
1
2
px
;
padding
:
0
10px
;
.iconfont
{
font-size
:
1
4
px
;
font-size
:
1
2
px
;
}
&
.active
,
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
a6fad00
<?php
namespace
Product
;
use
Api\Yohobuy
;
use
Plugin\Helpers
;
use
Plugin\HelperSearch
;
use
\LibModels\Web\Product\SearchData
;
/**
* sale首页模板数据模型
*
* @name SaleModel
* @package models
* @copyright yoho.inc
* @version 1.0 (2015-12-17 13:54:56)
* @author sefon
*/
class
SearchModel
{
/**
* 搜索相关页面公共条件处理
* @param $param
* @param $option
* @return mixed
*/
public
static
function
searchCondition
(
$param
,
$option
)
{
/* 过滤请求参数 */
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'query'
=>
FILTER_SANITIZE_STRING
,
'brand'
=>
FILTER_SANITIZE_STRING
,
'sort'
=>
FILTER_VALIDATE_INT
,
'msort'
=>
FILTER_VALIDATE_INT
,
'misort'
=>
FILTER_VALIDATE_INT
,
'color'
=>
FILTER_VALIDATE_INT
,
'size'
=>
FILTER_DEFAULT
,
'style'
=>
FILTER_DEFAULT
,
'price'
=>
FILTER_DEFAULT
,
'gender'
=>
FILTER_SANITIZE_STRING
,
'p_d'
=>
FILTER_DEFAULT
,
'shelve_time'
=>
FILTER_DEFAULT
,
'isNew'
=>
FILTER_DEFAULT
,
'specialoffer'
=>
FILTER_DEFAULT
,
'limited'
=>
FILTER_DEFAULT
,
'order'
=>
FILTER_DEFAULT
,
'viewNum'
=>
FILTER_VALIDATE_INT
,
'rowNum'
=>
FILTER_VALIDATE_INT
,
'page'
=>
FILTER_VALIDATE_INT
),
false
);
//关键字
if
(
isset
(
$condition
[
'query'
])
&&
!
empty
(
$condition
[
'query'
]))
{
$condition
[
'query'
]
=
rawurldecode
(
$condition
[
'query'
]);
}
//品牌
if
(
isset
(
$condition
[
'brand'
])
&&
!
empty
(
$condition
[
'brand'
]))
{
$condition
[
'brand'
]
=
rawurldecode
(
$condition
[
'brand'
]);
}
//性别
if
(
isset
(
$condition
[
'gender'
])
&&
!
empty
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
else
{
$condition
[
'gender'
]
=
Helpers
::
getGenderByCookie
();
}
//每页显示商品数
$viewNumArray
=
array
(
60
,
100
,
200
);
if
(
!
isset
(
$condition
[
'viewNum'
])
||
empty
(
$condition
[
'viewNum'
])){
$condition
[
'viewNum'
]
=
60
;
}
if
(
!
in_array
(
$condition
[
'viewNum'
],
$viewNumArray
))
{
$condition
[
'viewNum'
]
=
60
;
}
//每行显示的商品数量
if
(
!
isset
(
$condition
[
'rowNum'
])
||
empty
(
$condition
[
'rowNum'
])){
$condition
[
'rowNum'
]
=
5
;
}
if
(
$condition
[
'rowNum'
]
==
6
)
{
$imgSize
=
array
(
195
,
260
);
$minImgSize
=
array
(
50
,
67
);
}
else
{
$condition
[
'rowNum'
]
=
5
;
$imgSize
=
array
(
235
,
314
);
$minImgSize
=
array
(
60
,
80
);
}
//自定义搜索价格
if
(
isset
(
$condition
[
'price'
])
&&
!
empty
(
$condition
[
'price'
]))
{
$price
=
explode
(
','
,
$condition
[
'price'
]);
if
(
!
$price
[
0
])
{
$price
[
0
]
=
0
;
}
if
(
!
$price
[
1
])
{
$price
[
1
]
=
99999
;
}
$condition
[
'price'
]
=
implode
(
','
,
$price
);
}
//返回搜索条件
$condition
[
'needFilter'
]
=
1
;
//过滤赠品
$condition
[
'attribute_not'
]
=
2
;
//默认排序
if
(
!
isset
(
$condition
[
'order'
])
||
empty
(
$condition
[
'order'
]))
{
$condition
[
'order'
]
=
's_n_desc'
;
}
$options
=
array
(
'imgSize'
=>
$imgSize
,
'minImgSize'
=>
$minImgSize
,
'rowNum'
=>
$condition
[
'rowNum'
],
'viewNum'
=>
$condition
[
'viewNum'
],
);
//接收高级选项
foreach
(
$_GET
as
$key
=>
$val
)
{
if
(
strpos
(
'parameter_'
,
$key
)
!==
false
)
{
$condition
[
$key
]
=
(
int
)
$val
;
}
}
//每页记录数减1,下一页占位
$condition
[
'viewNum'
]
=
$condition
[
'viewNum'
]
-
1
;
$condition
=
array_merge
(
$condition
,
$param
);
$options
=
array_merge
(
$options
,
$option
);
$data
[
'condition'
]
=
$condition
;
$data
[
'options'
]
=
$options
;
return
$data
;
}
/**
* 根据条件获取搜索数据
* @param array $customCondition
* @param array $customOptions
* @return array
*/
public
static
function
getListData
(
$customCondition
=
array
(),
$customOptions
=
array
())
{
$urlList
=
array
();
$searchCondition
=
self
::
searchCondition
(
$customCondition
,
$customOptions
);
// 组合搜索商品url
$urlList
[
'product'
]
=
HelperSearch
::
getProductUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索分类url
$urlList
[
'sort'
]
=
HelperSearch
::
getClassesUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索折扣区间url
$urlList
[
'discount'
]
=
HelperSearch
::
getDiscountUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索最新上架url
$urlList
[
'recent'
]
=
HelperSearch
::
getRecentShelveUrl
(
$searchCondition
[
'condition'
]);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
return
$data
;
}
/**
* 搜索页面获取搜索数据
* @param $customCondition
* @param $customOptions
* @return array
*/
public
static
function
searchData
(
$customCondition
,
$customOptions
)
{
$urlList
=
array
();
$searchCondition
=
self
::
searchCondition
(
$customCondition
,
$customOptions
);
// 组合搜索商品url
$urlList
[
'product'
]
=
HelperSearch
::
getProductUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索分类url
$urlList
[
'sort'
]
=
HelperSearch
::
getClassesUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索店铺url
if
(
isset
(
$param
[
'keyword'
]))
{
$param
[
'keyword'
]
=
$searchCondition
[
'condition'
][
'query'
];
$urlList
[
'shop'
]
=
HelperSearch
::
getShopUrl
(
$param
);
}
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
return
$data
;
}
/**
* 根据product_sn查询产品图片信息
* @param $product_sn
* @param $options
* @author sefon 2015-12-28 18:09:28
* @return array
*/
public
static
function
getProductPic
(
$product_sn
,
$options
)
{
$condition
[
'query'
]
=
$product_sn
;
//返回搜索条件
$condition
[
'needFilter'
]
=
0
;
//获取产品数据
$data
=
SearchData
::
searchElasticByCondition
(
$condition
);
if
(
isset
(
$data
[
'code'
])
&&
$data
[
'code'
]
===
200
&&
isset
(
$data
[
'data'
][
'product_list'
])
&&
!
empty
(
$data
[
'data'
][
'product_list'
]))
{
//组织数据结构
$data
=
HelperSearch
::
getProductPic
(
$data
[
'data'
][
'product_list'
],
$options
);
}
echo
json_encode
(
$data
);
}
<?php
namespace
Product
;
use
Api\Yohobuy
;
use
Plugin\Helpers
;
use
Plugin\HelperSearch
;
use
\LibModels\Web\Product\SearchData
;
/**
* sale首页模板数据模型
*
* @name SaleModel
* @package models
* @copyright yoho.inc
* @version 1.0 (2015-12-17 13:54:56)
* @author sefon
*/
class
SearchModel
{
/**
* 搜索相关页面公共条件处理
* @param $param
* @param $option
* @return mixed
*/
public
static
function
searchCondition
(
$param
,
$option
)
{
/* 过滤请求参数 */
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'query'
=>
FILTER_SANITIZE_STRING
,
'brand'
=>
FILTER_SANITIZE_STRING
,
'sort'
=>
FILTER_VALIDATE_INT
,
'msort'
=>
FILTER_VALIDATE_INT
,
'misort'
=>
FILTER_VALIDATE_INT
,
'color'
=>
FILTER_VALIDATE_INT
,
'size'
=>
FILTER_DEFAULT
,
'style'
=>
FILTER_DEFAULT
,
'price'
=>
FILTER_DEFAULT
,
'gender'
=>
FILTER_SANITIZE_STRING
,
'p_d'
=>
FILTER_DEFAULT
,
'shelve_time'
=>
FILTER_DEFAULT
,
'isNew'
=>
FILTER_DEFAULT
,
'specialoffer'
=>
FILTER_DEFAULT
,
'limited'
=>
FILTER_DEFAULT
,
'order'
=>
FILTER_DEFAULT
,
'viewNum'
=>
FILTER_VALIDATE_INT
,
'rowNum'
=>
FILTER_VALIDATE_INT
,
'page'
=>
FILTER_VALIDATE_INT
),
false
);
//关键字
if
(
isset
(
$condition
[
'query'
])
&&
!
empty
(
$condition
[
'query'
]))
{
$condition
[
'query'
]
=
rawurldecode
(
$condition
[
'query'
]);
}
//品牌
if
(
isset
(
$condition
[
'brand'
])
&&
!
empty
(
$condition
[
'brand'
]))
{
$condition
[
'brand'
]
=
rawurldecode
(
$condition
[
'brand'
]);
}
//性别
if
(
isset
(
$condition
[
'gender'
])
&&
!
empty
(
$condition
[
'gender'
]))
{
$condition
[
'gender'
]
=
rawurldecode
(
$condition
[
'gender'
]);
}
else
{
$condition
[
'gender'
]
=
Helpers
::
getGenderByCookie
();
}
//每页显示商品数
$viewNumArray
=
array
(
60
,
100
,
200
);
if
(
!
isset
(
$condition
[
'viewNum'
])
||
empty
(
$condition
[
'viewNum'
])){
$condition
[
'viewNum'
]
=
60
;
}
if
(
!
in_array
(
$condition
[
'viewNum'
],
$viewNumArray
))
{
$condition
[
'viewNum'
]
=
60
;
}
//每行显示的商品数量
if
(
!
isset
(
$condition
[
'rowNum'
])
||
empty
(
$condition
[
'rowNum'
])){
$condition
[
'rowNum'
]
=
5
;
}
if
(
$condition
[
'rowNum'
]
==
6
)
{
$imgSize
=
array
(
195
,
260
);
$minImgSize
=
array
(
50
,
67
);
}
else
{
$condition
[
'rowNum'
]
=
5
;
$imgSize
=
array
(
235
,
314
);
$minImgSize
=
array
(
60
,
80
);
}
//自定义搜索价格
if
(
isset
(
$condition
[
'price'
])
&&
!
empty
(
$condition
[
'price'
]))
{
$price
=
explode
(
','
,
$condition
[
'price'
]);
if
(
!
$price
[
0
])
{
$price
[
0
]
=
0
;
}
if
(
!
$price
[
1
])
{
$price
[
1
]
=
99999
;
}
$condition
[
'price'
]
=
implode
(
','
,
$price
);
}
//返回搜索条件
$condition
[
'needFilter'
]
=
1
;
//过滤赠品
$condition
[
'attribute_not'
]
=
2
;
//默认排序
if
(
!
isset
(
$condition
[
'order'
])
||
empty
(
$condition
[
'order'
]))
{
$condition
[
'order'
]
=
's_n_desc'
;
}
$options
=
array
(
'imgSize'
=>
$imgSize
,
'minImgSize'
=>
$minImgSize
,
'rowNum'
=>
$condition
[
'rowNum'
],
'viewNum'
=>
$condition
[
'viewNum'
],
);
//接收高级选项
foreach
(
$_GET
as
$key
=>
$val
)
{
if
(
strpos
(
'parameter_'
,
$key
)
!==
false
)
{
$condition
[
$key
]
=
(
int
)
$val
;
}
}
//每页记录数减1,下一页占位
$condition
[
'viewNum'
]
=
$condition
[
'viewNum'
]
-
1
;
$condition
=
array_merge
(
$condition
,
$param
);
$options
=
array_merge
(
$options
,
$option
);
$data
[
'condition'
]
=
$condition
;
$data
[
'options'
]
=
$options
;
return
$data
;
}
/**
* 根据条件获取搜索数据
* @param array $customCondition
* @param array $customOptions
* @return array
*/
public
static
function
getListData
(
$customCondition
=
array
(),
$customOptions
=
array
())
{
$urlList
=
array
();
$searchCondition
=
self
::
searchCondition
(
$customCondition
,
$customOptions
);
// 组合搜索商品url
$urlList
[
'product'
]
=
HelperSearch
::
getProductUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索分类url
$urlList
[
'sort'
]
=
HelperSearch
::
getClassesUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索折扣区间url
$urlList
[
'discount'
]
=
HelperSearch
::
getDiscountUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索最新上架url
$urlList
[
'recent'
]
=
HelperSearch
::
getRecentShelveUrl
(
$searchCondition
[
'condition'
]);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
return
$data
;
}
/**
* 搜索页面获取搜索数据
* @param $customCondition
* @param $customOptions
* @return array
*/
public
static
function
searchData
(
$customCondition
,
$customOptions
)
{
$urlList
=
array
();
$searchCondition
=
self
::
searchCondition
(
$customCondition
,
$customOptions
);
// 组合搜索商品url
$urlList
[
'product'
]
=
HelperSearch
::
getProductUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索分类url
$urlList
[
'sort'
]
=
HelperSearch
::
getClassesUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索店铺url
if
(
isset
(
$param
[
'keyword'
]))
{
$param
[
'keyword'
]
=
$searchCondition
[
'condition'
][
'query'
];
$urlList
[
'shop'
]
=
HelperSearch
::
getShopUrl
(
$param
);
}
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
return
$data
;
}
/**
* 根据product_sn查询产品图片信息
* @param $product_sn
* @param $options
* @author sefon 2015-12-28 18:09:28
* @return array
*/
public
static
function
getProductPic
(
$product_sn
,
$options
)
{
$condition
[
'query'
]
=
$product_sn
;
//返回搜索条件
$condition
[
'needFilter'
]
=
0
;
//获取产品数据
$data
=
SearchData
::
searchElasticByCondition
(
$condition
);
if
(
isset
(
$data
[
'code'
])
&&
$data
[
'code'
]
===
200
&&
isset
(
$data
[
'data'
][
'product_list'
])
&&
!
empty
(
$data
[
'data'
][
'product_list'
]))
{
//组织数据结构
$data
=
HelperSearch
::
getProductPic
(
$data
[
'data'
][
'product_list'
],
$options
);
}
echo
json_encode
(
$data
);
}
}
\ No newline at end of file
...
...
yohobuy/www.yohobuy.com/application/modules/Passport/controllers/Register1.php
View file @
a6fad00
...
...
@@ -2,7 +2,7 @@
use
Action\AbstractAction
;
class
RegisterController
extends
AbstractAction
class
Register
1
Controller
extends
AbstractAction
{
/**
* 登录页
...
...
@@ -49,7 +49,7 @@ class RegisterController extends AbstractAction
'coverImg'
=>
'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190'
)
);
$this
->
_view
->
display
(
'index'
,
$data
);
$this
->
_view
->
display
(
'
../register/
index'
,
$data
);
}
public
function
checkmobileAction
()
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
a6fad00
...
...
@@ -17,7 +17,11 @@ class ListController extends WebAction
*/
public
function
saleAction
()
{
$list
=
SearchModel
::
getListData
();
//排序
$condition
[
'order'
]
=
's_n_desc'
;
//打折
$condition
[
'p_d'
]
=
'0,0.9'
;
$list
=
SearchModel
::
getListData
(
$condition
);
$data
=
array
(
//初始化js
'productListPage'
=>
true
,
...
...
Please
register
or
login
to post a comment