...
|
...
|
@@ -7,7 +7,7 @@ use Api\Yohobuy; |
|
|
|
|
|
/**
|
|
|
* 领券活动
|
|
|
*
|
|
|
*
|
|
|
* @name Coupon
|
|
|
* @package Cuxiao
|
|
|
* @copyright yoho.inc
|
...
|
...
|
@@ -109,7 +109,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 女生的品牌领券
|
|
|
*
|
|
|
*
|
|
|
* 上线时间 2015/12/1
|
|
|
*/
|
|
|
public function girlsbrandAction()
|
...
|
...
|
@@ -202,7 +202,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 潮童的品牌领券
|
|
|
*
|
|
|
*
|
|
|
* 上线时间 2015/12/1
|
|
|
*/
|
|
|
public function kidsbrandAction()
|
...
|
...
|
@@ -250,7 +250,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 创意生活的品牌领券
|
|
|
*
|
|
|
*
|
|
|
* 上线时间 2015/12/1
|
|
|
*/
|
|
|
public function lifestylebrandAction()
|
...
|
...
|
@@ -363,7 +363,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 女生的品牌领券
|
|
|
*
|
|
|
*
|
|
|
* 上线时间 2015/12/7
|
|
|
*/
|
|
|
public function girlsbrand2Action()
|
...
|
...
|
@@ -425,8 +425,8 @@ class CouponController extends HuodongAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新客领券
|
|
|
*
|
|
|
* 新客领券
|
|
|
*
|
|
|
* 上线时间2015/12/2
|
|
|
*/
|
|
|
public function newuserAction()
|
...
|
...
|
@@ -519,7 +519,7 @@ class CouponController extends HuodongAction |
|
|
'url_1026' => 'http://list.m.yohobuy.com/?msort=6&misort=45&openby:yohobuy={"action":"go.list","params":{"msort":"6","misort":"45","title":"冬靴"}}'
|
|
|
));
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 新客领券(第三波)2016年1月7号上线
|
|
|
*/
|
...
|
...
|
@@ -567,7 +567,7 @@ class CouponController extends HuodongAction |
|
|
//// 'url_4' => 'http://list.m.yohobuy.com/?msort=3,4&title=下装&openby:yohobuy={"action":"go.list","params":{"msort":"3,4","title":"下装"}}',
|
|
|
//// 'url_3' => 'http://list.m.yohobuy.com/?msort=7,8&title=包配&openby:yohobuy={"action":"go.list","params":{"msort":"7,8","title":"包配"}}',
|
|
|
//// 'url_6' => 'http://list.m.yohobuy.com/?msort=1,3,6&misort=11,28,12,46&title=反季&openby:yohobuy={"action":"go.list","params":{"msort":"1,3,6","misort":"11,28,12,46","title":"反季"}}',
|
|
|
//
|
|
|
//
|
|
|
// 'url_1' => 'http://list.m.yohobuy.com/?msort=1&misort=18,20,21,22&title=冬装&openby:yohobuy={"action":"go.list","params":{"msort":"1","misort":"18,20,21,22","title":"冬装"}}',
|
|
|
// 'url_2' => 'http://list.m.yohobuy.com/?msort=1&misort=21,22,226&title=春装外套&openby:yohobuy={"action":"go.list","params":{"msort":"1","misort":"18,20,21,22","title":"春装外套"}}',
|
|
|
// 'url_3' => 'http://list.m.yohobuy.com/?msort=6&misort=45&title=靴子&openby:yohobuy={"action":"go.list","params":{"msort":"6","misort":"45","title":"靴子"}}',
|
...
|
...
|
@@ -576,7 +576,7 @@ class CouponController extends HuodongAction |
|
|
// 'url_6' => 'http://list.m.yohobuy.com/?msort=1&misort=16,257&title=春装&openby:yohobuy={"action":"go.list","params":{"msort":"1","misort":"16,257","title":"春装"}}',
|
|
|
// 'url_7' => 'http://list.m.yohobuy.com/?msort=1,3,6&misort=11,28,12,46&title=夏装&openby:yohobuy={"action":"go.list","params":{"msort":"1,3,6","misort":"11,28,12,46","title":"夏装"}}',
|
|
|
// ));
|
|
|
|
|
|
|
|
|
// 判断是否是应用访问, 拼接APP需要的URL参数
|
|
|
$isApp = null !== $this->get('app_version');
|
|
|
$isAppLogged = true;
|
...
|
...
|
@@ -623,7 +623,7 @@ class CouponController extends HuodongAction |
|
|
'url_7' => 'http://list.m.yohobuy.com/?msort=1,3,6&misort=11,28,12,46&title=夏装&openby:yohobuy={"action":"go.list","params":{"msort":"1,3,6","misort":"11,28,12,46","title":"夏装"}}',
|
|
|
));
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 新客领券(第4波)2016年3月14号上线
|
|
|
*/
|
...
|
...
|
@@ -680,6 +680,7 @@ class CouponController extends HuodongAction |
|
|
/**
|
|
|
* 新客领券(第5波)2016年4月26号上线
|
|
|
*/
|
|
|
/*
|
|
|
public function newuser5Action()
|
|
|
{
|
|
|
// 判断是否是应用访问, 拼接APP需要的URL参数
|
...
|
...
|
@@ -727,12 +728,62 @@ class CouponController extends HuodongAction |
|
|
'url_6' => 'http://list.m.yohobuy.com/?msort=10&openby:yohobuy={"action":"go.list","params":{"msort":"10","title":"创意生活"}}'
|
|
|
));
|
|
|
}
|
|
|
*/
|
|
|
/**
|
|
|
* 新客领券(第6波)2016年5月13号上线
|
|
|
*/
|
|
|
public function newuser5Action()
|
|
|
{
|
|
|
// 判断是否是应用访问, 拼接APP需要的URL参数
|
|
|
$isApp = null !== $this->get('app_version');
|
|
|
$isAppLogged = true;
|
|
|
if ($isApp) {
|
|
|
$isLogged = $this->get('uid') !== null;
|
|
|
$isAppLogged = $this->checkIsLogin();
|
|
|
} else {
|
|
|
$isLogged = $this->getUid();
|
|
|
}
|
|
|
$urlNewuser = Helpers::url('/cuxiao/coupon/newuser5');
|
|
|
$urlYohope = Helpers::url('/cuxiao/coupon/yohope');
|
|
|
$urlHelp = Helpers::url('/cuxiao/coupon/help');
|
|
|
$urlMycoupon = Helpers::url('/home/coupons', null, 'default');
|
|
|
$urlEncode = strtr($urlNewuser, array('/' => '\\/'));
|
|
|
$channel = $this->get('yh_channel', '1');
|
|
|
switch (strval($channel)) {
|
|
|
case '1':
|
|
|
$gender = '1,3';
|
|
|
break;
|
|
|
case '2':
|
|
|
$gender = '2,3';
|
|
|
break;
|
|
|
default:
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
$url = Helpers::url('/boys', array(), 'default') . '?openby:yohobuy={"action":"go.home","params":{"gender":"' . $gender . '","channel":"' . $channel . '"}}';
|
|
|
|
|
|
$this->_view->display('newuser6', array(
|
|
|
'activityId' => 604,//627
|
|
|
'staticTitle' => '新人潮这看,超值惊喜等你领', // 标题
|
|
|
'jumpUrl' => $isAppLogged ? 'javascript:;' : $urlNewuser . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $urlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}',
|
|
|
'isLogged' => $isLogged ? 'Y' : 'N', // 标识是否登录
|
|
|
'url_mycoupon' => $urlMycoupon . '?openby:yohobuy={"action":"go.coupon"}',
|
|
|
'url_yohope' => $urlYohope . '?yohobuy={"action":"go.h5","params":{"islogin":"Y","type":0,"url":"' . $urlYohope . '","param":{}}}',
|
|
|
'url_help' => $urlHelp . '?yohobuy={"action":"go.h5","params":{"islogin":"Y","type":0,"url":"' . $urlHelp . '","param":{}}}',
|
|
|
'url_more' => $url,
|
|
|
|
|
|
'url_1' => 'http://list.m.yohobuy.com/?msort=1&misort=18,20,21,22,172,226&openby:yohobuy={"action":"go.list","params":{"msort":"1","misort":"18,20,21,22,172,226","title":"外套"}}',
|
|
|
'url_2' => 'http://list.m.yohobuy.com/?msort=1&misort=12,16,257&openby:yohobuy={"action":"go.list","params":{"msort":"1","misort":"12,16,257","title":"春装"}}',
|
|
|
'url_3' => 'http://list.m.yohobuy.com/?gender=2,3&msort=4&misort=31,32&openby:yohobuy={"action":"go.list","params":{"msort":"4","misort":"31,32","gender":"2,3","title":"裙装"}}',
|
|
|
'url_4' => 'http://list.m.yohobuy.com/?msort=3&misort=26,27,28&openby:yohobuy={"action":"go.list","params":{"msort":"3","misort":"26,27,28","title":"裤装"}}',
|
|
|
'url_5' => 'http://list.m.yohobuy.com/?msort=7,8&openby:yohobuy={"action":"go.list","params":{"msort":"7,8","title":"包配"}}',
|
|
|
'url_6' => 'http://list.m.yohobuy.com/?msort=10&openby:yohobuy={"action":"go.list","params":{"msort":"10","title":"创意生活"}}',
|
|
|
'url_7' => 'http://list.m.yohobuy.com/?msort=1&misort=12&openby:yohobuy={"action":"go.list","params":{"msort":"1","misort":"12","title":"衬衫"}}',
|
|
|
));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新客领券YOHOPE
|
|
|
*
|
|
|
*
|
|
|
* 上线时间2015/12/2
|
|
|
*/
|
|
|
public function yohopeAction()
|
...
|
...
|
@@ -769,8 +820,8 @@ class CouponController extends HuodongAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 新客领券 - 如何使用优惠券帮助页
|
|
|
*
|
|
|
* 新客领券 - 如何使用优惠券帮助页
|
|
|
*
|
|
|
* 上线时间2015/12/2
|
|
|
*/
|
|
|
public function helpAction()
|
...
|
...
|
@@ -779,10 +830,10 @@ class CouponController extends HuodongAction |
|
|
'staticTitle' => '如何使用优惠券'
|
|
|
));
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Final Sale 领券活动
|
|
|
*
|
|
|
*
|
|
|
* 上线时间2016/01/12
|
|
|
*/
|
|
|
public function finalAction()
|
...
|
...
|
@@ -793,7 +844,7 @@ class CouponController extends HuodongAction |
|
|
//未登录的用户访问,跳转到登录页面。并且在登陆后跳转回本页面
|
|
|
$this->go(Helpers::url('/signin.html', array('refer' => Helpers::url('/cuxiao/coupon/final')), 'default'));
|
|
|
}
|
|
|
|
|
|
|
|
|
// 该变量用来控制和显示页面的弹出提示
|
|
|
$showPopupFlag = '0';
|
|
|
|
...
|
...
|
@@ -832,10 +883,10 @@ class CouponController extends HuodongAction |
|
|
'downAppUrl' => 'http://www.yohoshow.com/about/index/yohobuyqr',
|
|
|
));
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* Final Sale 领券活动第二波
|
|
|
*
|
|
|
*
|
|
|
* 上线时间2016/01/25
|
|
|
*/
|
|
|
public function final2Action()
|
...
|
...
|
@@ -846,7 +897,7 @@ class CouponController extends HuodongAction |
|
|
//未登录的用户访问,跳转到登录页面。并且在登陆后跳转回本页面
|
|
|
$this->go(Helpers::url('/signin.html', array('refer' => Helpers::url('/cuxiao/coupon/final2')), 'default'));
|
|
|
}
|
|
|
|
|
|
|
|
|
// 该变量用来控制和显示页面的弹出提示
|
|
|
$showPopupFlag = '0';
|
|
|
|
...
|
...
|
@@ -885,11 +936,11 @@ class CouponController extends HuodongAction |
|
|
'downAppUrl' => 'http://www.yohoshow.com/about/index/yohobuyqr',
|
|
|
));
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 领取指定的优惠券
|
|
|
*
|
|
|
*
|
|
|
* @param int activityId 活动ID
|
|
|
* @param int couponId 优惠券ID
|
|
|
* @return json
|
...
|
...
|
@@ -913,9 +964,14 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/* 判断用户是否登录 */
|
|
|
$uid = $this->getSession(self::SESSION_UID);
|
|
|
|
|
|
if (!$uid) {
|
|
|
$uid = $this->getUid();
|
|
|
if (!$uid) {
|
|
|
$uid = $this->get('uid'); // session 获取不到 UID,直接获取查询字符串的 uid, 严重问题,不安全,需要修复
|
|
|
}
|
|
|
|
|
|
if (empty($uid)) {
|
|
|
$result['code'] = 400;
|
|
|
$result['message'] = '请先登录';
|
|
|
$result['data'] = Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/')), 'default');
|
...
|
...
|
@@ -932,7 +988,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 领取所有的优惠券
|
|
|
*
|
|
|
*
|
|
|
* @param int activityId 活动ID
|
|
|
* @return json
|
|
|
*/
|
...
|
...
|
@@ -973,7 +1029,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 检查用户是否登录
|
|
|
*
|
|
|
*
|
|
|
* @return bool (false:表示未登录,true:表示已登录)
|
|
|
*/
|
|
|
private function checkIsLogin()
|
...
|
...
|
@@ -998,10 +1054,10 @@ class CouponController extends HuodongAction |
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 检测登录状态
|
|
|
*
|
|
|
*
|
|
|
* @return int
|
|
|
*/
|
|
|
private function getLoggedUid()
|
...
|
...
|
@@ -1020,7 +1076,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 发送站内信
|
|
|
*
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
*/
|
|
|
private function sendMessage($uid, $title, $content)
|
...
|
...
|
@@ -1034,7 +1090,7 @@ class CouponController extends HuodongAction |
|
|
|
|
|
/**
|
|
|
* 根据环境来获取活动ID
|
|
|
*
|
|
|
*
|
|
|
* @return int
|
|
|
*/
|
|
|
private function getActivityId()
|
...
|
...
|
@@ -1050,10 +1106,10 @@ class CouponController extends HuodongAction |
|
|
return 89;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据环境来获取活动ID
|
|
|
*
|
|
|
*
|
|
|
* @return int
|
|
|
*/
|
|
|
private function getActivityId2()
|
...
|
...
|
|