Quellcode durchsuchen

Merge branch 'master' of http://git.9026.com/roobe/miao.git

Ben vor 8 Jahren
Ursprung
Commit
bae01e46e3

+ 32 - 13
miaomiao/www/js/controllers/my.js

xqd
@@ -74,29 +74,48 @@
                 });
             };
             $scope.$on('$ionicView.beforeEnter', function () {
-
+                msg.loading();
+                myService.myIndex().then(function(result){
+                  // alert(JSON.stringify(result.data.data.user));
+                  $scope.vm = result.data.data.user;
+                  if($scope.vm.birthday){
+                      var arr1 = $scope.vm.birthday.split("-");  
+                      $scope.vm.birthday1 = new Date(arr1[0],parseInt(arr1[1])-1,arr1[2]); 
+                  }
+                  msg.hide();
+                },function(error){
+                  msg.hide();
+                  msg.error(error.data.message);
+                })
             });
-            $scope.vm={
-                //pic:"",
-                sex:"",
-                signture:"",
-                emotion:"",
-                job:"",
-                tall:""
-            };
+            // $scope.vm={
+            //     //pic:"",
+            //     sex:"1",
+            //     signture:"",
+            //     emotion:"1",
+            //     job:"",
+            //     tall:""
+            // };
             $scope.saveMaterial = function(){
                 var data = {
-                    pic:['http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg'],
+                    pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
                     sex:$scope.vm.sex,
                     signture:$scope.vm.signture,
                     emotion:$scope.vm.emotion,
                     job:$scope.vm.job,
-                    tall:$scope.vm.tall
+                    tall:$scope.vm.tall,
+                    city:$scope.vm.city
+                }
+                if($scope.vm.birthday1){
+                    data.birthday = $filter('date')($scope.vm.birthday1, "yyyy-MM-dd");
                 }
+                msg.loading('提交中...');
                 myService.saveMaterial(data).then(function(result){
-
+                  msg.hide();
+                  msg.success("保存成功!");
                 },function(error){
-
+                  msg.hide();
+                  msg.error(error.data.message);
                 })
             }
         }]);

+ 16 - 7
miaomiao/www/templates/my/my-profile.html

xqd xqd xqd
@@ -10,16 +10,16 @@
              <span class="fl">
                  绑定手机 
              </span>
-             <i style="float:right" class="ng-binding">159****0809</i>
+             <i style="float:right" class="ng-binding">{{vm.tel}}</i>
          </div>
 
          <label class="item item-input item-select item-select-width">
              <span class="input-label">
                  性别
              </span>
-             <select name="sex" ng-model="vm.sex">
-                 <option>男</option>
-                 <option>女</option>
+             <select name="sex" ng-model="vm.sex+''">
+                 <option value="1">男</option>
+                 <option value="2">女</option>
              </select>
          </label>
          <label class="item item-input ">
@@ -30,9 +30,10 @@
              <span class="input-label">
                  情感状态
              </span>
-             <select name="emotion" ng-model="vm.emotion">
-                 <option>未婚</option>
-                 <option>已婚</option>
+             <select name="emotion" ng-model="vm.emotion+''">
+                 <option value="1">未婚</option>
+                 <option value="2">已婚</option>
+                 <option value="3">离异</option>
              </select>
          </label>
 
@@ -44,6 +45,14 @@
              <span class="input-label">身高</span>
              <input name="tail" type="text" placeholder="请输入(单位cm)" ng-model="vm.tall">
          </label>
+         <label class="item item-input ">
+             <span class="input-label">所在城市</span>
+             <input name="tail" type="text" placeholder="请输入" ng-model="vm.city">
+         </label>
+        <label class="item item-input">
+            <em class="fl">出生日期</em>
+            <input type="date" style="text-align: right"  placeholder="出生日期" ng-model="vm.birthday1" >
+        </label>
      </div>
         <div class="padding">
             <button class="button button-full button-calm" ng-click="saveMaterial()">

+ 0 - 149
server/app/Http/Controllers/Api/V1/AuthController.php

xqd xqd
@@ -218,62 +218,6 @@ class AuthController extends Controller
         ]);
     }
 
