WorkChannelCycle.php 1.6 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\model\work;
  12. use crmeb\basic\BaseModel;
  13. use crmeb\traits\ModelTrait;
  14. /**
  15. * 渠道码周期规则
  16. * Class WorkChannelCycle
  17. * @package app\model\work
  18. */
  19. class WorkChannelCycle extends BaseModel
  20. {
  21. use ModelTrait;
  22. /**
  23. * @var string
  24. */
  25. protected $name = 'work_channel_cycle';
  26. /**
  27. * @param $value
  28. * @return mixed
  29. */
  30. public function getWokrTimeAttr($value)
  31. {
  32. return $value ? json_decode($value, true) : [];
  33. }
  34. /**
  35. * @param $value
  36. * @return false|string
  37. */
  38. public function serWokrTimeAttr($value)
  39. {
  40. return json_encode($value);
  41. }
  42. /**
  43. * @param $value
  44. * @return false|string
  45. */
  46. public function setUseridsAttr($value)
  47. {
  48. return json_encode($value);
  49. }
  50. /**
  51. * @param $value
  52. * @return array|mixed
  53. */
  54. public function getUseridsAttr($value)
  55. {
  56. return $value ? json_decode($value, true) : [];
  57. }
  58. }