SELECT
  O.USER_NAME 会员编号,
	'Q94839185' 报单中心,
	O.SN 订单号,
	'已支付' 订单状态,
	'SA063' 存货编码,
	'溶菌酶本草洗液' 存货名称,
	1 数量,
	U.REAL_NAME 会员姓名,
	O.CONSIGNEE 收货人,
	O.MOBILE `联系方式1`,
	O.TEL `联系方式2`,
	G.REGION_NAME 省,
	G2.REGION_NAME 市,
	G3.REGION_NAME 区,
	O.ADDRESS 详细地址,
	O.PERIOD_NUM 期数,
	'重消' 订单类型, 
	'01' 发货仓,
	DATE_FORMAT( FROM_UNIXTIME( O.CREATED_AT ), '%Y-%m-%d %H:%i:%s' ) 创建时间,
	DATE_FORMAT( FROM_UNIXTIME( O.CREATED_AT ), '%Y-%m-%d %H:%i:%s' ) 支付时间,
	'' 发货时间,
	0 商品单价,
	0 商品金额,
	0 运费,
	'' 快递公司,
	'' 快递单号,
	'邮寄' 发运方式,
	'赠品' 会员备注,
	'未发货' 发货状态 
FROM
	AR_ORDER O
	LEFT JOIN AR_USER U ON U.ID = O.USER_ID
	LEFT JOIN AR_REGION G ON G.REGION_CODE = O.PROVINCE
	LEFT JOIN AR_REGION G2 ON G2.REGION_CODE = O.CITY
	LEFT JOIN AR_REGION G3 ON G3.REGION_CODE = O.COUNTY
	WHERE O.CREATED_AT >= UNIX_TIMESTAMP('2021-07-29') AND O.CREATED_AT < UNIX_TIMESTAMP('2021-07-30') AND O.ORDER_AMOUNT >= 500
	GROUP BY O.USER_NAME