-    /**
-     * @api {post} /api/auth/password 设置密码(password)
-     * @apiDescription 上传头像(password)
-     * @apiGroup Auth
-     * @apiPermission Passport
-     * @apiVersion 0.1.0
-     * @apiParam {String} password 密码
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * {
-     *     "state": true,
-     *     "code": 0,
-     *     "message": "",
-     *     "data": {
-     *         "result": true,
-     *     }
-     * }
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * {
-     *     "state": false,
-     *     "code": 1000,
-     *     "message": "传入参数不正确",
-     *     "data": null or []
-     * }
-     * 可能出现的错误代码:
-     *    200     SAVE_USER_FAILED                保存用户数据失败
-     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
-     */
-    public function setPassword(Request $request) {
-        $validator = Validator::make($request->input(),
-            [
-                'password'      => 'required|between:6,16',
-            ],
-            [
-                'password.required'     => '请输入密码',
-                'password.between'      => '密码长度6~16位',
-            ]
-        );
-
-        if ($validator->fails()) {
-            return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-        }
-
-        $pass = $request->get('password');
-
-        $user = Auth::user();
-        $user->password = bcrypt($pass);
-        if (!$user->save()) {
-            return $this->error(ErrorCode::SAVE_USER_FAILED);
-        }
-
-        return $this->api([
-            'result'    => true,
-        ]);
-    }
 
     public function isLogin()
     {
@@ -285,99 +229,6 @@ class AuthController extends Controller
         ]);
     }
 
-    public function check_password(Request $request)
-    {
-        $password = Auth::user()->password;
-
-        if(!Hash::check($request->oldpassword,$password)) return $this->error(ErrorCode::CHECK_OLDPASSWORD_FAILED);
-
-        return $this->api(null,0,'验证通过');
-    }
-
-    /**
-     * @api {post} /api/auth/reset 找回密码(reset)
-     * @apiDescription 找回密码(reset)
-     * @apiGroup Auth
-     * @apiPermission none
-     * @apiVersion 0.1.0
-     * @apiParam {Phone}  phone   手机
-     * @apiParam {int} type 帐户类型:1.个人,2.商户
-     * @apiParam {String} verify_code 手机验证码
-     * @apiParam {String} password   password
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * {
-     *     "state": true,
-     *     "code": 0,
-     *     "message": "",
-     *     "data": {
-     *         "result": true,
-     *     }
-     * }
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * {
-     *     "state": false,
-     *     "code": 1000,
-     *     "message": "传入参数不正确",
-     *     "data": null or []
-     * }
-     * 可能出现的错误代码:
-     *    200     SAVE_USER_FAILED                保存用户数据失败
-     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
-     *    1101    INCORRECT_VERIFY_CODE           输入验证码错误
-     *    1105    USER_DOES_NOT_EXIST             用户不存在
-     */
-    public function reset(Request $request) {
-        $validator = Validator::make($request->all(),
-            [
-                'phone'         => 'required|regex:/^1[34578]\d{9}$/',
-                'verify_code'    => 'required',
-                'password'      => 'required|between:6,16',
-            ],
-            [
-                'phone.required'        => '手机号码必填',
-                'phone.regex'           => '手机号码格式不正确',
-                'verify_code.required'   => '请输入校验码',
-                'password.required'     => '请输入密码',
-                'password.between'      => '密码长度6~16位',
-            ]
-        );
-
-        if ($validator->fails()) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '', $validator->messages());
-        }
-
-        $phone = $request->get('phone');
-        $verify_code = $request->get('verify_code');
-        $pass = $request->get('password');
-
-        $key = $this->keySmsCode . $phone;
-//        if (Redis::exists($key)) {
-        if (Cache::store('file')->has($key)) {
-//            $code = Redis::get($key);
-            $code = Cache::store('file')->get($key);
-            if ($code == $verify_code) {
-                $user = User::where([
-                    'phone'     => $phone,
-                ])->first();
-
-                if (!$user) {
-                    return $this->error(ErrorCode::USER_DOES_NOT_EXIST);
-                }
-
-                //$password = app('hash')->make($request->get('password'));
-                $user->password = bcrypt($pass);
-                if (!$user->save()) {
-                    return $this->error(ErrorCode::SAVE_USER_FAILED);
-                }
-                Cache::store('file')->forget($key);
-
-                return $this->api(['result' => true]);
-            }
-        }
-        return $this->error(ErrorCode::INCORRECT_VERIFY_CODE);
-    }
 
 
 }

