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

标签分类优化

parent 9f0f3652
...@@ -15,35 +15,38 @@ use internalApi\base\Client; ...@@ -15,35 +15,38 @@ use internalApi\base\Client;
class Label extends 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; //认证 * @param array/int $type 1=>认证 2=>品类 3=>品牌
const TYPE_CATEGORY = 2; //品类 *
const TYPE_BRAND = 3; //品牌 * @return mixed
* @throws \internalApi\base\ApiException
/** * @throws \internalApi\base\ClientException
* @param array/int $type 1=>认证 2=>品类 3=>品牌 */
* @return mixed public static function getLabels($type = null){
* @throws \internalApi\base\ApiException return self::call('label.getLabels', compact('type'));
* @throws \internalApi\base\ClientException }
*/
public static function getLabels($type = null)
{
return self::call('label.getLabels', compact('type'));
}
/** /**
* 标签分类 * 标签分类
*
* @param array $labels 标签 * @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 * @return array
* @throws \internalApi\base\ApiException * @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException * @throws \internalApi\base\ClientException
*/ */
public static function getListByLabels($labels, $types = [2, 3, 5, 6]) 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'));
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