Authored by xiaowei

合并代码 编译js css

... ... @@ -180,7 +180,6 @@ class HelperSearch
if (isset($data['shopData']) && !empty($data['shopData'])) {
$result['shopEntry'] = array();
foreach ($data['shopData'] as $val) {
$val['shop']['shop_id'] = empty($val['shop']['shop_id']) ? '' : $val['shop']['shop_id'];
$shopSort = self::shop($val['shop'], $val['shopSort']);
if (empty($shopSort)) {
continue;
... ... @@ -1447,9 +1446,16 @@ class HelperSearch
public static function shop($shop, $shopSort)
{
$shopEntry = array();
if (self::$total == 0 || empty($shopSort)) {
if (self::$total == 0) {
return $shopEntry;
}
if (empty($shopSort)) {
$shopSort = array();
}
$shop['shop_id'] = empty($shop['shop_id']) ? '' : $shop['shop_id'];
$url = Helpers::url('', array('shopId' => $shop['shop_id']), $shop['brand_domain']);
$sort = array();
$sortInfo = array();
... ... @@ -1462,7 +1468,7 @@ class HelperSearch
break 2;
}
$sortInfo = array();
$sortInfo['href'] = "{$url}/?msort={$msort['sort_id']}&misort={$misort['sort_id']}&shopId={$shop['shop_id']}";
$sortInfo['href'] = "{$url}&msort={$msort['sort_id']}&misort={$misort['sort_id']}";
$sortInfo['name'] = $misort['sort_name'];
$sort[] = $sortInfo;
}
... ...
{{> layout/header}}
{{> layout/header}}
<div class="order-ensure-page yoho-page clearfix">
{{# orderEnsure}}
<div class="order-edit">
... ... @@ -200,10 +200,7 @@
<ul>
{{#each goodlist}}
<li >
<a href={{link}}>
<img src={{src}}/>
</a>
<img src={{src}}/>
{{#if goodsType}}
<p class="{{classname}}" >{{goodsType}}</p>
{{/if}}
... ...
This diff could not be displayed because it is too large.
... ... @@ -132,14 +132,29 @@
width: 660px;
height: 100%;
overflow: hidden;
position: relative;
.slide-wrapper {
height: 358px;
}
.slide-switch {
a.prev {
margin-left: -330px;
}
a.next {
margin-right: -330px;
}
}
img {
width: 100%;
height: 100%;
}
.slide-pagination,
.slide-switch {
.slide-pagination {
display: none;
}
}
... ...
... ... @@ -177,7 +177,7 @@ class BrandsModel
$result['0-9'] = $brand;
}
//写死多品店数据
$result['多品店'] = $moreBrand;
// $result['多品店'] = $moreBrand;
$navigation = array_keys($result);
}
//只取部分数据
... ...
... ... @@ -10,6 +10,7 @@ use WebPlugin\Cache;
use Configs\WebCacheConfig;
use Configs\ChannelConfig;
use LibModels\Web\Product\BrandData;
use Product\BrandsModel;
class ItemModel
{
/**
... ... @@ -78,8 +79,8 @@ class ItemModel
$goodsInfo['vipPrice'] = self::getVipDataByProductBaseInfo($baseInfo, $vipLevel, $uid);
//促销活动banner
$goodsInfo['activity'] = self::getActivityDataByProductBaseInfo($baseInfo);
if (isset($baseInfo['productPriceBo']['yohoCoinNum'])) {
if (isset($baseInfo['productPriceBo']['yohoCoinNum']) && $baseInfo['productPriceBo']['yohoCoinNum'] !== 0) {
array_push($goodsInfo['activity'],
array('type' => '返YOHO币', 'des' => '每件返 ' . $baseInfo['productPriceBo']['yohoCoinNum'] . '个 YOHO币')
);
... ... @@ -195,6 +196,19 @@ class ItemModel
} else {
$statGoodsInfo['salePrice'] = str_replace('¥', '', $goodsInfo['marketPrice']);
}
if (!empty($banner['brandId'])) {
$domainBrand = BrandsModel::getBrandByDomain($banner['brandDomain']);
if (empty($domainBrand['type']) || $domainBrand['type'] !== 2) {
//多品店不显示
$banner = array();
} else {
$basisData = ShopModel::basisTemplate($domainBrand['shopId']);
$banner['bgImg'] = empty($basisData['shopTopBanner']['banner']) ?
$banner['bgImg'] : $basisData['shopTopBanner']['banner'];
}
}
$statGoodsInfo['imageUrl'] = $goodsInfo['img'];
$statGoodsInfo['productUrl'] = $goodsInfo['weixinUrl'];
$statGoodsInfo['smallSortId'] = $goodsInfo['smallSortId'];
... ... @@ -1094,6 +1108,7 @@ class ItemModel
'logo'=> $logo,
'alt' => $baseInfo['brand']['brandName'],
'brandName' => $baseInfo['brand']['brandName'],
'brandDomain' => $baseInfo['brand']['brandDomain'],
'homeUrl'=> $homeUrl,
'isCollect'=> false
);
... ...
... ... @@ -239,11 +239,21 @@ class SearchModel
$data['shopData'] = array();
$shopsByBrands = SearchData::getQueryShopsByBrandId($data['shop']['id']);
if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) {
//多品店 店铺入口
foreach ($shopsByBrands['data'] as $val) {
$shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));
if (isset($shopSort['code']) && $shopSort['code'] == 200) {
$data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']);
if (isset($val['brand_id'])) {
$shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));
}
$data['shopData'][] = array(
'shop' => $val,
'shopSort' => empty($shopSort['data']['sort']) ? array() : $shopSort['data']['sort']
);
}
} else {
//品牌入口
$shopSort = SearchData::getClassesData(array('brand' => $data['shop']['id']));
if (isset($shopSort['code']) && $shopSort['code'] == 200) {
$data['shopData'][] = array('shop' => $data['shop'], 'shopSort' => $shopSort['data']['sort']);
}
}
}
... ...
... ... @@ -29,6 +29,9 @@ class ShopModel
if (is_callable("self::$fun")) {
$list = self::$fun(self::getResourceData($list), $parameters);
switch ($fun) {
case 'signboard':
//过滤不合法的数据
break;
case 'newProducts':
$data['newArrivel']['name'] = '新品上架 NEW';
$data['newArrivel']['list'] = $list;
... ... @@ -80,7 +83,8 @@ class ShopModel
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$sortCondition = array();
$sortCondition = $searchCondition['sortCondition'];
$sortCondition['brand'] = self::getShopsBrandIds($shopId);
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
$sortCondition['needSmallSort'] = 1;
}
... ... @@ -135,6 +139,7 @@ class ShopModel
switch ($fun) {
case 'newProducts':
case 'hotProducts':
case 'signboard':
break;
case 'goodsTabBar':
if (isset($list['hot'])) {
... ... @@ -176,7 +181,7 @@ class ShopModel
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$sortCondition = array();
$sortCondition = $searchCondition['sortCondition'];
$sortCondition['brand'] = self::getShopsBrandIds($shopId);
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
$sortCondition['needSmallSort'] = 1;
}
... ... @@ -195,6 +200,7 @@ class ShopModel
$data['goods'] = $result['goods'];
$data['opts'] = $result['opts'];
$data['totalCount'] = $result['totalCount'];//商品总数
$data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : '';
$data['filters'] = $result['filters'];
$data['pathNav'] = array_merge(
... ... @@ -222,6 +228,7 @@ class ShopModel
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$sortCondition = array();
$sortCondition['brand'] = self::getShopsBrandIds($condition['shop']);
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
$sortCondition['needSmallSort'] = 1;
}
... ... @@ -715,12 +722,35 @@ class ShopModel
return $result;
}
/**
* 获取店铺下的品牌
* @param type $shopId 店铺id
* @return type []
*/
public static function getShopsBrands($shopId)
{
return ShopData::getShopsBrands($shopId);
$result = ShopData::getShopsBrands($shopId);
return empty($result['data']) ? array() : $result['data'];
}
/**
* 获取店铺下的品牌id
* @param type $shopId 店铺id
* @return array []
*/
public static function getShopsBrandIds($shopId)
{
$brands = array();
$result = self::getShopsBrands($shopId);
if (!empty($result)) {
foreach ($result as $val) {
$brands[] = $val['brand_id'];
}
}
return implode(',', $brands);
}
public static function getSearch($shopId)
{
return ShopData::getSearch($shopId);
... ...
... ... @@ -17,6 +17,11 @@ class IndexController extends WebAction
*/
public function brandAction()
{
$shopId = $this->get('shopId', 0);
if (!empty($shopId)) {
$this->shopHome($shopId);
exit(0);
}
//品牌域名,没有获取到品牌域名的跳转首页
$domain = $this->param('named');
if (empty($domain)) {
... ... @@ -31,7 +36,6 @@ class IndexController extends WebAction
$type = intval(isset($result['type']) ? $result['type'] : '');
switch ($type) {
case 1:
$shopId = $this->get('shopId', 0);
if (empty($shopId)) {
//无单品店有多品店:1--->搜索页
$this->go('http://search.yohobuy.com/?query=' . $domain);
... ... @@ -355,19 +359,11 @@ class IndexController extends WebAction
//店铺列表页
public function shopListAction()
{
//品牌域名,没有获取到品牌域名的跳转首页
$domain = $this->param('named');
if (empty($domain)) {
$this->go(SITE_MAIN);
}
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
$result = BrandsModel::getBrandByDomain($domain);
if (!$result) {
$shopId = $this->get('shopId', 0);
if (empty($shopId)) {
$this->go(SITE_MAIN);
}
$shopId = empty($result['shopId']) ? $this->get('shopId', 0) : $result['shopId'];
//获取uid
$uid = $this->getUid();
... ...