orders = $orders; } /** * @return \Illuminate\Support\Collection */ public function array():array { $orders = $this->orders; $rows = []; foreach ($orders as $order) { $rows[] = [($order['user'])->id, ($order['user'])->name, ($order['user'])->mobile, $order['shop_count']?:"0", $order['code_count']?:"0", $order['refund_order_count']?:"0"]; } return $rows; } public function headings(): array { return [ ["用户id", "姓名", "手机号", "订单数", "抽奖码数", "含退款订单数"] ]; } }