当前位置: 首页>>代码示例>>PHP>>正文


PHP Posts::FetchPosts方法代码示例

本文整理汇总了PHP中app\Posts::FetchPosts方法的典型用法代码示例。如果您正苦于以下问题:PHP Posts::FetchPosts方法的具体用法?PHP Posts::FetchPosts怎么用?PHP Posts::FetchPosts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Posts的用法示例。


在下文中一共展示了Posts::FetchPosts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getUserPosts

 public static function getUserPosts($input)
 {
     $validation = Validator::make($input, Posts::$UserPostsRules);
     if ($validation->fails()) {
         return Response::json(array('status' => '0', 'msg' => $validation->getMessageBag()->first()), 200);
     } else {
         $access_token = $input['token'];
         $other_id = $input['other_id'];
         $current_time = new DateTime();
         $user_id = Users::getUserIdByToken($access_token);
         if ($user_id) {
             $result = Posts::FetchPosts($user_id, $other_id);
             if ($result) {
                 return Response::json(array('status' => '1', 'msg' => 'Post Details', 'result' => $result), 200);
             } else {
                 return Response::json(array('status' => '2', 'msg' => 'No Post Found'), 200);
             }
         } else {
             return Response::json(array('status' => '0', 'msg' => "Token Expired"), 200);
         }
     }
 }
开发者ID:Gameonn,项目名称:connected,代码行数:22,代码来源:Posts.php

示例2: getUserProfile

 public static function getUserProfile($input)
 {
     $validation = Validator::make($input, Posts::$UserPostsRules);
     if ($validation->fails()) {
         return Response::json(array('status' => '0', 'msg' => $validation->getMessageBag()->first()), 200);
     } else {
         $access_token = $input['token'];
         $other_id = $input['other_id'];
         $user_id = Users::getUserIdByToken($access_token);
         if ($user_id) {
             $user_details = Users::LoginTypeResponse($other_id);
             $user_posts = Posts::FetchPosts($user_id, $other_id);
             $friends = Users::GetFollowers($other_id);
             $skillset = Users::Getskillset();
             $user_skillset = Users::GetUserSkills($other_id);
             $follower_data = $friends['followers'];
             $following_data = $friends['following'];
             $profile_setup_status = Users::ProfileSetupStatus($user_id);
             $is_follow_status = Users::getIsFollow($user_id, $other_id);
             if ($user_details) {
                 return Response::json(array('status' => '1', 'msg' => 'User Details', 'profile_complete_status' => $profile_setup_status, 'result' => $user_details, 'user_posts' => $user_posts, 'followers' => $follower_data, 'following' => $following_data, 'all_skillset' => $skillset, 'user_skillset' => $user_skillset, 'is_follow_status' => $is_follow_status), 200);
             } else {
                 return Response::json(array('status' => '0', 'msg' => 'User Not Found'), 200);
             }
         } else {
             return Response::json(array('status' => '0', 'msg' => "Token Expired"), 200);
         }
     }
 }
开发者ID:Gameonn,项目名称:connected,代码行数:29,代码来源:Users.php


注:本文中的app\Posts::FetchPosts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。