Skip to content

Instantly share code, notes, and snippets.

@chuyihuang
Created August 30, 2016 10:05
Show Gist options
  • Save chuyihuang/e4039b9259186f50e36233a4fc0c5455 to your computer and use it in GitHub Desktop.
Save chuyihuang/e4039b9259186f50e36233a4fc0c5455 to your computer and use it in GitHub Desktop.
order.xls example
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Sheet1">
<Table>
<Row>
<Cell><Data ss:Type="String">建立時間</Data></Cell>
<Cell><Data ss:Type="String">訂單編號</Data></Cell>
<Cell><Data ss:Type="String">會員姓名</Data></Cell>
<Cell><Data ss:Type="String">會員暱稱</Data></Cell>
<Cell><Data ss:Type="String">會員Email</Data></Cell>
<Cell><Data ss:Type="String">收件人姓名</Data></Cell>
<Cell><Data ss:Type="String">收件人電話</Data></Cell>
<Cell><Data ss:Type="String">收件人地址</Data></Cell>
<Cell><Data ss:Type="String">付款方式</Data></Cell>
<Cell><Data ss:Type="String">付款狀態</Data></Cell>
<Cell><Data ss:Type="String">出貨狀態</Data></Cell>
<Cell><Data ss:Type="String">贊助金額</Data></Cell>
<Cell><Data ss:Type="String">實際金額</Data></Cell>
<Cell><Data ss:Type="String">購物明細</Data></Cell>
<Cell><Data ss:Type="String">備註</Data></Cell>
</Row>
<% @orders.each do |order| %>
<Row>
<Cell><Data ss:Type="String"><%= ymdhm(order.created_at) %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.order_no %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.user.name %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.user.nick %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.user.show_email %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.receiver_name %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.receiver_tel %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.receiver_address %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.show_pay_type %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.show_pay_status %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.show_deliver_status %></Data></Cell>
<Cell><Data ss:Type="Number"><%= order.pay_amount %></Data></Cell>
<Cell><Data ss:Type="Number"><%= order.total_amount %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.campaign_orders.collect do |campaign_order| %><% %Q(#{campaign_order.campaign_title} 數量: #{campaign_order.qty} X 單價: #{campaign_order.price}) %><% end.join(" | ") %></Data></Cell>
<Cell><Data ss:Type="String"><%= order.comment %></Data></Cell>
</Row>
<% end %>
</Table>
</Worksheet>
</Workbook>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment