1
|
<?php
|
1
|
<?php
|
2
|
|
2
|
|
3
|
use Action\HuodongAction;
|
3
|
use Action\HuodongAction;
|
4
|
-use LibModels\Wap\Cuxiao\ActivityData;
|
4
|
+use Cuxiao\XinshiliModel;
|
5
|
use Plugin\Helpers;
|
5
|
use Plugin\Helpers;
|
6
|
|
6
|
|
7
|
/**
|
7
|
/**
|
|
@@ -35,14 +35,13 @@ class XinshiliController extends HuodongAction |
|
@@ -35,14 +35,13 @@ class XinshiliController extends HuodongAction |
35
|
private function checkLogin()
|
35
|
private function checkLogin()
|
36
|
{
|
36
|
{
|
37
|
$playUrl = Helpers::url('/cuxiao/xinshili/index');
|
37
|
$playUrl = Helpers::url('/cuxiao/xinshili/index');
|
38
|
- $playUrlEncode = strtr($playUrl, array('/' => '\\/'));
|
|
|
39
|
|
38
|
|
40
|
$uid = $this->getLoggedUid();
|
39
|
$uid = $this->getLoggedUid();
|
41
|
if (!$uid) {
|
40
|
if (!$uid) {
|
42
|
if (!$this->_isApp) {
|
41
|
if (!$this->_isApp) {
|
43
|
- $this->go(Helpers::url('/signin.html', array('refer' => Helpers::url('/cuxiao/xinshili/index')), 'default'));
|
42
|
+ $this->go(Helpers::url('/signin.html', array('refer' => $playUrl), 'default'));
|
44
|
} else {
|
43
|
} else {
|
45
|
- $playUrl = Helpers::url('/cuxiao/xinshili/index');
|
44
|
+ $playUrlEncode = strtr($playUrl, array('/' => '\\/'));
|
46
|
$this->go($playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}');
|
45
|
$this->go($playUrl . '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' . $playUrlEncode . '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}');
|
47
|
}
|
46
|
}
|
48
|
}
|
47
|
}
|
|
@@ -92,14 +91,7 @@ class XinshiliController extends HuodongAction |
|
@@ -92,14 +91,7 @@ class XinshiliController extends HuodongAction |
92
|
|
91
|
|
93
|
$activityId = $this->getActivityId();
|
92
|
$activityId = $this->getActivityId();
|
94
|
$uid = $this->getLoggedUid();
|
93
|
$uid = $this->getLoggedUid();
|
95
|
- $result = ActivityData::getCouponAll($uid, $activityId);
|
|
|
96
|
- if (!isset($result['code'])) {
|
|
|
97
|
- break;
|
|
|
98
|
- }
|
|
|
99
|
-
|
|
|
100
|
- if (intval($result['code']) === 200) {
|
|
|
101
|
- $this->sendMessage($uid, '【优惠券】您获得1000元套券', '尊敬的客户:恭喜您成功获得1000元套券!您可以在个人中心的交易管理中查看‘我的优惠券’。');
|
|
|
102
|
- }
|
94
|
+ $result = XinshiliModel::getXinshiliCoupon($uid, $activityId);
|
103
|
} while (false);
|
95
|
} while (false);
|
104
|
|
96
|
|
105
|
$this->echoJson($result);
|
97
|
$this->echoJson($result);
|
|
@@ -124,20 +116,4 @@ class XinshiliController extends HuodongAction |
|
@@ -124,20 +116,4 @@ class XinshiliController extends HuodongAction |
124
|
}
|
116
|
}
|
125
|
}
|
117
|
}
|
126
|
|
118
|
|
127
|
- /**
|
|
|
128
|
- * 发送站内信
|
|
|
129
|
- *
|
|
|
130
|
- * @param int $uid 用户ID
|
|
|
131
|
- * @param string $title 站内信标题
|
|
|
132
|
- * @param string $content 站内信内容
|
|
|
133
|
- */
|
|
|
134
|
- private function sendMessage($uid, $title, $content)
|
|
|
135
|
- {
|
|
|
136
|
- try {
|
|
|
137
|
- ActivityData::message($uid, $title, $content);
|
|
|
138
|
- } catch (Exception $e) {
|
|
|
139
|
- // do nothing
|
|
|
140
|
- }
|
|
|
141
|
- }
|
|
|
142
|
-
|
|
|
143
|
} |
119
|
} |