StoreCheckingReceiveItem.php 797 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App;
  3. use App\Traits\ModelTimeFormat;
  4. use Illuminate\Database\Eloquent\Model;
  5. use App\Traits\ModelLogChanging;
  6. class StoreCheckingReceiveItem extends Model
  7. {
  8. use ModelLogChanging;
  9. use ModelTimeFormat;
  10. public $timestamps=false;
  11. protected $fillable=[
  12. "store_checking_receive_id","bin_number","commodity_id","imported_amount","counted_amount",
  13. "asn_amount","imported_diff_amount","asn_diff_amount",
  14. "produced_at","invalid_at","batch_code","unique_code"
  15. ];
  16. public function commodity(){
  17. return $this->hasOne('App\Commodity','id','commodity_id')->select('id','name','sku');
  18. }
  19. public function storeCheckingReceive(){
  20. return $this->belongsTo('App\StoreCheckingReceive','store_checking_receive_id','id');
  21. }
  22. }