Authored by 毕凯

Merge remote-tracking branch 'origin/feature/wap326' into feature/wap/postcss

... ... @@ -35,6 +35,20 @@ class UserData
}
/**
* 获取个人中心公告有关数据
*
* @return mixed
*/
public static function noticeData()
{
$param = Yohobuy::param();
$param['method'] = 'app.resources.getNotices';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
... ...
... ... @@ -27,7 +27,7 @@ class HomeController extends AbstractAction
/**
* 通过当前用户审判是否跳到登录
*
* @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @param boolean $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @return void
*/
protected function auditJumpLogin($useSession = true)
... ... @@ -51,6 +51,7 @@ class HomeController extends AbstractAction
'myIndexPage' => true,
'showDownloadApp' => true,
'navHome' => true,
// 'notice' => UserModel::getNoticeData(),
'pageFooter' => true,
'cartUrl' => Helpers::url('/cart/index/index', null),
'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))),
... ...
... ... @@ -45,6 +45,26 @@ class UserModel
}
/**
* 获取个人中心公告有关数据
*
* @return array
*/
public static function getNoticeData()
{
$result = array();
$notice = UserData::noticeData();
// 处理数据
if (isset($notice['data']) && !empty($notice['data'])) {
$result = $notice['data'];
$result['open'] = ($result['open'] === 'Y');
}
return $result;
}
/**
* 处理个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
... ...