|
@@ -11,7 +11,7 @@ class Comment extends Common
|
|
protected $noNeedLogin = ['index', 'getType'];
|
|
protected $noNeedLogin = ['index', 'getType'];
|
|
protected $noNeedRight = ['*'];
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
- public function index()
|
|
|
|
|
|
+ public function index()
|
|
{
|
|
{
|
|
$params = $this->request->param();
|
|
$params = $this->request->param();
|
|
$type = $params['type'] ?? 'all';
|
|
$type = $params['type'] ?? 'all';
|
|
@@ -23,12 +23,21 @@ class Comment extends Common
|
|
$comments = $comments->{$type}();
|
|
$comments = $comments->{$type}();
|
|
}
|
|
}
|
|
|
|
|
|
- $comments = $comments->order('id', 'desc')->paginate(request()->param('list_rows', 10));
|
|
|
|
- // ->each(function ($comment) {
|
|
|
|
- // if ($comment->user) {
|
|
|
|
- // $comment->user->nickname_hide = $comment->user->nickname_hide;
|
|
|
|
- // }
|
|
|
|
- // })->toArray();
|
|
|
|
|
|
+ $comments = $comments->order('id', 'desc')
|
|
|
|
+// ->paginate(request()->param('list_rows', 10));
|
|
|
|
+ ->autopage()->select();
|
|
|
|
+ $comments = json_decode(json_encode($comments),true);
|
|
|
|
+ $comments = list_domain_image($comments,['user_avatar']);
|
|
|
|
+ foreach($comments as $key => $val){
|
|
|
|
+ $val['images'] = array_domain_image($val['images']);
|
|
|
|
+
|
|
|
|
+ $comments[$key] = $val;
|
|
|
|
+ }
|
|
|
|
+ // ->each(function ($comment) {
|
|
|
|
+ // if ($comment->user) {
|
|
|
|
+ // $comment->user->nickname_hide = $comment->user->nickname_hide;
|
|
|
|
+ // }
|
|
|
|
+ // })->toArray();
|
|
|
|
|
|
// $data = $comments['data'];
|
|
// $data = $comments['data'];
|
|
// foreach ($data as $key => &$comment) {
|
|
// foreach ($data as $key => &$comment) {
|