Authored by 郭成尧

'店铺控制是否显示名称'

@@ -27,6 +27,9 @@ @@ -27,6 +27,9 @@
27 <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div> 27 <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
28 <div class="opt-wrap"> 28 <div class="opt-wrap">
29 <p class="opt center-content"> 29 <p class="opt center-content">
  30 + {{#if showShopName}}
  31 + <span class="shop-name">{{shopName}}</span>
  32 + {{/if}}
30 <a href="{{shopHome}}"> 33 <a href="{{shopHome}}">
31 <i class="iconfont">&#xe617;</i> 34 <i class="iconfont">&#xe617;</i>
32 店铺首页 35 店铺首页
@@ -35,9 +38,9 @@ @@ -35,9 +38,9 @@
35 <i class="iconfont">&#xe631;</i> 38 <i class="iconfont">&#xe631;</i>
36 店铺介绍 39 店铺介绍
37 </a> 40 </a>
38 - <span id="shop-favor" class="brand-favor" data-id="{{shopId}}">  
39 - <i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>  
40 - </span> 41 + <span id="shop-favor" class="brand-favor shop-favor" data-id="{{shopId}}">
  42 + <i class="iconfont{{#if coled}} coled{{/if}}">&#xe616;</i>
  43 + </span>
41 </p> 44 </p>
42 </div> 45 </div>
43 </div> 46 </div>
@@ -61,10 +61,18 @@ @@ -61,10 +61,18 @@
61 height: 200px; 61 height: 200px;
62 62
63 .opt { 63 .opt {
64 - span { 64 + .shop-name {
  65 + margin-left: 60px;
  66 + font-size: 32px;
  67 + float: left;
  68 + border: none;
  69 + }
  70 +
  71 + .shop-favor {
65 margin-right: 60px; 72 margin-right: 60px;
66 } 73 }
67 } 74 }
  75 +
68 } 76 }
69 77
70 .brand-about { 78 .brand-about {
1 <?php 1 <?php
2 namespace Product; 2 namespace Product;
  3 +
3 use Product\SearchModel; 4 use Product\SearchModel;
4 use LibModels\Web\Product\SearchData; 5 use LibModels\Web\Product\SearchData;
5 use LibModels\Web\Product\ShopData; 6 use LibModels\Web\Product\ShopData;
@@ -7,19 +8,20 @@ use Api\Yohobuy; @@ -7,19 +8,20 @@ use Api\Yohobuy;
7 use WebPlugin\HelperSearch; 8 use WebPlugin\HelperSearch;
8 use LibModels\Web\Guang\ListData as GuangListData; 9 use LibModels\Web\Guang\ListData as GuangListData;
9 use WebPlugin\Helpers; 10 use WebPlugin\Helpers;
  11 +
10 /** 12 /**
11 * 品牌店铺的模型 13 * 品牌店铺的模型
12 - * 14 + *
13 * @copyright yoho.inc 15 * @copyright yoho.inc
14 * @author xiaoxiao.hao <xiaoxiao.hao@yoho.cn> 16 * @author xiaoxiao.hao <xiaoxiao.hao@yoho.cn>
15 */ 17 */
16 class ShopModel 18 class ShopModel
17 { 19 {
18 private static $shopListUrl = '/shoplist'; 20 private static $shopListUrl = '/shoplist';
19 - 21 +
20 public static function getData($shopId, $parameters) 22 public static function getData($shopId, $parameters)
21 { 23 {
22 - $data = array('shopTopBanner' => array(), 'hotSingle'=> array()); 24 + $data = array('shopTopBanner' => array(), 'hotSingle' => array());
23 $parameters['shopId'] = $shopId; 25 $parameters['shopId'] = $shopId;
24 26
25 $shopList = ShopData::shopsDecoratorList($shopId); 27 $shopList = ShopData::shopsDecoratorList($shopId);
@@ -69,7 +71,7 @@ class ShopModel @@ -69,7 +71,7 @@ class ShopModel
69 // 组合搜索分类url 71 // 组合搜索分类url
70 $sortCondition = array(); 72 $sortCondition = array();
71 $sortCondition['brand'] = self::getShopsBrandIds($shopId); 73 $sortCondition['brand'] = self::getShopsBrandIds($shopId);
72 - 74 +
73 if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) { 75 if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
74 $sortCondition['needSmallSort'] = 1; 76 $sortCondition['needSmallSort'] = 1;
75 } 77 }
@@ -77,18 +79,18 @@ class ShopModel @@ -77,18 +79,18 @@ class ShopModel
77 79
78 //批量调接口获取数据 80 //批量调接口获取数据
79 $res = Yohobuy::getMulti($urlList); 81 $res = Yohobuy::getMulti($urlList);
80 - 82 +
81 //新品上架 83 //新品上架
82 if (isset($parameters['navBar']) && $parameters['navBar'] * 1 === 3) { 84 if (isset($parameters['navBar']) && $parameters['navBar'] * 1 === 3) {
83 $searchCondition['options']['isNew'] = true; 85 $searchCondition['options']['isNew'] = true;
84 } 86 }
85 - 87 +
86 // 组织模板数据 88 // 组织模板数据
87 $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']); 89 $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
88 $data['pathNav'] = array_merge( 90 $data['pathNav'] = array_merge(
89 HelperSearch::$listNav, 91 HelperSearch::$listNav,
90 array( 92 array(
91 - array('href'=> '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName']) 93 + array('href' => '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName'])
92 ) 94 )
93 ); 95 );
94 $sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId); 96 $sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId);
@@ -99,8 +101,8 @@ class ShopModel @@ -99,8 +101,8 @@ class ShopModel
99 $data['allGoods']['opts'] = $result['opts']; 101 $data['allGoods']['opts'] = $result['opts'];
100 $data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : ''; 102 $data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : '';
101 $data['allGoods']['goodsMenu']['menuList'] = $sort; 103 $data['allGoods']['goodsMenu']['menuList'] = $sort;
102 - $data['allGoods']['goodsMenu']['url'] = self::$shopListUrl . '?'.http_build_query($param);  
103 - $data['allGoods']['href'] = self::$shopListUrl . '?'.http_build_query($param); 104 + $data['allGoods']['goodsMenu']['url'] = self::$shopListUrl . '?' . http_build_query($param);
  105 + $data['allGoods']['href'] = self::$shopListUrl . '?' . http_build_query($param);
104 106
105 return $data; 107 return $data;
106 } 108 }
@@ -111,9 +113,9 @@ class ShopModel @@ -111,9 +113,9 @@ class ShopModel
111 */ 113 */
112 public static function getShopListData($shopId, $parameters) 114 public static function getShopListData($shopId, $parameters)
113 { 115 {
114 - $data = array('shopTopBanner' => array(), 'hotSingle'=> array()); 116 + $data = array('shopTopBanner' => array(), 'hotSingle' => array());
115 $parameters['shopId'] = $shopId; 117 $parameters['shopId'] = $shopId;
116 - 118 +
117 $shopList = ShopData::shopsDecoratorList($shopId); 119 $shopList = ShopData::shopsDecoratorList($shopId);
118 120
119 if (isset($shopList['data']['list']) && $shopList['code'] === 200) { 121 if (isset($shopList['data']['list']) && $shopList['code'] === 200) {
@@ -159,12 +161,12 @@ class ShopModel @@ -159,12 +161,12 @@ class ShopModel
159 161
160 //批量调接口获取数据 162 //批量调接口获取数据
161 $res = Yohobuy::getMulti($urlList); 163 $res = Yohobuy::getMulti($urlList);
162 - 164 +
163 //新品上架 165 //新品上架
164 if (isset($parameters['navBar']) && $parameters['navBar'] * 1 === 3) { 166 if (isset($parameters['navBar']) && $parameters['navBar'] * 1 === 3) {
165 $searchCondition['options']['isNew'] = true; 167 $searchCondition['options']['isNew'] = true;
166 } 168 }
167 - 169 +
168 // 组织模板数据 170 // 组织模板数据
169 $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']); 171 $result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
170 172
@@ -176,7 +178,7 @@ class ShopModel @@ -176,7 +178,7 @@ class ShopModel
176 $data['pathNav'] = array_merge( 178 $data['pathNav'] = array_merge(
177 $result['pathNav'], 179 $result['pathNav'],
178 array( 180 array(
179 - array('href'=> '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName']) 181 + array('href' => '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName'])
180 ) 182 )
181 ); 183 );
182 // $data['name'] = '全部商品 ALL'; 184 // $data['name'] = '全部商品 ALL';
@@ -240,11 +242,12 @@ class ShopModel @@ -240,11 +242,12 @@ class ShopModel
240 } 242 }
241 243
242 if (!empty($data['resource_data'][0]['isShowShopName'])) { 244 if (!empty($data['resource_data'][0]['isShowShopName'])) {
243 - $result['isShowShopName'] = $data['resource_data'][0]['isShowShopName'] === 'Y'; 245 + $result['isShowShopName'] = $data['resource_data'][0]['isShowShopName'] === 'Y';
244 } 246 }
245 return $result; 247 return $result;
246 - 248 +
247 } 249 }
  250 +
