OperatingTypeEnum.php 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace common\enums;
  3. use yii\helpers\Html;
  4. /**
  5. * 运营类型
  6. *
  7. * Class OperatingTypeEnum
  8. * @package common\enums
  9. */
  10. class OperatingTypeEnum extends BaseEnum
  11. {
  12. const SELF_SUPPORT = 1;
  13. const ENTER = 2;
  14. /**
  15. * @return string[]
  16. */
  17. public static function getMap(): array
  18. {
  19. return [
  20. self::SELF_SUPPORT => '自营',
  21. self::ENTER => '加盟',
  22. ];
  23. }
  24. /**
  25. * @param $key
  26. * @return mixed|string
  27. */
  28. public static function html($key)
  29. {
  30. $html = [
  31. self::SELF_SUPPORT => Html::tag('span', self::getValue(self::SELF_SUPPORT), array_merge(
  32. [
  33. 'class' => "label label-outline-purple",
  34. ]
  35. )),
  36. self::ENTER => Html::tag('span', self::getValue(self::ENTER), array_merge(
  37. [
  38. 'class' => "label label-outline-info",
  39. ]
  40. )),
  41. ];
  42. return $html[$key] ?? '';
  43. }
  44. }
粤ICP备19079148号