久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='8Pznj'></bdo><ul id='8Pznj'></ul>

  1. <small id='8Pznj'></small><noframes id='8Pznj'>

    <tfoot id='8Pznj'></tfoot>

      <i id='8Pznj'><tr id='8Pznj'><dt id='8Pznj'><q id='8Pznj'><span id='8Pznj'><b id='8Pznj'><form id='8Pznj'><ins id='8Pznj'></ins><ul id='8Pznj'></ul><sub id='8Pznj'></sub></form><legend id='8Pznj'></legend><bdo id='8Pznj'><pre id='8Pznj'><center id='8Pznj'></center></pre></bdo></b><th id='8Pznj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8Pznj'><tfoot id='8Pznj'></tfoot><dl id='8Pznj'><fieldset id='8Pznj'></fieldset></dl></div>
      <legend id='8Pznj'><style id='8Pznj'><dir id='8Pznj'><q id='8Pznj'></q></dir></style></legend>

      如何從laravel eloquent unique中刪除索引號

      How to remove index number from laravel eloquent unique(如何從laravel eloquent unique中刪除索引號)

    1. <tfoot id='oK2Sp'></tfoot>
    2. <i id='oK2Sp'><tr id='oK2Sp'><dt id='oK2Sp'><q id='oK2Sp'><span id='oK2Sp'><b id='oK2Sp'><form id='oK2Sp'><ins id='oK2Sp'></ins><ul id='oK2Sp'></ul><sub id='oK2Sp'></sub></form><legend id='oK2Sp'></legend><bdo id='oK2Sp'><pre id='oK2Sp'><center id='oK2Sp'></center></pre></bdo></b><th id='oK2Sp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='oK2Sp'><tfoot id='oK2Sp'></tfoot><dl id='oK2Sp'><fieldset id='oK2Sp'></fieldset></dl></div>
    3. <legend id='oK2Sp'><style id='oK2Sp'><dir id='oK2Sp'><q id='oK2Sp'></q></dir></style></legend>

      <small id='oK2Sp'></small><noframes id='oK2Sp'>

        • <bdo id='oK2Sp'></bdo><ul id='oK2Sp'></ul>

            <tbody id='oK2Sp'></tbody>

              • 本文介紹了如何從laravel eloquent unique中刪除索引號的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在使用一個可以完美返回值的查詢,但它向集合中添加了鍵號.如何刪除索引號?

                I am using a query that returns value perfectly but it adds key number to the collection. How can I remove the index number?

                這是檢索到的數據

                {
                "data": {
                    "0": {
                        "id": 135,
                        "conversation_id": 11,
                        "last_sender": null,
                        "last_reciever": {
                            "id": 54,
                            "userName": "Sadek",
                            "profilePic": "Nir7zgorNT2dmwcXJdhNK3ZmPAltmkEnj0SXDCDC.png",
                            "firstName": "Sadek",
                            "lastName": "Hossain"
                        },
                        "msg": "hello guys how are you",
                        "attachment": null,
                        "deleted": 0,
                        "seen": 0,
                        "created_at": "2017-10-17 16:56:41",
                        "updated_at": "2017-10-17 16:56:41"
                    },
                    "2": {
                        "id": 133,
                        "conversation_id": 13,
                        "last_sender": null,
                        "last_reciever": {
                            "id": 55,
                            "userName": "buyer",
                            "profilePic": "pRBDBFJW55baSnF560Ajid8jTgPo5kmg4i5LMhPG.jpeg",
                            "firstName": "Matti",
                            "lastName": "Rames"
                        },
                        "msg": "second message 2 to user second",
                        "attachment": null,
                        "deleted": 0,
                        "seen": 0,
                        "created_at": "2017-10-17 15:43:14",
                        "updated_at": "2017-10-17 15:43:14"
                    }
                }
                

                }

                但我想返回這樣的結果

                {
                "data": [
                    {
                        "id": 133,
                        "conversation_id": 13,
                        "last_sender": null,
                        "last_reciever": {
                            "id": 55,
                            "userName": "buyer",
                            "profilePic": "pRBDBFJW55baSnF560Ajid8jTgPo5kmg4i5LMhPG.jpeg",
                            "firstName": "Matti",
                            "lastName": "Rames"
                        },
                        "msg": "second message 2 to user second",
                        "attachment": null,
                        "deleted": 0,
                        "seen": 0,
                        "created_at": "2017-10-17 15:43:14",
                        "updated_at": "2017-10-17 15:43:14"
                    },
                    {
                        "id": 135,
                        "conversation_id": 11,
                        "last_sender": null,
                        "last_reciever": {
                            "id": 54,
                            "userName": "Sadek",
                            "profilePic": "Nir7zgorNT2dmwcXJdhNK3ZmPAltmkEnj0SXDCDC.png",
                            "firstName": "Sadek",
                            "lastName": "Hossain"
                        },
                        "msg": "hello guys how are you",
                        "attachment": null,
                        "deleted": 0,
                        "seen": 0,
                        "created_at": "2017-10-17 16:56:41",
                        "updated_at": "2017-10-17 16:56:41"
                    }
                ]
                

                }

                我的查詢是(我認為重要的最后幾部分)

                My query is (last few parts that I think is important)

                ->orderBy('created_at', 'desc') 
                ->get()
                ->unique('conversation_id');
                

                請告訴我如何從該集合中刪除0"和2".

                Please tell me how can I remove "0" and "2" from this collection.

                推薦答案

                必須手動操作

                   $users=AppUser::get()->toArray(); // your query here 
                   $data['data']=[];
                   foreach($users as $user ){ 
                         $data['data'][]=$user; 
                    }
                   $k=json_encode($data); dd($k);
                

                這篇關于如何從laravel eloquent unique中刪除索引號的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                MySQLi prepared statement amp; foreach loop(MySQLi準備好的語句amp;foreach 循環)
                Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務器還是從同一用戶獲取記錄?)
                PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數)
                Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結果填充變量)
                MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“localhost的訪問被拒絕)

                  1. <i id='8G8Qy'><tr id='8G8Qy'><dt id='8G8Qy'><q id='8G8Qy'><span id='8G8Qy'><b id='8G8Qy'><form id='8G8Qy'><ins id='8G8Qy'></ins><ul id='8G8Qy'></ul><sub id='8G8Qy'></sub></form><legend id='8G8Qy'></legend><bdo id='8G8Qy'><pre id='8G8Qy'><center id='8G8Qy'></center></pre></bdo></b><th id='8G8Qy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8G8Qy'><tfoot id='8G8Qy'></tfoot><dl id='8G8Qy'><fieldset id='8G8Qy'></fieldset></dl></div>
                      <tbody id='8G8Qy'></tbody>

                    • <bdo id='8G8Qy'></bdo><ul id='8G8Qy'></ul>
                        <tfoot id='8G8Qy'></tfoot><legend id='8G8Qy'><style id='8G8Qy'><dir id='8G8Qy'><q id='8G8Qy'></q></dir></style></legend>

                          <small id='8G8Qy'></small><noframes id='8G8Qy'>

                          主站蜘蛛池模板: 先锋资源吧 | 中文字幕99| 人人插人人| 成人在线免费观看 | 久久亚洲一区 | 91色网站 | 欧美日韩中文国产一区发布 | 欧美日韩综合视频 | 亚洲二区在线 | 成人免费视频网站在线看 | 狠狠爱网址 | 啪啪毛片| 国产高清视频 | 国产精品污www一区二区三区 | 亚洲一区视频在线 | 国产激情网| 精品国产一区二区在线 | 正在播放国产精品 | 精品一区二区三区在线视频 | 日本精a在线观看 | 91亚洲一区 | 91久久精品国产 | 中文字幕日韩欧美一区二区三区 | 日日夜夜免费精品视频 | 天堂一区在线观看 | 欧美精品一区二区三 | 亚洲www啪成人一区二区 | 亚洲精品国产偷自在线观看 | 日韩欧美国产不卡 | 免费欧美视频 | 国产精品视频在线播放 | 国产美女视频黄a视频免费 国产精品福利视频 | 久草精品视频 | 一区二区三区在线 | 欧 | 日韩欧美中文在线 | 日日操夜夜操视频 | 久久在线| 成人二区 | 欧美一区二区三区一在线观看 | 精品国产乱码久久久久久老虎 | 国产无套一区二区三区久久 |