SystemConfigValue.php 986 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\common\model\system\config;
  3. use app\common\model\BaseModel;
  4. /**
  5. * Class SystemConfigValue
  6. * @package app\common\model\system\config
  7. * @author zfy
  8. * @day 2020-03-30
  9. */
  10. class SystemConfigValue extends BaseModel
  11. {
  12. /**
  13. * @return string
  14. * @author zfy
  15. * @day 2020-03-30
  16. */
  17. public static function tablePk(): string
  18. {
  19. return 'config_value_id';
  20. }
  21. /**
  22. * @return string
  23. * @author zfy
  24. * @day 2020-03-30
  25. */
  26. public static function tableName(): string
  27. {
  28. return 'system_config_value';
  29. }
  30. /**
  31. * @param $value
  32. * @return mixed
  33. * @author zfy
  34. * @day 2020-03-30
  35. */
  36. public function getValueAttr($value)
  37. {
  38. return json_decode($value, true);
  39. }
  40. /**
  41. * @param $value
  42. * @return false|string
  43. * @author zfy
  44. * @day 2020-03-30
  45. */
  46. public function setValueAttr($value)
  47. {
  48. return json_encode($value);
  49. }
  50. }