123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Repositories;
- use App\Services\TencentImMessage;
- use Dcat\Admin\Grid;
- use Dcat\Admin\Repositories\Repository;
- use Illuminate\Pagination\LengthAwarePaginator;
- use App\Models\FeedComment as FeedCommentModel;
- class FeedComment extends Repository
- {
- public $feed_id;
- public function __construct($id)
- {
- $this->feed_id = $id;
- }
- /**
- * 查询表格数据
- *
- * @param Grid\Model $model
- * @return LengthAwarePaginator
- */
- public function get(Grid\Model $model)
- {
- $currentPage = $model->getCurrentPage();
- $perPage = $model->getPerPage();
- $data =FeedCommentModel::query()
- ->where(['feed_id'=>$this->feed_id])
- // ->where($model->filter())
- ->with(['user:id,name,avatar','to_user:id,name,avatar'])
- ->paginate();
- return $data;
- return $model->makePaginator($res['MsgCnt'],$res['MsgList']);
- }
- }
|