Storage.php 692 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. class Storage extends Model
  6. {
  7. use ModelLogChanging;
  8. protected $fillable = [
  9. "station_id",
  10. "material_box_id",
  11. "commodity_id",
  12. "amount",
  13. "status"
  14. ];
  15. const STATUS=[
  16. 0 => "正常",
  17. 1 => "占用",
  18. ];
  19. public function station()
  20. { //货架
  21. return $this->belongsTo(Station::class);
  22. }
  23. public function materialBox()
  24. { //料箱
  25. return $this->belongsTo(MaterialBox::class);
  26. }
  27. public function commodity()
  28. { //商品
  29. return $this->belongsTo(Commodity::class);
  30. }
  31. }