ImMessage.php 827 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. class ImMessage extends Repository
  8. {
  9. public $user_id;
  10. public $to_user_id;
  11. public function __construct($id,$id2)
  12. {
  13. $this->user_id = $id;
  14. $this->to_user_id = $id2;
  15. }
  16. /**
  17. * 查询表格数据
  18. *
  19. * @param Grid\Model $model
  20. * @return LengthAwarePaginator
  21. */
  22. public function get(Grid\Model $model)
  23. {
  24. $currentPage = $model->getCurrentPage();
  25. $perPage = $model->getPerPage();
  26. $data =new TencentImMessage();
  27. $res = $data->getroammsg($this->user_id,$this->to_user_id);
  28. return $model->makePaginator($res['MsgCnt'],$res['MsgList']);
  29. }
  30. }