/** * Return wishlist of a user and its followers. * * @author Kuldeep Dangi <*****@*****.**> */ public function actionGetWishlist($id) { $userObj = new Users(); $userModel = $userObj->findByPk($id); $userFeedObj = new UserFeed(); if ($userModel) { $userFollowObj = new UserFollow(); $usersData = $userFollowObj->getUserFollowers($id); $users = array(); foreach ($usersData as $user) { $users[] = $user['id_user']; } $users[] = $id; $wishList = $userFeedObj->getUsersWishlist($users); $wishListCount = count($wishList); if ($wishListCount < 30) { $wishList = $userFeedObj->getTrendingWishlist(30 - $wishListCount); } } else { $wishList = $userFeedObj->getTrendingWishlist(); } $this->result['data'] = $wishList; $this->result['success'] = true; $this->sendResponse($this->result); }