WechatReply.php 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author xaboy
  6. * @day 2020-04-24
  7. *
  8. *
  9. */
  10. namespace app\common\model\wechat;
  11. use app\common\model\BaseModel;
  12. /**
  13. * Class WechatReply
  14. * @package app\common\model\wechat
  15. * @author xaboy
  16. * @day 2020-04-24
  17. */
  18. class WechatReply extends BaseModel
  19. {
  20. /**
  21. * @return string
  22. * @author xaboy
  23. * @day 2020-03-30
  24. */
  25. public static function tablePk(): string
  26. {
  27. return 'wechat_reply_id';
  28. }
  29. /**
  30. * @return string
  31. * @author xaboy
  32. * @day 2020-03-30
  33. */
  34. public static function tableName(): string
  35. {
  36. return 'wechat_reply';
  37. }
  38. /**
  39. * @param $val
  40. * @return mixed
  41. * @author xaboy
  42. * @day 2020-04-24
  43. */
  44. public function getDataAttr($val)
  45. {
  46. return json_decode($val, true);
  47. }
  48. /**
  49. * @param $val
  50. * @return false|string
  51. * @author xaboy
  52. * @day 2020-04-24
  53. */
  54. public function setDataAttr($val)
  55. {
  56. return json_encode($val);
  57. }
  58. }