DemandProcess.php 556 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace App;
  3. use App\Traits\ModelLogChanging;
  4. use App\Traits\ModelTimeFormat;
  5. use Illuminate\Database\Eloquent\Model;
  6. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  7. class DemandProcess extends Model
  8. {
  9. use ModelLogChanging;
  10. use ModelTimeFormat;
  11. protected $fillable = ['demand_id', 'processor', 'explain'];
  12. public function demand(): BelongsTo
  13. {
  14. return $this->belongsTo(Demand::class);
  15. }
  16. public function user(): BelongsTo
  17. {
  18. return $this->belongsTo(User::class, 'processor', 'id');
  19. }
  20. }