248 /** 251 /**
249 * 店铺-基础Banner 资源位 252 * 店铺-基础Banner 资源位
250 * @param type $data 253 * @param type $data
@@ -267,13 +270,13 @@ class ShopModel @@ -267,13 +270,13 @@ class ShopModel
267 } 270 }
268 271
269 if (!empty($data['resource_data'][0]['isShowShopName'])) { 272 if (!empty($data['resource_data'][0]['isShowShopName'])) {
270 - $result['isShowShopName'] = $data['resource_data'][0]['isShowShopName'] === 'Y'; 273 + $result['isShowShopName'] = $data['resource_data'][0]['isShowShopName'] === 'Y';
271 } 274 }
272 275
273 return $result; 276 return $result;
274 - 277 +
275 } 278 }
276 - 279 +
277 /** 280 /**
278 * 导航栏 资源位 281 * 导航栏 资源位
279 * @param type $data 282 * @param type $data
@@ -283,42 +286,43 @@ class ShopModel @@ -283,42 +286,43 @@ class ShopModel
283 { 286 {
284 $shopNav = array( 287 $shopNav = array(
285 array( 288 array(
286 - 'name' => '店铺首页',  
287 - 'url' => '/?navBar=0&shopId=' . $parameters['shopId'],  
288 - ),  
289 - array(  
290 - 'name' => '全部商品',  
291 - 'url' => self::$shopListUrl . '?navBar=1&shopId=' . $parameters['shopId'],  
292 - 'arrow' => true,  
293 - ),  
294 - array(  
295 - 'name' => '人气单品',  
296 - 'url' => self::$shopListUrl . '?navBar=2&order=s_n_desc&shopId=' . $parameters['shopId'],  
297 - ),  
298 - array(  
299 - 'name' => '新品上架',  
300 - 'url' => self::$shopListUrl . '?navBar=3&order=s_t_desc&shopId=' . $parameters['shopId'],  
301 - ), 289 + 'name' => '店铺首页',
  290 + 'url' => '/?navBar=0&shopId=' . $parameters['shopId'],
  291 + ),
  292 + array(
  293 + 'name' => '全部商品',
  294 + 'url' => self::$shopListUrl . '?navBar=1&shopId=' . $parameters['shopId'],
  295 + 'arrow' => true,
  296 + ),
  297 + array(
  298 + 'name' => '人气单品',
  299 + 'url' => self::$shopListUrl . '?navBar=2&order=s_n_desc&shopId=' . $parameters['shopId'],
  300 + ),
  301 + array(
  302 + 'name' => '新品上架',
  303 + 'url' => self::$shopListUrl . '?navBar=3&order=s_t_desc&shopId=' . $parameters['shopId'],
  304 + ),
302 ); 305 );
303 -  
304 - if(isset($data['resource_data']) && is_array($data['resource_data'])) {  
305 - $shopNav = array_merge($shopNav, array_filter($data['resource_data'], function($v) { 306 +
  307 + if (isset($data['resource_data']) && is_array($data['resource_data'])) {
  308 + $shopNav = array_merge($shopNav, array_filter($data['resource_data'], function ($v) {
306 if (empty($v['url'])) { 309 if (empty($v['url'])) {
307 return false; 310 return false;
308 } 311 }
309 return $v; 312 return $v;
310 })); 313 }));
311 } 314 }
312 -  
313 - //选中状态 315 +
  316 + //选中状态
314 if (isset($parameters['navBar']) && count($shopNav) >= $parameters['navBar'] && $parameters['navBar'] >= 0) { 317 if (isset($parameters['navBar']) && count($shopNav) >= $parameters['navBar'] && $parameters['navBar'] >= 0) {
315 $shopNav[$parameters['navBar']]['current'] = true; 318 $shopNav[$parameters['navBar']]['current'] = true;
316 } else { 319 } else {
317 $shopNav[0]['current'] = true; 320 $shopNav[0]['current'] = true;
318 } 321 }
319 - 322 +
320 return $shopNav; 323 return $shopNav;
321 } 324 }
  325 +
322 /** 326 /**
323 * 资源位小图 327 * 资源位小图
324 * @param type $data 328 * @param type $data
@@ -327,15 +331,15 @@ class ShopModel @@ -327,15 +331,15 @@ class ShopModel
327 { 331 {
328 $oneData = array(); 332 $oneData = array();
329 $twoData = array(); 333 $twoData = array();
330 - 334 +
331 foreach ($data['resource_data'] as $resource) { 335 foreach ($data['resource_data'] as $resource) {
332 - 336 +
333 if (empty($resource['data'])) { 337 if (empty($resource['data'])) {
334 continue; 338 continue;
335 } 339 }
336 - 340 +
337 foreach ($resource['data'] as $key => $val) { 341 foreach ($resource['data'] as $key => $val) {
338 - 342 +
339 $temp = array( 343 $temp = array(
340 'img' => self::imageView2($val['src'], 300, 175), 344 'img' => self::imageView2($val['src'], 300, 175),
341 'url' => $val['url'], 345 'url' => $val['url'],
@@ -348,10 +352,10 @@ class ShopModel @@ -348,10 +352,10 @@ class ShopModel
348 } 352 }
349 } 353 }
350 } 354 }
351 - 355 +
352 return array_slice(array_merge($oneData, $twoData), 0, 2); 356 return array_slice(array_merge($oneData, $twoData), 0, 2);
353 } 357 }
354 - 358 +
355 /** 359 /**
356 * 资源位大图 360 * 资源位大图
357 * @param type $data 361 * @param type $data
@@ -360,13 +364,13 @@ class ShopModel @@ -360,13 +364,13 @@ class ShopModel
360 public static function largeSlideImg($data) 364 public static function largeSlideImg($data)
361 { 365 {
362 $result = array(); 366 $result = array();
363 - 367 +
364 foreach ($data['resource_data'] as $resource) { 368 foreach ($data['resource_data'] as $resource) {
365 - 369 +
366 if (empty($resource['data'])) { 370 if (empty($resource['data'])) {
367 continue; 371 continue;
368 } 372 }
369 - 373 +
370 foreach ($resource['data'] as $val) { 374 foreach ($resource['data'] as $val) {
371 $result[] = array( 375 $result[] = array(
372 'img' => self::imageView2($val['src'], 660, 360), 376 'img' => self::imageView2($val['src'], 660, 360),
@@ -374,10 +378,10 @@ class ShopModel @@ -374,10 +378,10 @@ class ShopModel
374 ); 378 );
375 } 379 }
376 } 380 }
377 - 381 +
378 return $result; 382 return $result;
379 } 383 }
380 - 384 +
381 /** 385 /**
382 * 经典推荐 386 * 经典推荐
383 * @param type $data 387 * @param type $data
@@ -386,16 +390,16 @@ class ShopModel @@ -386,16 +390,16 @@ class ShopModel
386 public static function recommend($data) 390 public static function recommend($data)
387 { 391 {
388 $result = array(); 392 $result = array();
389 - 393 +
390 foreach ($data['resource_data'] as $resource) { 394 foreach ($data['resource_data'] as $resource) {
391 $result[] = array( 395 $result[] = array(
392 - 'enName'=> Helpers::isChinese($resource['enName']) ? 396 + 'enName' => Helpers::isChinese($resource['enName']) ?
393 Helpers::substrEllipsis($resource['enName'], 5) : Helpers::substrEllipsis($resource['enName'], 10), 397 Helpers::substrEllipsis($resource['enName'], 5) : Helpers::substrEllipsis($resource['enName'], 10),
394 - 'name'=> Helpers::isChinese($resource['name']) ? 398 + 'name' => Helpers::isChinese($resource['name']) ?
395 Helpers::substrEllipsis($resource['name'], 5) : Helpers::substrEllipsis($resource['name'], 6), 399 Helpers::substrEllipsis($resource['name'], 5) : Helpers::substrEllipsis($resource['name'], 6),
396 - 'img'=> self::imageView2($resource['src'], 50, 50),  
397 - 'title'=> $resource['title'],  
398 - 'url'=> $resource['url'], 400 + 'img' => self::imageView2($resource['src'], 50, 50),
  401 + 'title' => $resource['title'],
  402 + 'url' => $resource['url'],
399 ); 403 );
400 } 404 }
401 if (empty($result)) { 405 if (empty($result)) {
@@ -403,11 +407,11 @@ class ShopModel @@ -403,11 +407,11 @@ class ShopModel
403 } 407 }
404 408
405 return array( 409 return array(
406 - 'title' => isset($result[0]['title']) ? $result[0]['title'] : '经典推荐',  
407 - 'list'=> $result  
408 - ); 410 + 'title' => isset($result[0]['title']) ? $result[0]['title'] : '经典推荐',
  411 + 'list' => $result
  412 + );
409 } 413 }
410 - 414 +
411 /** 415 /**
412 * 热门推荐 416 * 热门推荐
413 * @param type $data 417 * @param type $data
@@ -416,22 +420,22 @@ class ShopModel @@ -416,22 +420,22 @@ class ShopModel
416 public static function hotRecommend($data) 420 public static function hotRecommend($data)
417 { 421 {
418 $result = array(); 422 $result = array();
419 - 423 +
420 foreach ($data['resource_data'] as $resource) { 424 foreach ($data['resource_data'] as $resource) {
421 $result[] = array( 425 $result[] = array(
422 - 'img'=> self::imageView2($resource['src'], 160, 240),  
423 - 'title'=> $resource['title'],  
424 - 'url'=> $resource['url'], 426 + 'img' => self::imageView2($resource['src'], 160, 240),
  427 + 'title' => $resource['title'],
  428 + 'url' => $resource['url'],
425 ); 429 );
426 } 430 }
427 if (empty($result)) { 431 if (empty($result)) {
428 - return $result; 432 + return $result;
429 } 433 }
430 434
431 return array( 435 return array(
432 - 'title' => isset($result[0]['title']) ? $result[0]['title'] : '热销推荐',  
433 - 'list'=> $result  
434 - ); 436 + 'title' => isset($result[0]['title']) ? $result[0]['title'] : '热销推荐',
  437 + 'list' => $result
  438 + );
435 } 439 }
436 440
437 /** 441 /**
@@ -449,20 +453,20 @@ class ShopModel @@ -449,20 +453,20 @@ class ShopModel
449 453
450 foreach ($resource['data'] as $val) { 454 foreach ($resource['data'] as $val) {
451 $result[] = array( 455 $result[] = array(
452 - 'img'=> self::imageView2($val['src'], 160, 240),  
453 - 'url'=> $val['url'], 456 + 'img' => self::imageView2($val['src'], 160, 240),
  457 + 'url' => $val['url'],
454 ); 458 );
455 } 459 }
456 } 460 }
457 461
458 return array( 462 return array(
459 - 'title' => empty($result[0]['title']) ? '' : $result[0]['title'],  
460 - 'list'=> $result 463 + 'title' => empty($result[0]['title']) ? '' : $result[0]['title'],
  464 + 'list' => $result
461 ); 465 );
462 } 466 }
463 467
464 /** 468 /**
465 - * 品牌一览 469 + * 品牌一览
466 * @param type $data 470 * @param type $data
467 * @return type [] 471 * @return type []
468 */ 472 */
@@ -490,8 +494,9 @@ class ShopModel @@ -490,8 +494,9 @@ class ShopModel
490 ); 494 );
491 } 495 }
492 496
493 - return array('title' => '品牌集合', 'list'=> $result); 497 + return array('title' => '品牌集合', 'list' => $result);
494 } 498 }
  499 +
