WechatReply.php 940 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\common\model\wechat;
  3. use app\common\model\BaseModel;
  4. /**
  5. * Class WechatReply
  6. * @package app\common\model\wechat
  7. * @author zfy
  8. * @day 2020-04-24
  9. */
  10. class WechatReply 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 'wechat_reply_id';
  20. }
  21. /**
  22. * @return string
  23. * @author zfy
  24. * @day 2020-03-30
  25. */
  26. public static function tableName(): string
  27. {
  28. return 'wechat_reply';
  29. }
  30. /**
  31. * @param $val
  32. * @return mixed
  33. * @author zfy
  34. * @day 2020-04-24
  35. */
  36. public function getDataAttr($val)
  37. {
  38. return json_decode($val, true);
  39. }
  40. /**
  41. * @param $val
  42. * @return false|string
  43. * @author zfy
  44. * @day 2020-04-24
  45. */
  46. public function setDataAttr($val)
  47. {
  48. return json_encode($val);
  49. }
  50. }