WechatReply.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\common\model\wechat;
  12. use app\common\model\BaseModel;
  13. /**
  14. * Class WechatReply
  15. * @package app\common\model\wechat
  16. * @author xaboy
  17. * @day 2020-04-24
  18. */
  19. class WechatReply extends BaseModel
  20. {
  21. /**
  22. * @return string
  23. * @author xaboy
  24. * @day 2020-03-30
  25. */
  26. public static function tablePk(): string
  27. {
  28. return 'wechat_reply_id';
  29. }
  30. /**
  31. * @return string
  32. * @author xaboy
  33. * @day 2020-03-30
  34. */
  35. public static function tableName(): string
  36. {
  37. return 'wechat_reply';
  38. }
  39. /**
  40. * @param $val
  41. * @return mixed
  42. * @author xaboy
  43. * @day 2020-04-24
  44. */
  45. public function getDataAttr($val)
  46. {
  47. return json_decode($val, true);
  48. }
  49. /**
  50. * @param $val
  51. * @return false|string
  52. * @author xaboy
  53. * @day 2020-04-24
  54. */
  55. public function setDataAttr($val)
  56. {
  57. return json_encode($val);
  58. }
  59. }