BroadcastRoom.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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\store\broadcast;
  12. use app\common\model\BaseModel;
  13. use app\common\model\system\merchant\Merchant;
  14. /**
  15. * Class BroadcastRoom
  16. * @package app\common\model\store\broadcast
  17. * @author xaboy
  18. * @day 2020/7/29
  19. */
  20. class BroadcastRoom extends BaseModel
  21. {
  22. /**
  23. * @return string|null
  24. * @author xaboy
  25. * @day 2020/7/29
  26. */
  27. public static function tablePk(): ?string
  28. {
  29. return 'broadcast_room_id';
  30. }
  31. /**
  32. * @return string
  33. * @author xaboy
  34. * @day 2020/7/29
  35. */
  36. public static function tableName(): string
  37. {
  38. return 'broadcast_room';
  39. }
  40. public function merchant()
  41. {
  42. return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
  43. }
  44. public function broadcast()
  45. {
  46. return $this->hasMany(BroadcastRoomGoods::class);
  47. }
  48. }