495 /** 500 /**
496 * 商品标签栏 501 * 商品标签栏
497 * @param type $data 502 * @param type $data
@@ -500,13 +505,13 @@ class ShopModel @@ -500,13 +505,13 @@ class ShopModel
500 public static function goodsTabBar($data, $parameters) 505 public static function goodsTabBar($data, $parameters)
501 { 506 {
502 $more = array( 507 $more = array(
503 - 'name' => 'MORE',  
504 - 'href' => self::$shopListUrl . '?shopId=' . $parameters['shopId']  
505 - ); 508 + 'name' => 'MORE',
  509 + 'href' => self::$shopListUrl . '?shopId=' . $parameters['shopId']
  510 + );
506 $result = array( 511 $result = array(
507 - 'hot' => array(),  
508 - 'new' => array()  
509 - ); 512 + 'hot' => array(),
  513 + 'new' => array()
  514 + );
510 if (empty($data['resource_data'])) { 515 if (empty($data['resource_data'])) {
511 return $result; 516 return $result;
512 } 517 }
@@ -541,27 +546,27 @@ class ShopModel @@ -541,27 +546,27 @@ class ShopModel
541 } 546 }
542 547
543 /** 548 /**
544 - * 新品上架  
545 - * @param type $data  
546 - * @return type []  
547 - */ 549 + * 新品上架
  550 + * @param type $data
  551 + * @return type []
  552 + */
