Girlday.php
1.39 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
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2016/3/2
* Time: 10:53
*/
namespace Cuxiao;
use LibModels\Wap\Cuxiao\ActivityData;
class GirldayModel
{
/**
* 获取领券活动结果
*
* @param int $uid 用户id
* @param int $actId 活动id
* @return array
*/
public static function getGirldayCoupon($uid, $actId)
{
$result = array('code' => 201);
do {
if (empty($uid) || empty($actId)) {
break;
}
$result = ActivityData::getCouponAll($uid, $actId);
if (!$result) {
$result = array('code' => 201);
break;
}
if (intval($result['code']) === 200) {
self::sendMessage($uid, '【优惠券】您有4张春潮新势力优惠券', '尊敬的客户:恭喜您成功获得4张春潮新势力优惠券 !您可以在个人中心查看优惠券详情。');
}
} while (false);
return $result;
}
/**
* 发送站内信
*
* @param int $uid 用户ID
* @param string $title 站内信标题
* @param string $content 站内信内容
*/
private static function sendMessage($uid, $title, $content)
{
try {
ActivityData::message($uid, $title, $content);
} catch (Exception $e) {
// do nothing
}
}
}