Active.php 915 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\common\model\sharp;
  10. use app\common\model\BaseModel;
  11. /**
  12. * 整点秒杀-活动会场模型
  13. * Class Active
  14. * @package app\common\model\sharp
  15. */
  16. class Active extends BaseModel
  17. {
  18. protected $name = 'sharp_active';
  19. /**
  20. * 关联活动场次表
  21. * @return \think\model\relation\HasMany
  22. */
  23. public function activeTime()
  24. {
  25. return $this->hasMany('ActiveTime', 'active_id')
  26. ->order(['active_time' => 'asc']);
  27. }
  28. /**
  29. * 活动会场详情
  30. * @param $activeId
  31. * @param array $with
  32. * @return static|null
  33. * @throws \think\exception\DbException
  34. */
  35. public static function detail($activeId, $with = [])
  36. {
  37. return static::get($activeId, $with);
  38. }
  39. }