Authored by yangyang

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -298,7 +298,12 @@ class FloorProcess
$one['img'] = Helpers::getImageUrl($one['src'], 640, 403);
unset($one['src']);
}
$result['big_image']['list'] = $data['big_image'];
// 区别多张图与一张图
if (count($data['big_image']) > 1) {
$result['big_image']['list'] = $data['big_image'];
unset($data['big_image']);
}
foreach ($data['list'] as $kk => &$one) {
if ($kk == 0) {
... ... @@ -318,8 +323,6 @@ class FloorProcess
$data['title']['more_url'] = Helpers::getFilterUrl($data['title']['more_url']);
}
unset($data['big_image']);
$result['goodsCategory'] = $data;
return $result;
... ...
... ... @@ -50,4 +50,47 @@ class NewSaleProcess
return $result;
}
/**
* 处理热销排行榜数据
*
* @param array $products 接口传回的数据
* @param boolean $notab 是否传回tab数据
* @param int $limit 查询返回的最大限制数
* @param int $page 分页第几页
* @return array 处理之后的数据
*/
public static function topData($products, $notab, $limit, $page)
{
$result = array();
// 处理Tabs
if (!$notab && isset($products['tabs'])) {
$result['tabs'] = array();
foreach ($products['tabs'] as $key => $one) {
$tabItem = array();
$tabItem['title'] = $one;
$tabItem['dataId'] = $key;
if ($key === 1) {
$tabItem['focus'] = true;
}
$result['tabs'][] = $tabItem;
}
}
// 处理商品
if (isset($products['product_list'])) {
$count = count($products['product_list']);
$one = array();
foreach ($products['product_list'] as $key => $single) {
$one = Helpers::formatProduct($single, true, false, false, 75, 114);
$one['rank'] = $limit * ($page -1) + $key + 1;
$result['goods'][] = $one;
}
}
return $result;
}
}
... ...
... ... @@ -25,10 +25,10 @@ class HomeController extends AbstractAction
$this->setTitle('个人中心');
$this->setNavHeader('个人中心', true, SITE_MAIN);
// $uid = $this->getUid();
$uid = 967016;
$data = \Index\UserModel::getUserProfileData($uid);
$data += \Index\UserModel::getInfoNumData($uid);
// $uid = $this->getUid();
$uid = 8826435;
$data = \Index\UserModel::getUserProfileData($uid);
$data += \Index\UserModel::getInfoNumData($uid);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
... ... @@ -41,50 +41,56 @@ class HomeController extends AbstractAction
$this->_view->display('index', $data);
}
/**
* 用户订单
*/
public function ordersAction() {
// $uid = $this->getUid();
// $type = $this->get('type', 1);
// $orders = \Index\UserModel::getUserOrderData(967016, $type);
$order = array(
'orders' => array(
array(
'orderNum' => '408539077',
'tradingStatus' => '交易成功',
'goods' => array(
array(
'id' => 1,
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'Adidas Originals ZX FLUXM22508',
'color' => '黄',
'size' => '43',
'price' => '699.00',
'count' => '2'
),
array(
'id' => 1,
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'B.Duck浴室玩伴mini浮水鸭',
'gift' => true,
'color' => '黄',
'size' => '43',
'price' => '0.00',
'count' => '1'
)
),
'count' => 2,
'sumCost' => '699.00',
'unpaid' => true,
)
)
);
/**
* 用户订单
*/
public function ordersAction()
{
// 设置网站标题
$this->setTitle('我的订单');
$this->setNavHeader('我的订单', true, SITE_MAIN);
$uid = $this->getUid();
$uid = 8826435;
$type = $this->get('type', 1);
$order = \Index\UserModel::getUserOrderData($uid, $type);
$order = array(
'orders' => array(
array(
'orderNum' => '408539077',
'tradingStatus' => '交易成功',
'goods' => array(
array(
'id' => 1,
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'Adidas Originals ZX FLUXM22508',
'color' => '黄',
'size' => '43',
'price' => '699.00',
'count' => '2'
),
array(
'id' => 1,
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'B.Duck浴室玩伴mini浮水鸭',
'gift' => true,
'color' => '黄',
'size' => '43',
'price' => '0.00',
'count' => '1'
)
),
'count' => 2,
'sumCost' => '699.00',
'unpaid' => true,
)
)
);
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
// print_r($orders);
}
$this->_view->display('order', array('order' => $order, 'orderPage' => true));
}
/**
* 用户收藏的商品
... ... @@ -380,7 +386,6 @@ class HomeController extends AbstractAction
/*
* 会员特权查看页
*/
public function preferentialAction() {
//设置网站seo信息
$this->setTitle('会员等级');
... ... @@ -397,7 +402,6 @@ class HomeController extends AbstractAction
/*
* 我的订单页面
*/
public function orderAction() {
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
$type = $this->get('type', 1);
... ... @@ -426,7 +430,6 @@ class HomeController extends AbstractAction
/*
* 我的订单-处理ajax请求页面(切换订单状态)
*/
public function orderAjaxAction() {
//判断是不是ajax请求
... ...
... ... @@ -103,8 +103,6 @@ class UserModel
// 处理用户订单数据
if (isset($orderData['data']) && !empty($orderData['data'])) {
$result = $orderData['data'];
$oneOrder = array();
foreach ($orderData['data']['order_list'] as $val) {
$oneOrder = array();
... ... @@ -120,21 +118,18 @@ class UserModel
$oneGoods = array();
$oneGoods['id'] = 1;
$oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80);
$oneGoods['name'] = $val['product_name'];
$oneGoods['color'] = $val['color_name'];
$oneGoods['size'] = $val['size_name'];
$oneGoods['size_name'] = $val['size_name'];
$oneGoods['price'] = $val['goods_price'];
$oneGoods['count'] = $val['buy_number'];
$result['goods'][] = $oneGoods;
$oneGoods['name'] = $goods['product_name'];
$oneGoods['color'] = $goods['color_name'];
$oneGoods['size'] = $goods['size_name'];
$oneGoods['price'] = $goods['goods_price'];
$oneGoods['count'] = $goods['buy_number'];
$oneOrder[] = $oneGoods;
}
$result['orders'][] = $oneOrder;
}
}
print_r($result);
return $result;
}
... ...
... ... @@ -234,8 +234,8 @@ class NewsaleModel
* @param string|null $sort 品类ID查询参数
* @param integer|null $tab_id Tab的ID
* @param boolean $notab 时候返回顶部tab的数据,默认返回
* @param integer $limit 查询返回的最大限制数, 默认为50
* @param integer $page 分页第几页, 默认第1页
* @param integer $limit 查询返回的最大限制数
* @param integer $page 分页第几页
* @return array 处理之后的数据
*/
public static function selectTopData($gender, $sort, $tab_id, $notab, $limit, $page)
... ... @@ -245,12 +245,7 @@ class NewsaleModel
$data = NewsaleData::getTopProducts($gender, $sort, $tab_id, $limit, $page);
if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['product_list'])) {
$result = NewSaleProcess::newSaleData($data['data']);
unset($result['filter']);
if ($notab) {
unset($result['tabs']);
}
$result = NewSaleProcess::topData($data['data'], $notab, $limit, $page);
}
return $result;
... ...