From surenkid, 2 Months ago, written in MySQL.
Embed
  1. SELECT vv.`name` 种子姓名,vv.mobile 种子手机,v.`name` 顾客姓名,v.mobile 顾客手机,o.oid 订单号,FROM_UNIXTIME(o.paytime) 支付时间,o.totalprice 订单总额,o.vipname 收货姓名,o.vipmobile 收货手机,o.vipaddress 收货地址
  2. ,od.goodsname 商品名,od.num 商品数量,od.price 商品价格
  3. FROM wfx_shop_order_detail od
  4. LEFT JOIN wfx_shop_order o ON o.id = od.oid
  5. LEFT JOIN wfx_vip v ON o.vipid = v.id
  6. LEFT JOIN wfx_vip vv ON SUBSTRING(SUBSTRING_INDEX(v.path,"-",2),3) = vv.id
  7. WHERE o.ispay = 1 AND o.id>9642