CouponData.php
1.11 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
<?php
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/4/19
* Time: 10:50
*/
namespace LibModels\Wap\Coupon;
use Api\Sign;
use Api\Yohobuy;
class CouponData
{
/**
* 获取领券楼层数据
*
* @param $uid 用户ID
* @param $contentCode 资源码
* @return array|mixed
*/
public static function getCouponRousource($contentCode, $uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.promotion.queryCouponCenter';
$param['contentCode'] = $contentCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* @param $uid 用户ID
* @param $couponId 优惠券ID
* @return mixed
*/
public static function receiveCoupon($uid, $couponId)
{
$param = Yohobuy::param();
$param['method'] = 'app.promotion.getCoupon';
$param['couponId'] = $couponId;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}