Share.php 691 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\admin\controller\shopro;
  3. use app\admin\model\shopro\Share as ShareModel;
  4. class Share extends Common
  5. {
  6. protected $model = null;
  7. public function _initialize()
  8. {
  9. parent::_initialize();
  10. $this->model = new ShareModel();
  11. }
  12. /**
  13. * 查看用户分享记录
  14. */
  15. public function index()
  16. {
  17. $share_id = $this->request->param('id');
  18. $data = ShareModel::with(['user' => function ($query) {
  19. return $query->field(['id', 'nickname', 'avatar']);
  20. }])->where('share_id', $share_id)->sheepFilter()->paginate($this->request->param('list_rows', 8));
  21. $this->success('', null, $data);
  22. }
  23. }