CustomerLog.php 609 B

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