Rejected.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * @method static Builder orderBy(string $string, string $string1)
  7. */use App\Traits\ModelTimeFormat;
  8. class Rejected extends Model
  9. {
  10. use ModelTimeFormat;
  11. protected $fillable=['id_owner','order_number','sender','mobile_sender',
  12. 'logistic_number','logistic_number_return','id_logistic_return',
  13. 'validity_at','batch_number','id_quality_label','amount','name_goods',
  14. 'barcode_goods','is_loaded','fee_collected','id_logistic_return','remark','is_checked','created_at','goodses'];
  15. function owner(){
  16. return $this->hasOne('App\Owner','id','id_owner');
  17. }
  18. function logistic(){
  19. return $this->hasOne('App\Logistic','id','id_logistic_return');
  20. }
  21. function logisticName(){
  22. $logistic=$this->hasOne('App\Logistic','id','id_logistic_return')->first();
  23. return $logistic?$logistic['name']:'';
  24. }
  25. function qualityLabel(){
  26. return $this->hasOne('App\QualityLabel','id','id_quality_label');
  27. }
  28. function qualityLabelName(){
  29. $qualityLabel=$this->hasOne('App\QualityLabel','id','id_quality_label')->first();
  30. return $qualityLabel?$qualityLabel['name']:'';
  31. }
  32. }