Blame view

yohobuy/www.yohobuy.com/application/modules/Home/controllers/Index.php 2.03 KB
whb authored
1 2 3 4 5 6
<?php

use Action\WebAction;
use WebPlugin\Helpers;
use Home\UserModel;
use Home\IndexModel;
cailing authored
7
use LibModels\Web\Home\OrderData;
whb authored
8 9 10 11 12 13 14 15 16 17 18 19

/**
 * 个人中心首页
 */
class IndexController extends WebAction
{

    /**
     * 个人中心首页
     */
    public function indexAction()
    {
whb authored
20
        $uid = $this->auditJumpLogin(true, Helpers::url('/home'));
whb authored
21 22 23 24 25 26 27
        //头部导航
        $channel = Helpers::getChannelNameByCookie();
        $this->setWebNavHeader($channel);
        //面包屑-左侧导航
        $path = array(
            array(
                'href' => SITE_MAIN,
28
                'name' => 'YOHO!BUY 有货首页'
whb authored
29 30 31 32 33
            ),
            array(
                'name' => '个人中心'
            ),
        );
郭成尧 authored
34
        $leftNav = UserModel::getCenterLeftNav('', $uid);
whb authored
35 36
        $data = IndexModel::homeData();
        $udid = $uid . $this->getUdid();
cailing authored
37 38 39
        //取消订单原因列表
        $resons = OrderData::closeReasons();
        $cancelReason = isset($resons['data']) ? $resons['data'] : '';
whb authored
40 41 42 43
        $data = array(
            'path' => $path,
            'userThumb' => UserModel::getUserHeadImg($uid),
            'homeNav' => $leftNav,
cailing authored
44
            'cancelReason' => $cancelReason,
whb authored
45 46 47 48 49 50 51 52 53 54 55 56
            'content' => array(
                array(
                    //消息提示
                    'messages' => IndexModel::getInfoNumData($uid, $udid)
                ),
                array(
                    //最新订单
                    'latestOrders' => IndexModel::latestOrders($uid),
                    'favBrand' => array(
                        'more' => '/brands',
                        'brands' => $data['brand']
                    ),
郭成尧 authored
57
                    'newArrival' => $data['new']
whb authored
58 59
                )
            ),
郭成尧 authored
60 61
            'recommend' => $data['new'], //待处理
            'banner' => IndexModel::getFooterBanner(),
whb authored
62 63 64 65 66
            'helpUsUrl' => ''
        );
        $this->_view->display('index', array('meIndexPage' => true, 'me' => $data));
    }
}