Product.php 800 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\common\model\plus\point;
  3. use app\common\model\BaseModel;
  4. /**
  5. * Class Exchange
  6. * 积分兑换模型
  7. * @package app\common\model\plus\exchange
  8. */
  9. class Product extends BaseModel
  10. {
  11. protected $name = 'point_product';
  12. protected $pk = 'point_product_id';
  13. /**
  14. * 详情
  15. */
  16. public static function detail($point_product_id, $with = [])
  17. {
  18. return (new static())->with($with)->find($point_product_id);
  19. }
  20. /**
  21. *关联商品表
  22. */
  23. public function product()
  24. {
  25. return $this->belongsTo('app\\common\\model\\product\\Product', 'product_id', 'product_id');
  26. }
  27. /**
  28. *关联商品表
  29. */
  30. public function sku()
  31. {
  32. return $this->hasMany('app\\common\\model\\plus\\point\\ProductSku');
  33. }
  34. }