MexMatchLogRepository.php 757 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Module\Mex\Repositories;
  3. use App\Module\Mex\Models\MexMatchLog;
  4. use UCore\DcatAdmin\Repository\EloquentRepository;
  5. /**
  6. * 农贸市场撮合日志仓库
  7. *
  8. * 用于后台管理的数据访问层
  9. */
  10. class MexMatchLogRepository extends EloquentRepository
  11. {
  12. /**
  13. * 关联的模型类
  14. *
  15. * @var string
  16. */
  17. protected $eloquentClass = MexMatchLog::class;
  18. /**
  19. * 构造函数,支持预加载关联关系
  20. *
  21. * @param array $with 预加载的关联关系
  22. */
  23. public function __construct(array $with = [])
  24. {
  25. // 默认预加载商品信息
  26. $defaultWith = ['item'];
  27. $relations = array_merge($defaultWith, $with);
  28. parent::__construct($relations);
  29. }
  30. }