海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
702 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. use Illuminate\Database\Eloquent\Model;
  6. class Demand extends BaseModel
  7. {
  8. use HasDateTimeFormatter;
  9. use SoftDeletes;
  10. protected $table = 'demand';
  11. public function publisher()
  12. {
  13. return $this->morphTo();
  14. }
  15. public function biddingUser()
  16. {
  17. return $this->morphTo();
  18. }
  19. public function product()
  20. {
  21. return $this->hasOne(Product::class, 'id', 'product_id');
  22. }
  23. public function agentproduct()
  24. {
  25. return $this->hasOne(AgentProduct::class, 'id', 'agent_product_id');
  26. }
  27. public function bidding()
  28. {
  29. return $this->hasOne(DemandBidding::class,'id','bidding_id');
  30. }
  31. }