+ 3 - 3
server/app/Http/Controllers/Api/V1/HomeController.php

xqd xqd
@@ -61,8 +61,8 @@ class HomeController extends Controller
     public function index(Request $request)
     {
         $user_id = $request->user_id;
-        $care = UserCareUser::where('user_id',$user_id)->get();
-        $fens = UserCareUser::where('other_user_id',$user_id)->get();
+        $care = UserCareUser::where('user_id',$user_id)->paginate(20);
+        $fens = UserCareUser::where('other_user_id',$user_id)->paginate(20);
         $user = UserInfoModel::find($user_id);
         if (count($user == 0)) return $this->error(ErrorCode::USER_DOES_NOT_EXIST);
         $job = BaseSettingsModel::where(['category' => 'job'])->where(['key' => $user->job])->first();
@@ -73,7 +73,7 @@ class HomeController extends Controller
         $near_dream_id = UserDream::where('user_id',$user_id)->orderBy('id','desc')->first()->dream_id;
         $near_dream =DreamInfoModel::find($near_dream_id);
 //         封面图片
-        $near_dream_pic = DreamImages::where('dream_id',$near_dream_id)->select('pic')->get();
+        $near_dream_pic = DreamImages::where('dream_id',$near_dream_id)->select('pic')->paginate(20);
 //        曾经的梦想
         $dreams = $user->UserDream;
 

+ 92 - 73
server/app/Http/Controllers/Api/V1/IndexController.php

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -18,6 +18,7 @@ class IndexController extends Controller
      * @apiGroup Index
      * @apiPermission none
      * @apiVersion 0.1.0
+     * @apiParam {int}      [page=1]            页码(分页参数)
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
      *{
@@ -26,7 +27,7 @@ class IndexController extends Controller
      *"message": "",
      *"data": {
      *      "banner": [],  轮播图
-     *      "other_user": [          动态用户
+     *      "users": [          动态用户
      *                    'news_num':2    新消息数目
      * ],
      *      "dreams": [
@@ -59,17 +60,17 @@ class IndexController extends Controller
         $banner = $this->getBanner();
 //        关注的用户
         $arr =  $user->UserCareUser;
-        $other_user = [] ;
+        $users = [] ;
         foreach ($arr as $k => $v){
             if ($v->pivot->dream_num > 0) {
                 $v->news_num = $v->pivot->dream_num;
-                $other_user[] = $v;
+                $users[] = $v;
             }
         }
 //        获取其他用户信息 及梦想
-        $dreams = DreamInfoModel::orderBy('score','desc')->limit(20)->get();
+        $dreams = DreamInfoModel::orderBy('score','desc')->limit(20)->paginate(20);
         $this->dreams($dreams);
-        return $this->api(compact('banner','other_user','dreams'));
+        return $this->api(compact('banner','users','dreams'));
     }
 
     /**
@@ -85,7 +86,7 @@ class IndexController extends Controller
      *"status_code": 0,
      *"message": "",
      *"data": {
-     *      "other_user": [   动态用户
+     *      "users": [   动态用户
      *               'news_num':2    新消息数目
      * ],
      *      "dreams": [
@@ -116,17 +117,18 @@ class IndexController extends Controller
         $user = $this->getUser();
 //        关注的用户
         $arr =  $user->UserCareUser;
-        $other_user = [] ;
+        $users = [] ;
+
         foreach ($arr as $k => $v){
             if ($v->pivot->dream_num > 0) {
                 $v->news_num = $v->pivot->dream_num;
-                $other_user[] = $v;
+                $users[] = $v;
             }
         }
 //        获取其他用户信息 及梦想
-        $dreams = DreamInfoModel::orderBy('score','desc')->offset(20)->limit(100)->get();
+        $dreams = DreamInfoModel::orderBy('score','desc')->offset(20)->limit(100)->paginate(20);
         $this->dreams($dreams);
-        return $this->api(compact('other_user','dreams'));
+        return $this->api(compact('users','dreams'));
     }
 
     /**
@@ -142,7 +144,7 @@ class IndexController extends Controller
      *"status_code": 0,
      *"message": "",
      *"data": {
-     *      "other_user": [
+     *      "users": [
      *          'news_num':2    新消息数目
      * ],  动态用户
      *      "dreams": [
@@ -173,17 +175,17 @@ class IndexController extends Controller
         $user = $this->getUser();
 //        关注的用户
         $arr =  $user->UserCareUser;
-        $other_user = [] ;
+        $users = [] ;
         foreach ($arr as $k => $v){
             if ($v->pivot->dream_num > 0) {
                 $v->news_num = $v->pivot->dream_num;
-                $other_user[] = $v;
+                $users[] = $v;
             }
         }
 //        获取其他用户信息 及梦想
-        $dreams = DreamInfoModel::orderBy('score','desc')->offset(100)->limit(500)->get();
+        $dreams = DreamInfoModel::orderBy('score','desc')->offset(100)->limit(500)->paginate(20);
         $this->dreams($dreams);
-        return $this->api(compact('other_user','dreams'));
+        return $this->api(compact('$users','dreams'));
     }
 
     /**
@@ -235,15 +237,15 @@ class IndexController extends Controller
     {
         $user = $this->getUser();
         $keyword ='%'.$request->keyword.'%';
-        $data1 = UserInfoModel::where('nickname','like',$keyword)->get();
+        $data1 = UserInfoModel::where('nickname','like',$keyword)->paginate(20);
         $data2 = DreamInfoModel::where('dream','like',$keyword)->
-            orWhere('dream','like',$keyword)->get();
-        $data3  = BaseSettingsModel::where('category','sign')->where('value','like',$keyword)->get();
+            orWhere('dream','like',$keyword)->paginate(20);
+        $data3  = BaseSettingsModel::where('category','sign')->where('value','like',$keyword)->paginate(20);
         if (empty($request->keyword)) {
 //            历史搜索
-                $data1  = $user->search()->orderBy('id','desc')->limit(10)->get();
+                $data1  = $user->search()->orderBy('id','desc')->limit(10)->paginate(20);
 //            热门搜索
-                $data2 = SearchInfoModel::get();
+                $data2 = SearchInfoModel::paginate(20);
                 $arr = [];
                 foreach ($data2 as $k => $v) {
                     if (count($arr) == 8) {
@@ -292,7 +294,7 @@ class IndexController extends Controller
             return $this->api('');
         }
         $keyword ='%'.$request->keyword.'%';
-        $data1 = UserInfoModel::where('nickname','like',$keyword)->get();
+        $data1 = UserInfoModel::where('nickname','like',$keyword)->paginate(20);
           return $this->api(compact('data1'));
     }
 
@@ -305,24 +307,24 @@ class IndexController extends Controller
      * @apiParam {string}  keyword   关键字
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
-    {
-        "status": true,
-        "status_code": 0,
-        "message": "",
-        "data": {
-            "data": [
-                {
-                    "dream": "haha",  梦想名
-                    "user_pic": [
-                    {
-                        "pic": "",   用户头像
-                    }
-                    ],
-                    "dream_img": "",  梦想图片
-                }
-            ]
-        }
-    }
+     *{
+     *   "status": true,
+     *   "status_code": 0,
+     *   "message": "",
+     *   "data": {
+     *       "data": [
+     *           {
+     *              "dream": "haha",  梦想名
+     *               "user_pic": [
+     *               {
+     *                  "pic": "",   用户头像
+     *               }
+     *               ],
+     *              "dream_img": "",  梦想图片
+     *          }
+     *       ]
+     *   }
+     *}
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
      */
@@ -333,7 +335,7 @@ class IndexController extends Controller
         }
         $keyword ='%'.$request->keyword.'%';
         $data = DreamInfoModel::where('dream','like',$keyword)->
-        orWhere('dream','like',$keyword)->get();
+        orWhere('dream','like',$keyword)->paginate(20);
         foreach ($data as $k => $value) {
             $value->user_pic = $value->dreamFindUser;
             $value->dream_img = $value->dreamImgsFirst->pic;
@@ -356,7 +358,7 @@ class IndexController extends Controller
             $dream->dream_find_user =  $dream->dreamFindUser;
 //            计算被关注总人数
             $user_id = UserDream::where('dream_id',$dream->id)->first()->user_id;
-            $data = UserCareUser::where('other_user_id',$user_id)->get();
+            $data = UserCareUser::where('other_user_id',$user_id)->paginate(20);
             $dream->care_num = count($data);
             $dream->dream_first_pic =  $dream->dreamImgsFirst;
         }
@@ -371,37 +373,46 @@ class IndexController extends Controller
      * @apiParam {int}  id   被点击用户ID
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
-    {
-        "status": true,
-        "status_code": 0,
-        "message": "",
-        "data": [
-            {
-                "id": 12,
-                "dream": "123",
-                "about": "124",
-                "sign": null,
-                "videos": "234",
-                "money": 2345,
-                "time": 0,       倒计时 s
-                "get_money": 0,
-                "mark": 0,
-                "status": 0,
-                "score": 3,
-                "created_at": "2017-06-15 08:46:52",
-                "updated_at": "2017-06-15 08:46:52",
-                "deleted_at": null,
-                "imgs": [
-                    {
-                        "id": 8,
-                        "dream_id": 12,
-                        "title": "",
-                        "pic": "....png",   梦想图片
-                    },
-                ],
-            }
-        ]
-    }
+     *{
+     *   "status": true,
+     *   "status_code": 0,
+     *  "message": "",
+     *   "data": [
+     *       {
+     *          "dream": "1的梦想",
+     *          "about": "介绍",
+     *          "video": "",
+     *          "time": 0,
+     *           "status": 0,
+     *          "updated_at": null,
+     *           "dream_imgs": [
+     *              {
+     *                  "title": "1",    梦想图片介绍
+     *                  "pic": "111",    梦想图片
+     *              },
+     *          ],
+     *           "comments": [
+     *              {
+     *                  "user_id": 2,
+     *                  "level": 0,
+     *                  "content": "评论内容",       评论内容
+     *                  "updated_at": null,
+     *                  "pic": "",         评论者头像
+     *                  "replay": [
+     *                       {
+     *                          "level": 0,
+     *                          "content": "回复内容",   回复内容
+     *                          "updated_at": null,
+     *                          "pic": ""               回复者头像
+     *                      }
+     *                  ]
+     *              }
+     *          ],
+     *          }
+     *          ]
+     *     }
+     *   ]
+     *}
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
      */
@@ -414,7 +425,15 @@ class IndexController extends Controller
         UserCareUser::where('user_id',$user->id)->where('other_user_id',$other_id)->update(['dream_num'=>0]);
         $data = UserInfoModel::find($other_id)->UserDream;
         foreach ($data as $item) {
-            $item->imgs =  $item->dreamImgs ;
+            $item->dream_imgs =  $item->dreamImgs ;
+            $item->comments = $item->DreamInfo;
+            foreach ( $item->comments as $k => $v){
+                $v->pic =  UserInfoModel::find($v->user_id)->pic;
+                $v->replay = $v->replay;
+                foreach ($v->replay as $k1 => $v1){
+                    $v1->pic =  UserInfoModel::find($v1->user_id)->pic;
+                }
+            }
         }
         return $this->api($data);
     }

