Authored by Rock Zhang

修改newsale数据处理逻辑

... ... @@ -63,10 +63,10 @@
<div id="retrive-pwd-mask" class="mask"></div>
<ul id="retrive-pwd-ways" class="retrive-pwd-ways">
<li>
<a href=/phoneback.html>通过手机找回密码</a>
<a href=/passport/back/mobile>通过手机找回密码</a>
</li>
<li>
<a href=/emailback.html>通过邮箱找回密码</a>
<a href=/passport/back/email>通过邮箱找回密码</a>
</li>
<li id="cancel-retrive">
取消
... ...
... ... @@ -62,7 +62,8 @@ class BackData
$param['re-input'] = $pwd;
$param['code'] = $code;
return Yohobuy::post(Yohobuy::YOHOBUY_URL.'passport/back/update', $param);
// 默认返回的不是json类型数据,是html
return Yohobuy::post(Yohobuy::YOHOBUY_URL.'passport/back/update', $param, true);
}
... ...
... ... @@ -18,26 +18,59 @@ class NewSaleProcess
public static function newSaleData($focus, $products)
{
$result = array(
'headerBanner' => self::bannerData($focus)
'headerBanner' => self::bannerData($focus),
'goodsContainer' => array()
);
$list = array('list'=>array());
foreach($products as $single)
{
// 处理Tabs
$noTab = true;
if(isset($single['tabs']) && $noTab)
{
$list['tabs'] = array();
foreach ($single['tabs'] as $one)
$result['tabs'] = array();
foreach ($single['tabs'] as $key => $one)
{
$list['tabs'][] = $one;
$tabItem = array();
$tabItem['title'] = $one;
if($key === 1)
{
$tabItem['focus'] = true;
}
$result['tabs'][] = $tabItem;
}
$noTab = false;
}
$list['list'][] = $single['product_list'];
// 处理商品
$productsLi = array('goods'=>array());
if(isset($single['product_list']))
{
foreach ($single['product_list'] as $value)
{
$oneProduct = array();
$oneProduct['id'] = $value['product_skn'];
$oneProduct['thumb'] = Helpers::getImageUrl($value['default_images'], 290, 388, 1);
$oneProduct['name'] = $value['product_name'];
$oneProduct['price'] = $value['market_price'];
$oneProduct['salePrice'] = $value['sales_price'];
$oneProduct['isSale'] = ($value['is_discount'] === 'N' ? false : true);
$oneProduct['isFew'] = ($value['is_soon_sold_out'] === 'N' ? false : true);
$oneProduct['isNew'] = ($value['is_new'] === 'N' ? false : true);
$oneProduct['url'] = $value['product_skn'];
$productsLi['goods'][] = $oneProduct;
}
}
// 对于第一个productsLi添加show字段
if(count($result['goodsContainer']) === 0)
{
$productsLi['show'] = true;
}
$result['goodsContainer'][] = $productsLi;
}
$result['listNav'] = $list;
return $result;
}
... ...
... ... @@ -50,7 +50,7 @@ $btnNext.on('touchstart', function() {
},
success: function(data) {
if (data.code === 200) {
location.href = '/passport/back/code';
location.href = data.data;
} else {
showErrTip(data.message);
}
... ...
... ... @@ -62,8 +62,8 @@ class BackController extends AbstractAction
{
$email = $this->get('email', '');
// 获取到邮箱域名
$pattern = "/^([0-9A-Za-z\\-_\\.]+)@([0-9a-z]+\\.[a-z]{2,3}(\\.[a-z]{2})?)$/i";
$domain_name = 'http://mail.'.preg_replace( $pattern ,"$2", $email );
list($name, $domain) = explode('@', $email);
$domain_name = 'http://' . (($domain == 'gmail.com') ? 'mail.google.com' : 'mail.' . $domain);
$data = array(
'backUrl' => '/passport/back/email',
... ... @@ -92,7 +92,14 @@ class BackController extends AbstractAction
$data = BackData::modifyPasswordByEmail($pwd, $code);
$this->echoJson($data);// 前端不需要判断结果
$result = array('code'=>200);
if(strpos($data, 'history.back') !== false)
{
$result['code'] = 400;
$result['message'] = '修改失败';
}
$this->echoJson($result);// 前端不需要判断结果
}
}
... ... @@ -131,7 +138,7 @@ class BackController extends AbstractAction
'isPassportPage' => true,
'backMobile' => true,
'countrys' => $areas,
'countryCode' => '+86'
'areaCode' => '+86'
);
$this->_view->assign('title', 'YOHO!有货');
... ...
... ... @@ -29,8 +29,8 @@ class LoginController extends AbstractAction
'weiboLoginUrl' => '/passport/login/sina', // 注册的URL链接
'qqLoginUrl' => '/passport/login/qq', // 注册的URL链接
'interationalUrl' => '/login.html', // 国际号登录的URL链接
'phoneRetriveUrl' => '/phoneback.html', // 通过手机号找回密码的URL链接
'emailRetriveUrl' => '/emailback.html', // 通过邮箱找回密码的URL链接
'phoneRetriveUrl' => '/passport/back/mobile', // 通过手机号找回密码的URL链接
'emailRetriveUrl' => '/passport/back/email', // 通过邮箱找回密码的URL链接
);
// 生成HTML(signin.html)
... ...
... ... @@ -2,345 +2,362 @@
use Action\AbstractAction;
use LibModels\wap\Product\NewsaleData as Newsale;
use Plugin\Helpers;
use Plugin\DataProcess\NewSaleProcess;
/**
* 新品到着
*/
class NewsaleController extends AbstractAction
{
public function indexAction()
{
/*$this->_view->assign('title', '新品到着');
public function indexAction()
{
// 新品到着顶部焦点图
$focusData = Newsale::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
// 处理返回的数据
$focus = array();
if($focusData['code'] == 200)
{
foreach ($focusData['data'] as $single)
{
foreach ($single['data'] as $val) {
$val['src'] = Helpers::getImageUrl($val['src'], 375, 667, 1);
$focus[] = $val;
}
}
}
$data = array(
'newArrival' => true,
'header' => array(
'title' => '新品到着'
)
);
// 批量获取新品到着商品数据
$products = Newsale::getNewProducts('1,3', 1, 60);
var_dump($focus);
// 新品到着顶部焦点图
$focusData = Newsale::getNewsaleFocus('a7989369aa86681c678bc40f171b8f1d');
// 处理返回的数据
$focus = array();
if($focusData['code'] == 200)
{
$focus = $focusData['data'];
}
$this->_view->display('new', compact('focus', 'products'));*/
$data = array(
'headerBanner' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
)
)
),
'tabs' => array(
array(
'title' => '10月15日',
'focus' => true
),
array(
'title' => '本周上新'
),
array(
'title' => '销量'
)
),
'goodsContainer' => array(
array(
'show' => 'true',
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
),
array(
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
),
array(
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
)
)
);
// 批量获取新品到着商品数据
$products = Newsale::getNewProducts('1,3', 1, 60);
// 添加商品数据
$data += NewSaleProcess::newSaleData($focus, $products);
$this->_view->assign('title', '新品到着');
$this->_view->display('new', $data);
}
/*echo '<pre>';
print_r($data);exit;*/
/*$data = array(
'headerBanner' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
)
)
),
'tabs' => array(
array(
'title' => '10月15日',
'focus' => true
),
array(
'title' => '本周上新'
),
array(
'title' => '销量'
)
),
'goodsContainer' => array(
array(
'show' => 'true',
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
),
array(
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img02.yohoboys.com/staticimg/2015/06/30/21/02912cd7f0b2c67939404c71ef00e3f513.jpg',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
),
array(
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/09/17/09/015e14c53a41c7adf0bd039f6493b5a700.jpg?imageView/2/w/140/h/140',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
)
/**
* Ajax方式筛选新品到着、折扣专区商品
*
* @return array 根据指定条件筛选之后的商品
*/
public function selectNewAction()
{
if($this->isAjax())
{
$gender = $this->get('gender', '1,3');
$brand = $this->get('brand', null);
$sort = $this->get('sort', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('p_d', null);
$channel = $this->get('channel', '1');
$dayLimit = $this->get('dayLimit', '1');
$limit = $this->get('limit', 50);
$page = $this->get('page', 1);
)
);*/
$data = Newsale::selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page);
$this->_view->assign('title', '新品到着');
$this->_view->display('new', $data);
}
$this->returnJson(200, '获取成功', $data);
}
}
/**
* Ajax方式筛选新品到着、折扣专区商品
*
* @return array 根据指定条件筛选之后的商品
*/
public function selectNewAction()
{
if($this->isAjax())
{
$gender = $this->get('gender', '1,3');
$brand = $this->get('brand', null);
$sort = $this->get('sort', null);
$color = $this->get('color', null);
$size = $this->get('size', null);
$price = $this->get('price', null);
$p_d = $this->get('p_d', null);
$channel = $this->get('channel', '1');
$dayLimit = $this->get('dayLimit', '1');
$limit = $this->get('limit', 50);
$page = $this->get('page', 1);
public function discountAction()
{
$data = Newsale::selectNewSaleProducts($gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page);
$data = array(
'header' => array(
'title' => 'SALE'
),
'goodsContainer' => array(
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
)
);
/*$this->_view->assign('title', '折扣专区');
$this->returnJson(200, '获取成功', $data);
}
}
// 折扣专区顶部焦点图
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
// 处理返回的数据
$focus = array();
if($focusData['code'] == 200)
{
foreach ($focusData['data'] as $single)
{
foreach ($single['data'] as $val) {
$val['src'] = Helpers::getImageUrl($val['src'], 375, 667, 1);
$focus[] = $val;
}
}
}
/**
* 折扣专区
*/
public function discountAction()
{
// 折扣专区商品数据
$products = Newsale::getNewProducts('1,3', 1, 60);
var_dump($products);
/*$data = array(
'header' => array(
'title' => 'SALE'
),
'goodsContainer' => array(
'goods' => array(
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
),
array(
'id' => '',
'thumb' => 'http://img12.static.yhbimg.com/adpic/2015/08/14/12/0205a06e86edb30a7d1833477a9e886577.jpg?imageView/2/w/640/h/480',
'name' => 'GAWS DIGI 丛林数码印花拼接卫衣',
'isLike' => false,
'price' => 1268,
'salePrice' => 589,
'isSale' => true,
'isFew' => true,
'isNew' => false,
'url' => ''
)
)
)
);*/
$this->_view->display('new', compact('focus', 'products'));*/
$data = array(
'discount' => true,
'header' => array(
'title' => 'SALE'
)
);
$this->_view->assign('title', '折扣专区');
$this->_view->display('sale', $data);
}
// 折扣专区顶部焦点图
$focusData = Newsale::getNewsaleFocus('e9c9be32d72e2906d404a72ee24cb523');
// 处理返回的数据
$focus = array();
if($focusData['code'] == 200)
{
$focus = $focusData['data'];
}
// 折扣专区商品数据
$products = Newsale::getSaleProducts('1,3', 1);
// 更新tabs
$tabs = array();
foreach (array_keys($products) as $key => $value) {
$tabItem = array();
$tabItem['title'] = $value;
if($key === 0)
{
$tabItem['focus'] = true;
}
$tabs[] = $tabItem;
}
$data += array('tabs' => $tabs);
// 添加商品数据
$data += NewSaleProcess::newSaleData($focus, $products);
echo '<pre>';
print_r($data);exit;
$this->_view->assign('title', '折扣专区');
$this->_view->display('sale', $data);
}
}
\ No newline at end of file
... ...