<?php
 namespace Module\Vendor\Sms; use ModStart\Core\Type\BaseType; class SmsSender implements BaseType { const SOFT_API = 'softApi'; const ALIYUN = 'aliyun'; const JUHE = 'juhe'; public static function getList($filter = null) { $list = [ self::SOFT_API => '通用接口', self::ALIYUN => '阿里云', self::JUHE => '聚合', ]; if (null === $filter) { return $list; } if (!is_array($filter)) { $filter = [$filter]; } $filterList = []; foreach ($list as $k => $v) { if (in_array($k, $filter)) { $filterList[$k] = $v; } } return $filterList; } }