+ 32 - 38
server/app/Http/Controllers/Api/V1/MyController.php

xqd xqd xqd xqd xqd xqd xqd
@@ -132,22 +132,32 @@ class MyController extends Controller
      *  "status": true,
      *   "status_code": 0,
      *   "message": "",
-     *   "data": {
-     *       "emotion": [
-     *          {
-     *              "value": "1",
-     *              "name": "未婚"
-     *          },
-     *          ...
-     *      ],
-     *      "sex": [
-     *          {
-     *              "value": "0",
-     *              "name": "男"
-     *           },
-     *          ...
-     *      ]
-     *   }
+        "data": {
+            "emotion": [
+                {
+                    "value": "1",
+                    "name": "未婚"
+                },
+                {
+                    "value": "2",
+                    "name": "已婚"
+                },
+                {
+                    "value": "3",
+                    "name": "离异"
+                }
+            ],
+            "sex": [
+                {
+                    "value": "0",
+                    "name": "男"
+                },
+                {
+                    "value": "1",
+                    "name": "女"
+                }
+            ]
+        }
      * }
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
@@ -161,9 +171,9 @@ class MyController extends Controller
     public function  editUserInfo (Request $request)
     {
         $sex = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
-             where('dictionary_code','sex')->get();
+             where('dictionary_code','sex')->paginate(20);
         $emotion = BaseDictionaryOptionModel::where('dictionary_table_code','user_info')->
-             where('dictionary_code','emotion')->get();
+             where('dictionary_code','emotion')->paginate(20);
 
         return $this->api(compact('emotion','sex'));
 
@@ -203,7 +213,7 @@ class MyController extends Controller
         $user = $this->getUser();
         $data = $request->except('_token');
         $ok =  $user->update($data);
-        if ($ok) {
+        if ($ok == true) {
             return $this->api('');
         }else{
             return $this->error(ErrorCode::SAVE_USER_FAILED);
@@ -394,7 +404,7 @@ class MyController extends Controller
      *           "id": 2,
      *            "dream": "去旅游去旅游2",
      *           "about": "欧冠胡234",
-     *            "dream_pic": "aaaaa",
+     *            "dream_pic": "aaaaa",      封面图片
      *            "progress": 0,  进度
      *        ]
      *     }
@@ -525,7 +535,7 @@ class MyController extends Controller
 
         if ($dream_id) {
 //            梦想创建成功 关联关系中最新动态+1
-            $info = UserCareUser::where('other_user_id',$user->id)->get();
+            $info = UserCareUser::where('other_user_id',$user->id)->paginate(20);
             foreach ($info as $item) {
                 $item->dream_num += 1;
                 $item->updated_at = date('Y-m-d H:i:s');
@@ -538,7 +548,7 @@ class MyController extends Controller
             $data1['updated_at'] = date('Y-m-d H:i:s');
             $arr = $request->pics;
             $video = $request->video;
-//            if (empty($arr) && empty($video))   return $this->error(ErrorCode::ATTACHMENT_NOT_EXIST);
+            if (empty($arr) && empty($video))   return $this->error(ErrorCode::ATTACHMENT_NOT_EXIST);
             $ok = UserDream::create($data1);
             $arr1 = [];
             if ($ok) {
@@ -563,20 +573,4 @@ class MyController extends Controller
         }
     }
 
-    /**
-     * @api {get} /api/my/dream_about 梦想介绍(dreamAbout)
-     * @apiDescription 梦想介绍(dreamAbout)
-     * @apiGroup My
-     * @apiPermission Passport
-     * @apiVersion 0.1.0
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     */
-    public function dreamAbout()
-    {
-        $user = $this->getUser();
-        return $this->api(compact('user'));
-    }
 }

+ 7 - 0
server/app/Models/CommentInfoModel.php

xqd xqd
@@ -13,6 +13,8 @@ class CommentInfoModel extends Model
         'level',
         'content',
     ];
