ActivityModel.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 老猫 <thinkcmf@126.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\activity\model;
  12. use think\Model;
  13. use think\model\concern\SoftDelete;
  14. class ActivityModel extends Model
  15. {
  16. use SoftDelete;
  17. protected $type = ['options' => 'array'];
  18. /**
  19. * 状态名
  20. */
  21. public function getStatusTextAttr($value, $data)
  22. {
  23. $status = ['待审核', '通过', '不通过'];
  24. return $status[$data['status'] - 1];
  25. }
  26. public function setStartTimeAttr($value)
  27. {
  28. return strtotime($value);
  29. }
  30. public function setEndTimeAttr($value)
  31. {
  32. return strtotime($value);
  33. }
  34. }