StoreCouponProduct.php 632 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace app\common\model\store\coupon;
  3. use app\common\model\BaseModel;
  4. use app\common\model\store\product\Product;
  5. class StoreCouponProduct extends BaseModel
  6. {
  7. /**
  8. * @return string
  9. * @author zfy
  10. * @day 2020-03-30
  11. */
  12. public static function tablePk():? string
  13. {
  14. return null;
  15. }
  16. /**
  17. * @return string
  18. * @author zfy
  19. * @day 2020-03-30
  20. */
  21. public static function tableName(): string
  22. {
  23. return 'store_coupon_product';
  24. }
  25. public function product()
  26. {
  27. return $this->hasOne(Product::class, 'product_id', 'product_id');
  28. }
  29. }