| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App;
- use Illuminate\Database\Eloquent\Model;
- use App\Traits\ModelLogChanging;
- class Storage extends Model
- {
- use ModelLogChanging;
- protected $fillable = [
- "station_id",
- "material_box_id",
- "commodity_id",
- "amount",
- "status"
- ];
- const STATUS=[
- 0 => "正常",
- 1 => "占用",
- ];
- public function station()
- { //货架
- return $this->belongsTo(Station::class);
- }
- public function materialBox()
- { //料箱
- return $this->belongsTo(MaterialBox::class);
- }
- public function commodity()
- { //商品
- return $this->belongsTo(Commodity::class);
- }
- }
|