...
|
...
|
@@ -36,7 +36,7 @@ class ChristmasController extends HuodongAction |
|
|
switch (intval($result['code'])) {
|
|
|
case 200: // 领取成功, 发送站内信消息
|
|
|
$showPopupFlag = '0';
|
|
|
$this->sendMessage($uid);
|
|
|
$this->sendMessage($uid, '【优惠券】您有6张潮集圣诞优惠券', '尊敬的客户:恭喜您成功获得6张潮集圣诞优惠券 !您可以在个人中心的交易管理中查看‘我的优惠券’。');
|
|
|
break;
|
|
|
case 201: // 已领取过, 提示重复领券
|
|
|
$showPopupFlag = '1';
|
...
|
...
|
@@ -49,13 +49,59 @@ class ChristmasController extends HuodongAction |
|
|
|
|
|
$this->_view->display('index', array(
|
|
|
'staticTitle' => '潮集圣诞',
|
|
|
|
|
|
'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享
|
|
|
'shareLink' => 'http://feature.yohobuy.com/0/0/675/index.html',
|
|
|
'shareTitle' => 'YOHO!BUY有货【潮集圣诞】第一弹来袭!500元优惠券引爆圣诞!',
|
|
|
'shareDesc' => '万件潮品限时58折封顶,再享折上满减,还有惊喜圣诞礼物等你来挑哦!',
|
|
|
'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/09/029fd41969b67002126ff7a71fe5396b6e.png',
|
|
|
|
|
|
'showPopupFlag' => $showPopupFlag,
|
|
|
'myCouponUrl' => $myCouponUrl,
|
|
|
'bannerUrl_1' => 'http://feature.yoho.cn/1211/1211APPHOMEBOY/index.html?openby:yohobuy={"action":"go.h5","params":{"title":"潮集圣诞","url":"http://feature.yoho.cn/1211/1211APPHOMEBOY/index.html?","share":"\/operations\/api\/v5\/webshare\/getShare","shareparam":{"share_id":"454"},"param":{"share_id":"454"}}}',
|
|
|
'bannerUrl_2' => 'http://feature.yoho.cn/1211/1211APPHOMEGIRL/index.html?openby:yohobuy={"action":"go.h5","params":{"title":"潮集圣诞","url":"http://feature.yoho.cn/1211/1211APPHOMEGIRL/index.html?","share":"\/operations\/api\/v5\/webshare\/getShare","shareparam":{"share_id":"456"},"param":{"share_id":"456"}}}',
|
|
|
));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 备注:2015年12月11号上线
|
|
|
*/
|
|
|
public function christmas2Action()
|
|
|
{
|
|
|
//获取登录者ID,未登录返回false
|
|
|
$uid = $this->getLoggedUid();
|
|
|
if (!$uid || !is_numeric($uid)) {
|
|
|
//未登录的用户访问,跳转到登录页面。并且在登陆后跳转回本页面
|
|
|
$this->go(Helpers::url('/signin.html', array('refer' => Helpers::url('/cuxiao/christmas/christmas2')), 'default'));
|
|
|
}
|
|
|
|
|
|
// 该变量用来控制和显示页面的弹出提示
|
|
|
$showPopupFlag = '0';
|
|
|
|
|
|
//获取跳转到个人中心-我的优惠券链接,并调用接口,完成领券操作
|
|
|
$myCouponUrl = Helpers::url('/home/coupons', null, 'default') . '?openby:yohobuy={"action":"go.coupon"}';
|
|
|
$activityId = $this->getActivityId2();
|
|
|
$result = ActivityData::getCouponAll($uid, $activityId);
|
|
|
if (isset($result['code'])) {
|
|
|
switch (intval($result['code'])) {
|
|
|
case 200: // 领取成功, 发送站内信消息
|
|
|
$showPopupFlag = '0';
|
|
|
$this->sendMessage($uid, '【优惠券】您获得1000元套券', '尊敬的客户:恭喜您成功获得1000元套券!您可以在个人中心的交易管理中查看‘我的优惠券’。');
|
|
|
break;
|
|
|
case 201: // 已领取过, 提示重复领券
|
|
|
$showPopupFlag = '1';
|
|
|
break;
|
|
|
default: // 领取失败, 提示领券失败
|
|
|
$showPopupFlag = '2';
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', array(
|
|
|
'staticTitle' => '潮集圣诞',
|
|
|
'weixinShare' => $this->_isApp ? false : true, // 是否需要微信分享
|
|
|
'shareLink' => 'http://feature.yohobuy.com/0/0/701/index.html',
|
|
|
'shareTitle' => 'YOHO!BUY有货【潮集圣诞】第二弹来袭!1000元优惠券引爆圣诞!',
|
|
|
'shareDesc' => '万件潮品限时5折封顶,冬季优品最高直减800元,还有惊喜圣诞礼物等你来挑哦!',
|
|
|
'shareImg' => 'http://img12.static.yhbimg.com/couponImg/2015/12/10/09/029fd41969b67002126ff7a71fe5396b6e.png',
|
|
|
'showPopupFlag' => $showPopupFlag,
|
|
|
'myCouponUrl' => $myCouponUrl,
|
|
|
'bannerUrl_1' => 'http://feature.yoho.cn/1211/1211APPHOMEBOY/index.html?openby:yohobuy={"action":"go.h5","params":{"title":"潮集圣诞","url":"http://feature.yoho.cn/1211/1211APPHOMEBOY/index.html?","share":"\/operations\/api\/v5\/webshare\/getShare","shareparam":{"share_id":"454"},"param":{"share_id":"454"}}}',
|
...
|
...
|
@@ -81,18 +127,17 @@ class ChristmasController extends HuodongAction |
|
|
|
|
|
return $uid;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 发送站内信
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
*/
|
|
|
private function sendMessage($uid)
|
|
|
private function sendMessage($uid, $title, $content)
|
|
|
{
|
|
|
try {
|
|
|
ActivityData::message($uid, '【优惠券】您有6张潮集圣诞优惠券', '尊敬的客户:恭喜您成功获得6张潮集圣诞优惠券 !您可以在个人中心的交易管理中查看‘我的优惠券’。');
|
|
|
}
|
|
|
catch (Exception $e) {
|
|
|
ActivityData::message($uid, $title, $content);
|
|
|
} catch (Exception $e) {
|
|
|
// do nothing
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -116,4 +161,23 @@ class ChristmasController extends HuodongAction |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 根据环境来获取活动ID
|
|
|
*
|
|
|
* @return int
|
|
|
*/
|
|
|
private function getActivityId2()
|
|
|
{
|
|
|
// 设置环境变量
|
|
|
switch (APPLICATION_ENV) {
|
|
|
case 'production': // 生产
|
|
|
return 390;
|
|
|
case 'preview': // 预览
|
|
|
case 'testing': // 测试
|
|
|
case 'develop': // 开发
|
|
|
default:
|
|
|
return 85;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|