|
|
<?php
|
|
|
|
|
|
use Action\HuodongAction;
|
|
|
use LibModels\Wap\Cuxiao\ActivityData;
|
|
|
use Cuxiao\XinshiliModel;
|
|
|
use Plugin\Helpers;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -35,14 +35,13 @@ class XinshiliController extends HuodongAction |
|
|
private function checkLogin()
|
|
|
{
|
|
|
$playUrl = Helpers::url('/cuxiao/xinshili/index');
|
|
|
$playUrlEncode = strtr($playUrl, array('/' => '\\/'));
|
|
|
|
|
|
$uid = $this->getLoggedUid();
|
|
|
if (!$uid) {
|
|
|
if (!$this->_isApp) {
|
|
|
$this->go(Helpers::url('/signin.html', array('refer' => Helpers::url('/cuxiao/xinshili/index')), 'default'));
|
|
|
$this->go(Helpers::url('/signin.html', array('refer' => $playUrl), 'default'));
|
|
|
} else {
|
|
|
$playUrl = Helpers::url('/cuxiao/xinshili/index');
|
|
|
$playUrlEncode = strtr($playUrl, array('/' => '\\/'));
|
|
|
$this->go($playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}');
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -92,14 +91,7 @@ class XinshiliController extends HuodongAction |
|
|
|
|
|
$activityId = $this->getActivityId();
|
|
|
$uid = $this->getLoggedUid();
|
|
|
$result = ActivityData::getCouponAll($uid, $activityId);
|
|
|
if (!isset($result['code'])) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
if (intval($result['code']) === 200) {
|
|
|
$this->sendMessage($uid, '【优惠券】您获得1000元套券', '尊敬的客户:恭喜您成功获得1000元套券!您可以在个人中心的交易管理中查看‘我的优惠券’。');
|
|
|
}
|
|
|
$result = XinshiliModel::getXinshiliCoupon($uid, $activityId);
|
|
|
} while (false);
|
|
|
|
|
|
$this->echoJson($result);
|
...
|
...
|
@@ -124,20 +116,4 @@ class XinshiliController extends HuodongAction |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发送站内信
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param string $title 站内信标题
|
|
|
* @param string $content 站内信内容
|
|
|
*/
|
|
|
private function sendMessage($uid, $title, $content)
|
|
|
{
|
|
|
try {
|
|
|
ActivityData::message($uid, $title, $content);
|
|
|
} catch (Exception $e) {
|
|
|
// do nothing
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|