如何按会议日期对订单表进行排序

时间:2019-09-05 02:24:04

标签: php wordpress sorting meta

我正在尝试按“ meeting_date”对发票列表进行排序,这是数据库中的一个元。

在这里,我有代码:

<?php if ( ! empty( $invoices ) ) {
                foreach ( $invoices as $invoice ) { ?>

                    <tr>
                        <td>
                              <span class="hs-table-facture-img"></span>
                            <a target="hs_factures_iframe" id="hs-go-to-frame" class="hs-table-facture-link" href="<?php echo $invoice['invoicing_link']; ?>">Facture # <?php echo $invoice['invoicing_number']; ?></a>
                        </td>

                        <?php if ( $show_date ) { ?>

                            <td class="hs-custom-factures-td-bold">
                                <?php
                                  $title_arr = explode(" ", $invoice['title']);

                                  // get meating date
                                $get_all_cf = get_post_meta( (int)$invoice['id'], 'wpc_inv_invoice_cf', true );
                                $meeting_date = $get_all_cf['wpc_inv_cf_meeting_date'];
                                $meeting_date = date("d.m.Y", strtotime($meeting_date));


                                ?>

                                <?php echo $meeting_date . $title_arr[0]; ?>
                            </td>

现在,发票是按最早的顺序显示的。我的客户必须滚动很多才能查看所需的发票。

如何使用它来按会议日期排序此表?

预先感谢您的帮助。

0 个答案:

没有答案