BroadcastGoods.php 1.5 KB

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