548 public static function newProducts($data) 553 public static function newProducts($data)
549 { 554 {
550 $result = array(); 555 $result = array();
551 - 556 +
552 foreach ($data['resource_data'] as $resource) { 557 foreach ($data['resource_data'] as $resource) {
553 $result[] = array( 558 $result[] = array(
554 - 'productId'=> $resource['productId'],  
555 - 'title'=> $resource['productName'],  
556 - 'productSkn'=> $resource['productSkn'],  
557 - 'price'=> '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),  
558 - 'img'=> self::imageView2($resource['src'], 250, 340),  
559 - 'url'=> Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']), 559 + 'productId' => $resource['productId'],
  560 + 'title' => $resource['productName'],
  561 + 'productSkn' => $resource['productSkn'],
  562 + 'price' => '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
  563 + 'img' => self::imageView2($resource['src'], 250, 340),
  564 + 'url' => Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']),
560 ); 565 );
561 } 566 }
562 return $result; 567 return $result;
563 } 568 }
564 - 569 +
565 /** 570 /**
566 * 人气单品 571 * 人气单品
567 * @param type $data 572 * @param type $data
@@ -570,22 +575,22 @@ class ShopModel @@ -570,22 +575,22 @@ class ShopModel
570 public static function hotProducts($data) 575 public static function hotProducts($data)
571 { 576 {
572 $result = array(); 577 $result = array();
573 - 578 +
574 foreach ($data['resource_data'] as $key => $resource) { 579 foreach ($data['resource_data'] as $key => $resource) {
575 $result[] = array( 580 $result[] = array(
576 - 'productId'=> $resource['productId'],  
577 - 'title'=> $resource['productName'],  
578 - 'productSkn'=> $resource['productSkn'],  
579 - 'price'=> '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),  
580 - 'img'=> self::imageView2($resource['src'], 250, 340),  
581 - 'url'=> Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']),  
582 - 'index'=> $key + 1 581 + 'productId' => $resource['productId'],
  582 + 'title' => $resource['productName'],
  583 + 'productSkn' => $resource['productSkn'],
  584 + 'price' => '¥' . number_format(trim($resource['salesPrice'], '¥'), 2, '.', ''),
  585 + 'img' => self::imageView2($resource['src'], 250, 340),
  586 + 'url' => Helpers::getProductUrl($resource['productId'], $resource['productSkn'], $resource['productName']),
  587 + 'index' => $key + 1
583 ); 588 );
584 } 589 }
585 - 590 +
586 return $result; 591 return $result;
587 } 592 }
588 - 593 +
589 /** 594 /**
590 * 基础模板 595 * 基础模板
591 * @param type int $shopId 店铺id 596 * @param type int $shopId 店铺id
@@ -643,14 +648,14 @@ class ShopModel @@ -643,14 +648,14 @@ class ShopModel
643 648
644 foreach ($articleData as $key => $artList) { 649 foreach ($articleData as $key => $artList) {
645 if ($key >= 3) { 650 if ($key >= 3) {
646 - break; 651 + break;
647 } 652 }
648 - $result['trendList'][] = array(  
649 - 'href' => $artList['url'],  
650 - 'src' => self::imageView2(substr($artList['src'], 0, strpos($artList['src'], '?')), 264, 173),  
651 - 'mainTitle' => $artList['title'],  
652 - 'Subtitle' => $artList['intro']  
653 - ); 653 + $result['trendList'][] = array(
  654 + 'href' => $artList['url'],
  655 + 'src' => self::imageView2(substr($artList['src'], 0, strpos($artList['src'], '?')), 264, 173),
  656 + 'mainTitle' => $artList['title'],
  657 + 'Subtitle' => $artList['intro']
  658 + );
654 } 659 }
655 //等于3个才显示 660 //等于3个才显示
656 if (count($result['trendList']) < 3) { 661 if (count($result['trendList']) < 3) {
@@ -687,35 +692,37 @@ class ShopModel @@ -687,35 +692,37 @@ class ShopModel
687 692
688 return $data; 693 return $data;
689 } 694 }
690 - 695 +
691 public static function shopsDecoratorList($shopId) 696 public static function shopsDecoratorList($shopId)
692 { 697 {
693 return ShopData::shopsDecoratorList($shopId); 698 return ShopData::shopsDecoratorList($shopId);
694 } 699 }
695 - 700 +
696 public static function getIntro($shopId, $uid) 701 public static function getIntro($shopId, $uid)
697 { 702 {
698 $data = array( 703 $data = array(
699 'brandName' => '', 704 'brandName' => '',
700 'brandCont' => '', 705 'brandCont' => '',
701 - 'domain'=> '',  
702 - 'logo'=> '',  
703 - 'is_favorite'=> false,  
704 - 'multBrandShopType' => 0,  
705 - 'shop_template_type' => 0 706 + 'domain' => '',
  707 + 'logo' => '',
  708 + 'isFavorite' => false,
  709 + 'multBrandShopType' => 0,
  710 + 'shopTemplateType' => 0,
  711 + 'showShopName' => false
706 ); 712 );
707 713
708 $intro = ShopData::getIntro($shopId, $uid); 714 $intro = ShopData::getIntro($shopId, $uid);
709 715
710 if (!empty($intro['data'])) { 716 if (!empty($intro['data'])) {
711 $data = array( 717 $data = array(
712 - 'brandName'=> $intro['data']['shop_name'],  
713 - 'brandCont'=> $intro['data']['shop_intro'],  
714 - 'domain'=> $intro['data']['shop_domain'],  
715 - 'logo'=> $intro['data']['shop_logo'],  
716 - 'isFavorite'=> ($intro['data']['is_favorite'] === 'Y'),  
717 - 'shopTemplateType'=> intval($intro['data']['shop_template_type']),  
718 - 'multBrandShopType'=> intval($intro['data']['mult_brand_shop_type']) 718 + 'brandName' => $intro['data']['shop_name'],
  719 + 'brandCont' => $intro['data']['shop_intro'],
  720 + 'domain' => $intro['data']['shop_domain'],
  721 + 'logo' => $intro['data']['shop_logo'],
  722 + 'isFavorite' => ($intro['data']['is_favorite'] === 'Y'),
  723 + 'shopTemplateType' => intval($intro['data']['shop_template_type']),
  724 + 'multBrandShopType' => intval($intro['data']['mult_brand_shop_type']),
  725 + 'showShopName' => ($intro['data']['is_show_shop_name'] === 'Y')
719 ); 726 );
720 } 727 }
721 728
@@ -728,13 +735,13 @@ class ShopModel @@ -728,13 +735,13 @@ class ShopModel
728 public static function getSort($sort, $misort, $shopId) 735 public static function getSort($sort, $misort, $shopId)
729 { 736 {
730 $result = array(); 737 $result = array();
731 - $i=0; 738 + $i = 0;
732 if (empty($sort['sort'])) { 739 if (empty($sort['sort'])) {
733 return $result; 740 return $result;
734 } 741 }
735 - foreach($sort['sort'] as $key=>$value) {  
736 - foreach($value['sub'] as $k=>$v) {  
737 - $result[$i]['href'] = '/?msort='.$value['sort_id'].'&misort='.$v['sort_id'].'&shopId='.$shopId; 742 + foreach ($sort['sort'] as $key => $value) {
  743 + foreach ($value['sub'] as $k => $v) {
  744 + $result[$i]['href'] = '/?msort=' . $value['sort_id'] . '&misort=' . $v['sort_id'] . '&shopId=' . $shopId;
738 $result[$i]['name'] = $v['sort_name']; 745 $result[$i]['name'] = $v['sort_name'];
739 $result[$i]['count'] = $v['count']; 746 $result[$i]['count'] = $v['count'];
740 $result[$i]['orderBy'] = $v['order_by']; 747 $result[$i]['orderBy'] = $v['order_by'];
@@ -742,17 +749,17 @@ class ShopModel @@ -742,17 +749,17 @@ class ShopModel
742 $i++; 749 $i++;
743 } 750 }
744 } 751 }
745 - foreach($result as $key=>$value) { 752 + foreach ($result as $key => $value) {
746 $count[$key] = $value['count']; 753 $count[$key] = $value['count'];
747 $sortName[$key] = $value['name']; 754 $sortName[$key] = $value['name'];
748 } 755 }
749 756
750 - $arr=array();  
751 - array_multisort($count,SORT_DESC,$sortName,$result);  
752 - $result = array_slice($result,0,15); 757 + $arr = array();
  758 + array_multisort($count, SORT_DESC, $sortName, $result);
  759 + $result = array_slice($result, 0, 15);
753 760
754 - foreach($result as &$value) {  
755 - if($value['misort'] == $misort) { 761 + foreach ($result as &$value) {
  762 + if ($value['misort'] == $misort) {
756 $value['curMenu'] = true; 763 $value['curMenu'] = true;
757 } 764 }
758 } 765 }
@@ -793,27 +800,27 @@ class ShopModel @@ -793,27 +800,27 @@ class ShopModel
793 { 800 {
794 return ShopData::getSearch($shopId); 801 return ShopData::getSearch($shopId);
795 } 802 }
796 - 803 +
797 public static function getSortInfo($shopId, $yhChannel = '', $gender = '') 804 public static function getSortInfo($shopId, $yhChannel = '', $gender = '')
798 { 805 {
799 return ShopData::getSortInfo($shopId, $yhChannel, $gender); 806 return ShopData::getSortInfo($shopId, $yhChannel, $gender);
800 } 807 }
801 - 808 +
802 public static function setFavorite($shopId, $isfavorite, $uid, $type = 'shop') 809 public static function setFavorite($shopId, $isfavorite, $uid, $type = 'shop')
803 { 810 {
804 return ShopData::setFavorite($shopId, $isfavorite, $uid, $type); 811 return ShopData::setFavorite($shopId, $isfavorite, $uid, $type);
805 } 812 }
806 - 813 +
807 public static function byDomain($domain) 814 public static function byDomain($domain)
808 { 815 {
809 $data = array('shop_id' => '', 'type' => ''); 816 $data = array('shop_id' => '', 'type' => '');
810 - 817 +
811 $result = ShopData::byDomain($domain); 818 $result = ShopData::byDomain($domain);
812 - 819 +
813 if (!empty($result['data'])) { 820 if (!empty($result['data'])) {
814 $data = $result['data']; 821 $data = $result['data'];
815 } 822 }
816 - 823 +
817 return ShopData::byDomain($domain); 824 return ShopData::byDomain($domain);
818 } 825 }
819 } 826 }
@@ -128,7 +128,9 @@ class IndexController extends WebAction @@ -128,7 +128,9 @@ class IndexController extends WebAction
128 'shopHome' => Helpers::url('', array('shopId' => $result['shopId']), $domain), 128 'shopHome' => Helpers::url('', array('shopId' => $result['shopId']), $domain),
129 'shopIntro' => Helpers::url('/aboutShop', array('shopId' => $result['shopId']), $domain), 129 'shopIntro' => Helpers::url('/aboutShop', array('shopId' => $result['shopId']), $domain),
130 'coled' => $shopIntro['isFavorite'], 130 'coled' => $shopIntro['isFavorite'],
131 - 'shopId' => $result['shopId'] 131 + 'shopId' => $result['shopId'],
  132 + 'shopName' => $shopIntro['brandName'],
  133 + 'showShopName' => $shopIntro['showShopName']
132 ); 134 );
133 135
134 $data['brandBanner'] = array(); // 刪除品牌banner 136 $data['brandBanner'] = array(); // 刪除品牌banner
@@ -278,7 +280,9 @@ class IndexController extends WebAction @@ -278,7 +280,9 @@ class IndexController extends WebAction
278 'shopHome' => Helpers::url('/', array('shopId' => $shopId), $domain), 280 'shopHome' => Helpers::url('/', array('shopId' => $shopId), $domain),
279 'shopIntro' => Helpers::url('/aboutShop', array('shopId' => $shopId), $domain), 281 'shopIntro' => Helpers::url('/aboutShop', array('shopId' => $shopId), $domain),
280 'coled' => $shopIntro['isFavorite'], 282 'coled' => $shopIntro['isFavorite'],
281 - 'shopId' => $shopId 283 + 'shopId' => $shopId,
  284 + 'shopName' => $shopIntro['brandName'],
  285 + 'showShopName' => $shopIntro['showShopName']
282 ), 286 ),
283 'shopAbout' => empty($shopIntro['brandCont']) ? $shopIntro['brandName'] : $shopIntro['brandCont'] 287 'shopAbout' => empty($shopIntro['brandCont']) ? $shopIntro['brandName'] : $shopIntro['brandCont']
284 ); 288 );