| xqd
@@ -191,8 +191,8 @@ class HomeController extends Controller
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
- * @api {post} /api/home/bank_card/update 更新银行卡
|
|
|
- * @apiDescription 更新银行卡
|
|
|
+ * @api {post} /api/user/interaction 互动
|
|
|
+ * @apiDescription 互动
|
|
|
* @apiGroup home
|
|
|
* @apiPermission Passport
|
|
|
* @apiVersion 0.1.0
|
| xqd
@@ -200,25 +200,113 @@ class HomeController extends Controller
|
|
|
* @apiSuccessExample {json} Success-Response:
|
|
|
* HTTP/1.1 200 OK
|
|
|
* {
|
|
|
- * "state": true,
|
|
|
- * "code": 0,
|
|
|
- * "message": "success",
|
|
|
- * "data": {
|
|
|
- * ....
|
|
|
- * }
|
|
|
+ * *"status": true,
|
|
|
+ * "status_code": 0,
|
|
|
+ *"message": "",
|
|
|
+ * "data": {
|
|
|
+ * 评论的梦想
|
|
|
+ * "dream1": [
|
|
|
+ * {
|
|
|
+ * "dream": "1的梦想",
|
|
|
+ * "about": "介绍",
|
|
|
+ *"pic": [
|
|
|
+ * {
|
|
|
+ * "pic": "111",
|
|
|
+ * }
|
|
|
+ * ],
|
|
|
+ * "user": [
|
|
|
+ *{
|
|
|
+ * "pic": "",
|
|
|
+ *],
|
|
|
+ * "comments": [
|
|
|
+ * {
|
|
|
+ * "level": 0,
|
|
|
+ * "content": "EST",
|
|
|
+ * "created_at": "2017-04-27 12:17:20",
|
|
|
+ * }
|
|
|
+ * ],
|
|
|
+ * * 回复的梦想
|
|
|
+ * "dream2": [
|
|
|
+ * {
|
|
|
+ ** "level": 0,
|
|
|
+ *"content": "EST",
|
|
|
+ * "created_at": "2017-04-27 12:17:20",
|
|
|
+ * "updated_at": null,
|
|
|
+ * "deleted_at": null,
|
|
|
+ * "reply_dream": {
|
|
|
+ * * "dream": "1的梦想",
|
|
|
+ * "about": "介绍",
|
|
|
+ *"time": 0,
|
|
|
+ * "dream_imgs": [
|
|
|
+ * {
|
|
|
+ * "pic": "111",
|
|
|
+ * },
|
|
|
+ * ]
|
|
|
+ * },
|
|
|
+ * "reply_dream_pic": [
|
|
|
+ * {
|
|
|
+ * "pic": "111",
|
|
|
+ * }
|
|
|
+ * ],
|
|
|
+ * "reply_created_at": {
|
|
|
+ * "date": "2017-06-13 02:26:31.000000",
|
|
|
+ * "timezone_type": 3,
|
|
|
+ * "timezone": "UTC"
|
|
|
+ * },
|
|
|
+ * "reply_content": "haha",
|
|
|
+ * "reply_level": 0,
|
|
|
+ * "dream": {
|
|
|
+ * "dream": "1的梦想",
|
|
|
+ * "about": "介绍",
|
|
|
+ * "money": 5000,
|
|
|
+ * "time": 0,
|
|
|
+ * "dream_imgs": [
|
|
|
+ * {
|
|
|
+ * "pic": "111",
|
|
|
+ * },
|
|
|
+ * ]
|
|
|
+ * }
|
|
|
+ * }
|
|
|
+ * ]
|
|
|
+ * }
|
|
|
* }
|
|
|
* @apiErrorExample {json} Error-Response:
|
|
|
*HTTP/1.1 400 Bad Request
|
|
|
* {
|
|
|
- * "state": false,
|
|
|
- * "code": 1000,
|
|
|
- * "message": "传入参数不正确",
|
|
|
- * "data": null or []
|
|
|
+ * "status": false,
|
|
|
+ * "status_code": 1500,
|
|
|
+ * "message": "会员不存在",
|
|
|
+ * "data": null
|
|
|
* }
|
|
|
*/
|
|
|
public function interaction(Request $request)
|
|
|
{
|
|
|
+ $user_id = $request->user_id;
|
|
|
+ $user = UserInfoModel::find($user_id);
|
|
|
+ if (count($user) == 0) return $this->error(ErrorCode::MEMBER_NOT_EXIST);
|
|
|
+// 参与的评论与回复 梦想
|
|
|
+ $dream1 = $user->comDream;
|
|
|
+
|
|
|
+ foreach ($dream1 as $item){
|
|
|
+ $item->pic = $item->dreamImgs;
|
|
|
+ $item->user = $item->dreamUser;
|
|
|
+ $item->comments = $item->DreamInfo;
|
|
|
+ $item->created_at = $item->pivot->created_at;
|
|
|
+ $item->content = $item->pivot->content;
|
|
|
+ $item->level = $item->pivot->level;
|
|
|
+ }
|
|
|
+
|
|
|
+ $dream2 = $user->replyDream;
|
|
|
|
|
|
+ foreach ($dream2 as $comment) {
|
|
|
+ $comment->reply_dream = $comment->dream;
|
|
|
+ $comment->reply_dream_pic = $comment->dream->dreamImgs;
|
|
|
+ $comment->reply_created_at = $comment->pivot->created_at;
|
|
|
+ $comment->reply_content = $comment->pivot->content;
|
|
|
+ $comment->reply_level = $comment->pivot->level;
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->api(compact('dream1','dream2'));
|
|
|
}
|
|
|
/**
|
|
|
* @api {post} /api/home/bank_card/update 更新银行卡
|
| xqd
@@ -248,6 +336,16 @@ class HomeController extends Controller
|
|
|
*/
|
|
|
public function paihang(Request $request)
|
|
|
{
|
|
|
+// 获取支持过用户的人
|
|
|
+ $user_id = $request->user_id;
|
|
|
+ $user = UserInfoModel::find($user_id);
|
|
|
+ if (count($user) == 0) return $this->error(ErrorCode::MEMBER_NOT_EXIST);
|
|
|
+ $dreams = $user->UserDream;
|
|
|
+ $arr = [];
|
|
|
+ foreach ($dreams as $dream) {
|
|
|
+ $arr[] = $dream->systemInfo;
|
|
|
+ }
|
|
|
+ return $arr;
|
|
|
|
|
|
}
|
|
|
}
|