Rejected.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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. */
  8. class Rejected extends Model
  9. {
  10. protected $fillable=['id_owner','order_number','sender','mobile_sender',
  11. 'logistic_number','logistic_number_return','id_logistic_return',
  12. 'validity_at','batch_number','id_quality_label','amount','name_goods',
  13. 'barcode_goods','is_loaded','fee_collected','id_logistic_return','remark','is_checked','created_at','goodses'];
  14. function owner(){
  15. return $this->hasOne('App\Owner','id','id_owner');
  16. }
  17. function logistic(){
  18. return $this->hasOne('App\Logistic','id','id_logistic_return');
  19. }
  20. function logisticName(){
  21. $logistic=$this->hasOne('App\Logistic','id','id_logistic_return')->first();
  22. return $logistic?$logistic['name']:'';
  23. }
  24. function qualityLabel(){
  25. return $this->hasOne('App\QualityLabel','id','id_quality_label');
  26. }
  27. function qualityLabelName(){
  28. $qualityLabel=$this->hasOne('App\QualityLabel','id','id_quality_label')->first();
  29. return $qualityLabel?$qualityLabel['name']:'';
  30. }
  31. }