You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

WorkWelcome.php 947B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\model\work;
  3. use crmeb\basic\BaseModel;
  4. use crmeb\traits\ModelTrait;
  5. /**
  6. * Class WorkWelcome
  7. * @package app\model\work
  8. */
  9. class WorkWelcome extends BaseModel
  10. {
  11. use ModelTrait;
  12. /**
  13. * @var string
  14. */
  15. protected $name = 'work_welcome';
  16. /**
  17. * @var string
  18. */
  19. protected $key = 'id';
  20. /**
  21. * @var string
  22. */
  23. protected $autoWriteTimestamp = 'int';
  24. /**
  25. * 成员
  26. * @return \think\model\relation\HasMany
  27. */
  28. public function userList()
  29. {
  30. return $this->hasMany(WorkWelcomeRelation::class, 'welcome_id', 'id');
  31. }
  32. /**
  33. * @param $value
  34. * @return false|string
  35. */
  36. public function setAttachmentsAttr($value)
  37. {
  38. return json_encode($value);
  39. }
  40. /**
  41. * @param $value
  42. * @return mixed
  43. */
  44. public function getAttachmentsAttr($value)
  45. {
  46. return json_decode($value, true);
  47. }
  48. }