Gift.php
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
use Action\WebAction;
use WebPlugin\Helpers;
use Home\UserModel;
use Home\AddressModel;
use Home\ReturnsModel;
use LibModels\Web\Home\UserData;
use LibModels\Web\Home\AddressData;
/**
* 个人中心 礼品卡兑换
*/
class GiftController extends WebAction
{
/**
* 个人中心-兑换礼品卡提交返回信息
*/
public function exchangeAction()
{
//判断是否登录
$this->auditJumpLogin();
//头部导航
$channel = Helpers::getChannelNameByCookie();
$this->setWebNavHeader($channel);
//面包屑-左侧导航
$path = UserModel::getCenterCrumb('兑换礼品卡');
$leftNav = UserModel::getCenterLeftNav('兑换礼品卡');
//用户信息
$data = array(
'path' => $path,
'homeNav' => $leftNav,
'giftOk' => true,
'isFail' => false
);
$this->_view->display('../../index/home/gift', array(
'gift' => $data
));
}
/**
* 通过当前用户审判是否跳到登录
*
* @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @return void
*/
protected function auditJumpLogin($useSession = true)
{
$uid = $this->getUid($useSession);
if (!$uid) {
$this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
}
else {
return $uid;
}
}
}