RichText.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: weifeng
  5. * Date: 2021-04-19
  6. * Time: 18:53
  7. *
  8. * .--, .--,
  9. * ( ( \.---./ ) )
  10. * '.__/o o\__.'
  11. * {= ^ =}
  12. * > - <
  13. * / \
  14. * // \\
  15. * //| . |\\
  16. * "'\ /'"_.-~^`'-.
  17. * \ _ /--' `
  18. * ___)( )(___
  19. * (((__) (__))) 梦之所想,心之所向.
  20. */
  21. namespace app\common\facades;
  22. use app\common\models\RichTextModel;
  23. use Illuminate\Support\Facades\Facade;
  24. class RichText extends Facade
  25. {
  26. public static $uniqueAccountId = 0;
  27. private static $instance;
  28. protected static function getFacadeAccessor()
  29. {
  30. return 'richText';
  31. }
  32. public static function getInstance()
  33. {
  34. if (is_null(self::$instance)) {
  35. self::$instance = new RichTextModel();
  36. }
  37. return self::$instance;
  38. }
  39. public static function set($key, $value = null)
  40. {
  41. return self::getInstance()->setValue(self::$uniqueAccountId, $key, $value);
  42. }
  43. public static function get($key, $default = null)
  44. {
  45. return self::getInstance()->getValue(self::$uniqueAccountId, $key, $default);
  46. }
  47. }