...
|
...
|
@@ -22,15 +22,16 @@ class BrandData |
|
|
*
|
|
|
* @param int $id 品牌ID
|
|
|
* @param int $uid 用户ID
|
|
|
* @param bool $isBrand 是品牌还是商品
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function favorite($id, $uid)
|
|
|
public static function favorite($id, $uid, $isBrand = true)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.favorite.add';
|
|
|
$param['id'] = $id;
|
|
|
$param['uid'] = $uid;
|
|
|
$param['type'] = 'brand';
|
|
|
$param['type'] = $isBrand ? 'brand' : 'product';
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::post(Yohobuy::API_URL, $param);
|
...
|
...
|
@@ -41,15 +42,16 @@ class BrandData |
|
|
*
|
|
|
* @param int $id 品牌ID
|
|
|
* @param int $uid 用户ID
|
|
|
* @param bool $isBrand 是品牌还是商品
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function favoriteCancel($id, $uid)
|
|
|
public static function favoriteCancel($id, $uid, $isBrand = true)
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.favorite.cancel';
|
|
|
$param['fav_id'] = $id;
|
|
|
$param['uid'] = $uid;
|
|
|
$param['type'] = 'brand';
|
|
|
$param['type'] = $isBrand ? 'brand' : 'product';
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
return Yohobuy::post(Yohobuy::API_URL, $param);
|
...
|
...
|
|