BroadcastGoods.php 990 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author xaboy
  6. * @day 2020/7/29
  7. *
  8. *
  9. */
  10. namespace app\common\model\store\broadcast;
  11. use app\common\model\BaseModel;
  12. use app\common\model\store\product\Product;
  13. use app\common\model\system\merchant\Merchant;
  14. /**
  15. * Class BroadcastGoods
  16. * @package app\common\model\store\broadcast
  17. * @author xaboy
  18. * @day 2020/7/29
  19. */
  20. class BroadcastGoods 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_goods_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_goods';
  39. }
  40. public function merchant()
  41. {
  42. return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
  43. }
  44. public function product()
  45. {
  46. return $this->hasOne(Product::class, 'product_id', 'product_id');
  47. }
  48. }