Authored by hf

do merge ActivityData.php

... ... @@ -15,10 +15,11 @@ use Api\Yohobuy;
*/
class ActivityData
{
const URI_GET_ACTIVITY_INFO = 'event/api/v1/activity/get';
const URI_GET_NAMED_COUPON = 'event/api/v1/activity/getCoupon';
const URI_GET_ALL_COUPON = 'event/api/v1/activity/getCoupon';
/**
* 用户获取某个活动指定的单个优惠券
*
... ... @@ -36,7 +37,7 @@ class ActivityData
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_GET_NAMED_COUPON, $param);
}
/**
* 用户获取某个活动所有的优惠券操作
*
... ... @@ -49,10 +50,10 @@ class ActivityData
$param = array();
$param['uid'] = $uid;
$param['activity_id'] = $activityId;
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_GET_ALL_COUPON, $param);
}
/**
* 获取活动信息
*
... ... @@ -62,8 +63,22 @@ class ActivityData
public static function getActivityInfo($activityId)
{
$param = array('activity_id' => $activityId);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_GET_ACTIVITY_INFO, $param, 3600); // 有缓存1小时
}
/**
* 发送站内信
*
* @param int $activityId 活动ID
* @return array
*/
public static function message($uid, $title, $content, $type = 1, $verify_key = '', $send_uid = 0, $call_back = '')
{
//调用接口发送站内信
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_SEND_MESSAGE, 'setSingleMessage', array(
$uid, $title, $content, $type, $verify_key, $send_uid, $call_back
));
}
}
... ...