bad code Asked:2020-01-21 03:39:34 +0000 UTC2020-01-21 03:39:34 +0000 UTC 2020-01-21 03:39:34 +0000 UTC 如何查看订单状态更改的日期?woocommerce 772 在管理面板中,我们更改状态并在某个用户的订单页面上显示有关订单的信息,如屏幕截图所示 这个日期怎么弄?? $order = wc_get_order($customer_order);此属性没有状态更改日期。有一个最后修改日期和一个创建日期,但这没有意义。 $notes = $order->get_customer_order_notes() wordpress 1 个回答 Voted Best Answer bad code 2020-01-21T17:13:30Z2020-01-21T17:13:30Z function get_private_order_notes( $order_id){ global $wpdb; $table_perfixed = $wpdb->prefix . 'comments'; $results = $wpdb->get_results(" SELECT * FROM $table_perfixed WHERE `comment_post_ID` = $order_id AND `comment_type` LIKE 'order_note' "); foreach($results as $note){ $order_note[] = array( 'note_id' => $note->comment_ID, 'note_date' => $note->comment_date, 'note_author' => $note->comment_author, 'note_content' => $note->comment_content, ); } return $order_note; }
1 个回答