CustomerLog.php 670 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App;
  3. use App\Traits\ModelTimeFormat;
  4. use Illuminate\Database\Eloquent\Model;
  5. use App\Traits\LogModelChanging;
  6. class CustomerLog extends Model
  7. {
  8. use LogModelChanging;
  9. use ModelTimeFormat;
  10. protected $fillable = ['customer_id', 'customer_log_status_id', 'user_id', 'description'];
  11. protected $guarded = ['id'];
  12. public function status()
  13. { //状态
  14. return $this->belongsTo(CustomerLogStatus::class,"customer_log_status_id","id");
  15. }
  16. public function user()
  17. {
  18. return $this->belongsTo(User::class);
  19. }
  20. public function customer()
  21. {
  22. return $this->belongsTo(Customer::class);
  23. }
  24. }