當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。