+    protected $hidden = ['dream_id','created_at','deleted_at','id'];
+
 
     public function CommentUser()
     {
@@ -23,4 +25,9 @@ class CommentInfoModel extends Model
     {
         return $this->hasOne('App\Models\DreamInfoModel','id','dream_id');
     }
+
+    public function replay()
+    {
+        return $this->hasMany('App\Models\ReplyCommentsInfo','comment_id','id');
+    }
 }

+ 1 - 0
server/app/Models/DreamImages.php

xqd
@@ -8,4 +8,5 @@ class DreamImages extends Model
 {
     protected $table = 'dream_images';
     protected $fillable = ['dream_id','title','pic'];
+    protected $hidden = ['dream_id','created_at','updated_at','deleted_at','id'];
 }

+ 3 - 0
server/app/Models/DreamInfoModel.php

xqd
@@ -40,6 +40,9 @@ class DreamInfoModel extends BaseModel
                            'status'
                           ];
 
+    protected $hidden = ['score','created_at','deleted_at','id','sign','money','mark','get_money'];
+
+
     public function dreamUser()
     {
         return $this->belongsToMany('App\Models\UserInfoModel','user_dream','dream_id','user_id');

+ 2 - 0
server/app/Models/ReplyCommentsInfo.php

xqd
@@ -14,5 +14,7 @@ class ReplyCommentsInfo extends Model
         'content',
         'level',
     ] ;
+    protected $hidden = ['comment_id','created_at','deleted_at','id'];
+
 
 }

+ 0 - 4
server/routes/api.php

xqd
@@ -164,10 +164,6 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'my.add_dream',
         'uses' => 'MyController@addDream',
     ]);
-    $api->get('my/dream_about', [
-        'as' => 'my.dream_about',
-        'uses' => 'MyController@dreamAbout',
-    ]);
 
 //    用户信息
     $api->get('user/index', [