Commit 75dda2f2 authored by 谈海涛's avatar 谈海涛

标签分类优化

parent 9f0f3652
......@@ -15,35 +15,38 @@ use internalApi\base\Client;
class Label extends Client
{
//类型 1=>认证 2=>品类 3=>品牌 4=>热门事件 5=>现象 6=>故障点 7=>专题
const TYPE_AUTH = 1; // 认证
const TYPE_CATEGORY = 2; // 品类
const TYPE_BRAND = 3; // 品牌
const TYPE_HOT_EVENTS = 4; // 热门事件
const TYPE_PHENOMENON = 5; // 现象
const TYPE_FAULT = 6; // 故障点
const TYPE_SPECIAL_TOPIC = 7; // 专题
//类型 1=>认证 2=>品类 3=>品牌
const TYPE_AUTH = 1; //认证
const TYPE_CATEGORY = 2; //品类
const TYPE_BRAND = 3; //品牌
/**
* @param array/int $type 1=>认证 2=>品类 3=>品牌
* @return mixed
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public static function getLabels($type = null)
{
return self::call('label.getLabels', compact('type'));
}
/**
* @param array/int $type 1=>认证 2=>品类 3=>品牌
*
* @return mixed
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public static function getLabels($type = null){
return self::call('label.getLabels', compact('type'));
}
/**
* 标签分类
*
* @param array $labels 标签
* @param array $types //类型 1=>认证 2=>品类 3=>品牌 4=>热门事件 5=>现象 6=>故障点 7=>专题
* @param array $types //类型 1=>认证 2=>品类 3=>品牌 4=>热门事件 5=>现象 6=>故障点 7=>专题
*
* @return array
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public static function getListByLabels($labels, $types = [2, 3, 5, 6])
{
return self::call('label.getListByLabels', compact('labels','types'));
public static function getListByLabels($labels, $types = [self::TYPE_CATEGORY, self::TYPE_BRAND, self::TYPE_PHENOMENON, self::TYPE_FAULT]){
return self::call('label.getListByLabels', compact('labels', 'types'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment