gq %!s(int64=7) %!d(string=hai) anos
pai
achega
03fdbad051

+ 1 - 1
server/app/Http/Controllers/Api/V1/Controller.php

xqd
@@ -30,7 +30,7 @@ class Controller extends BaseController
         $this->middleware('auth:api', [
             'except' => [
                 'upload', 'getCode', 'login', 'wechatLogin', 'alipayNotify', 'wechatpayNotify',
-                'download',  'test',
+                'download',  'test','home','reply'
             ]
         ]);
 

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

xqd xqd
@@ -114,6 +114,7 @@ class IndexController extends Controller
     public function home(Request $request)
     {
         $login_user = $this->getUser();
+        $login_user = UserInfoModel::find(1);
         $id = $login_user->id;
         $arr1 =DreamInfoModel::orderBy('score','desc')->limit(30)->select('id')->get()->toArray();
         $id_arr1 = array_column($arr1,'id');
@@ -447,9 +448,9 @@ class IndexController extends Controller
             });
         }
         \Log::info($query->toSql());
-        $arr1 =DreamInfoModel::limit(20)->select('id')->get()->toArray();
+        $arr1 =DreamInfoModel::orderBy('id')->limit(20)->select('id')->get()->toArray();
         $id_arr1 = array_column($arr1,'id');
-        $arr2 =DreamInfoModel::orderBy('score','desc')->limit(120)->select('id')->get()->toArray();
+        $arr2 =DreamInfoModel::orderBy('id','desc')->limit(120)->select('id')->get()->toArray();
         $id_arr2 = array_column($arr2,'id');
         $dtusers =UserCareUser::where('user_id',$id)->with('other_user')->
         where('dream_number','>',0)->orderBy('created_at')->get()->toArray();

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

xqd
@@ -255,12 +255,14 @@ class MyController extends Controller
     public function reply()
     {
         $user = $this->getUser();
+        $user = UserInfoModel::find(4);
         $data = CommentInfoModel::where('to_user_id',$user->id)->orderBy('id','desc')->get(); //user_id
         foreach ($data as $item){   //访问接口  标记已读
+//            dump(234324);
             $item->update(['is_read'=>0]);
             $info = InteractionInfo::find($item->interaction_id);
             $dream_id =empty($info) ? 0 : $info->dream_id;
-            $item->dream_id = $dream_id;
+            $item->dreamid = $dream_id;
         }
         return $this->api($data);
     }