海南旅游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.

35 lines
683 B

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. class IndustryOrder extends BaseModel
  6. {
  7. use HasDateTimeFormatter;
  8. use SoftDeletes;
  9. protected $casts = ['info' => 'json'];
  10. protected $guarded = ['id'];
  11. public function supplier()
  12. {
  13. return $this->belongsTo(Supplier::class)->withTrashed();
  14. }
  15. public function agent()
  16. {
  17. return $this->belongsTo(Agent::class)->withTrashed();
  18. }
  19. public function industryProduct()
  20. {
  21. return $this->belongsTo(IndustryProduct::class);
  22. }
  23. public function spec()
  24. {
  25. return $this->hasOne(IndustryProductSpec::class, 'id', 'industry_product_spec_id');
  26. }
  27. }