FeedComment.php 952 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace App\Repositories;
  3. use App\Services\TencentImMessage;
  4. use Dcat\Admin\Grid;
  5. use Dcat\Admin\Repositories\Repository;
  6. use Illuminate\Pagination\LengthAwarePaginator;
  7. use App\Models\FeedComment as FeedCommentModel;
  8. class FeedComment extends Repository
  9. {
  10. public $feed_id;
  11. public function __construct($id)
  12. {
  13. $this->feed_id = $id;
  14. }
  15. /**
  16. * 查询表格数据
  17. *
  18. * @param Grid\Model $model
  19. * @return LengthAwarePaginator
  20. */
  21. public function get(Grid\Model $model)
  22. {
  23. $currentPage = $model->getCurrentPage();
  24. $perPage = $model->getPerPage();
  25. $data =FeedCommentModel::query()
  26. ->where(['feed_id'=>$this->feed_id])
  27. // ->where($model->filter())
  28. ->with(['user:id,name,avatar','to_user:id,name,avatar'])
  29. ->paginate();
  30. return $data;
  31. return $model->makePaginator($res['MsgCnt'],$res['MsgList']);
  32. }
  33. }