BrandData.php
1.21 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
<?php
namespace LibModels\Wap\Product;
use Api\Yohobuy;
use Api\Sign;
/**
* 商品品牌相关的数据模型
*
* @name BrandData
* @package
* @copyright yoho.inc
* @version 1.0 (2015-10-28 11:12:35)
* @author fei.hong <fei.hong@yoho.cn>
*/
class BrandData
{
/**
* 收藏
*
* @param int $id 品牌ID
* @param int $uid 用户ID
* @return array
*/
public static function favorite($id, $uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.add';
$param['id'] = $id;
$param['uid'] = $uid;
$param['type'] = 'brand';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
* 取消收藏
*
* @param int $id 品牌ID
* @param int $uid 用户ID
* @return array
*/
public static function favoriteCancel($id, $uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.cancel';
$param['fav_id'] = $id;
$param['uid'] = $uid;
$param['type'] = 'brand';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
}