ReportLog.php 603 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Models;
  3. use Dcat\Admin\Traits\HasDateTimeFormatter;
  4. use Illuminate\Database\Eloquent\Model;
  5. class ReportLog extends Model
  6. {
  7. use HasDateTimeFormatter;
  8. protected $table = 'report_log';
  9. protected $fillable = [
  10. 'user_id',
  11. 'product_id',
  12. 'report_id'
  13. ];
  14. public function user(){
  15. return $this->hasOne(User::class,'id','user_id');
  16. }
  17. public function product(){
  18. return $this->hasOne(Product::class,'id','product_id');
  19. }
  20. public function report(){
  21. return $this->hasOne(Report::class,'id','report_id');
  22. }
  23. }