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

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

      <tfoot id='t7abE'></tfoot>

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

      <legend id='t7abE'><style id='t7abE'><dir id='t7abE'><q id='t7abE'></q></dir></style></legend>
        <bdo id='t7abE'></bdo><ul id='t7abE'></ul>

      Laravel Carbon Group 按月

      Laravel Carbon Group by Month(Laravel Carbon Group 按月)
        <i id='Jc76z'><tr id='Jc76z'><dt id='Jc76z'><q id='Jc76z'><span id='Jc76z'><b id='Jc76z'><form id='Jc76z'><ins id='Jc76z'></ins><ul id='Jc76z'></ul><sub id='Jc76z'></sub></form><legend id='Jc76z'></legend><bdo id='Jc76z'><pre id='Jc76z'><center id='Jc76z'></center></pre></bdo></b><th id='Jc76z'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Jc76z'><tfoot id='Jc76z'></tfoot><dl id='Jc76z'><fieldset id='Jc76z'></fieldset></dl></div>

          1. <small id='Jc76z'></small><noframes id='Jc76z'>

            <tfoot id='Jc76z'></tfoot>
            <legend id='Jc76z'><style id='Jc76z'><dir id='Jc76z'><q id='Jc76z'></q></dir></style></legend>
              <bdo id='Jc76z'></bdo><ul id='Jc76z'></ul>
                <tbody id='Jc76z'></tbody>
              • 本文介紹了Laravel Carbon Group 按月的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                誰(shuí)能看出我做錯(cuò)了什么?

                Can anyone see what I'm doing wrong?

                我試圖輸出所有月份,但將它們分組以便它們是唯一的.

                I'm trying to output all the months but group them so they are unique.

                $months = NewsItem::select(DB::raw('MONTH("created_at") as month'))->groupBy('month')->get();
                return $months;
                

                我要回以下內(nèi)容

                {"month":null}
                

                在我的數(shù)據(jù)庫(kù)中,我有五篇新聞文章都是在 2017 年 5 月 1 日創(chuàng)建的,所以我只收到一個(gè)回復(fù)??是對(duì)的,但我沒(méi)有得到當(dāng)月的數(shù)字?

                In my database I have five news articles all created_at 05/01/2017 so it's right that I only get one response but I'm not getting the number of the month back?

                推薦答案

                你可以使用帶有閉包的 groupBy() 方法:

                You can use groupBy() method with closure:

                 $months = NewsItem::groupBy(function($d) {
                     return Carbon::parse($d->created_at)->format('m');
                 })->get();
                

                或者先獲取數(shù)據(jù),然后在 Eloquent 集合上使用 groupBy() :

                Or get data first and then use groupBy() on the Eloquent collection:

                 $months = NewsItem::get()->groupBy(function($d) {
                     return Carbon::parse($d->created_at)->format('m');
                 });
                

                這篇關(guān)于Laravel Carbon Group 按月的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                  • <legend id='OPDPd'><style id='OPDPd'><dir id='OPDPd'><q id='OPDPd'></q></dir></style></legend>
                    • <bdo id='OPDPd'></bdo><ul id='OPDPd'></ul>

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

                        <i id='OPDPd'><tr id='OPDPd'><dt id='OPDPd'><q id='OPDPd'><span id='OPDPd'><b id='OPDPd'><form id='OPDPd'><ins id='OPDPd'></ins><ul id='OPDPd'></ul><sub id='OPDPd'></sub></form><legend id='OPDPd'></legend><bdo id='OPDPd'><pre id='OPDPd'><center id='OPDPd'></center></pre></bdo></b><th id='OPDPd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OPDPd'><tfoot id='OPDPd'></tfoot><dl id='OPDPd'><fieldset id='OPDPd'></fieldset></dl></div>
                          <tbody id='OPDPd'></tbody>
                        <tfoot id='OPDPd'></tfoot>
                          主站蜘蛛池模板: www.日韩 | 欧美精品在欧美一区二区少妇 | 伊人一区 | 日韩在线观看一区 | 日韩视频1| 日本天堂一区二区 | 日本视频一区二区三区 | 少妇久久久| 亚洲视频一区在线观看 | 视频一区二区在线 | 国产一区二区在线免费观看 | 免费一区 | 狠狠色狠狠色综合系列 | 国产探花在线精品一区二区 | 国产精品视频久久 | 在线观看av不卡 | 久久久做 | 亚洲欧美日韩电影 | 国产欧美一区二区精品忘忧草 | 韩国主播午夜大尺度福利 | 亚洲成人av | 亚洲成人一区二区三区 | 亚洲九九 | 国产免费一区二区三区网站免费 | 综合色久 | 啪一啪| 亚洲视频在线看 | 成人在线视频一区 | www.婷婷| av一二三四 | 91久久精品国产91久久性色tv | 99日韩 | 黄网免费 | 国产精品99久久免费观看 | 国产在线永久免费 | 一区二区影视 | 黄色片免费看 | 一区二区日韩 | 九九热精品视频 | 亚洲国产aⅴ成人精品无吗 综合国产在线 | 欧美黄色一区 |