	SELECT
		A.期数,
		A.DS系统,
		(A.DS系统/(A.DS系统+A.商城复消+A.商城蓝区+A.线下工作室+A.线下其他)) AS 系统比例,
		(A.商城复消+A.商城蓝区) AS 商城,
		((A.商城复消+A.商城蓝区)/(A.DS系统+A.商城复消+A.商城蓝区+A.线下工作室+A.线下其他)) AS 商城比例,
		A.线下工作室,
		(A.线下工作室/(A.DS系统+A.商城复消+A.商城蓝区+A.线下工作室+A.线下其他)) AS 工作室比例,
		A.线下其他,
		(A.线下其他/(A.DS系统+A.商城复消+A.商城蓝区+A.线下工作室+A.线下其他)) AS 其他比例,
		(A.DS系统+A.商城复消+A.商城蓝区+A.线下工作室+A.线下其他) AS 金额总计
	FROM
	(SELECT
		P.PERIOD_NUM AS 期数,
		(SELECT SUM(V1.`商品金额`) AS DS系统订单 FROM zr_order_vw V1 LEFT JOIN `订单来源` C1 ON V1.`订单号` = C1.`订单号` WHERE	V1.`期数` = P.PERIOD_NUM AND C1.`订单来源` = 'DS系统') AS DS系统,
		(SELECT SUM(V4.`商品金额`) AS 商城复消 FROM zr_order_vw V4 LEFT JOIN `订单来源` C4 ON V4.`订单号` = C4.`订单号` WHERE	V4.`期数` = P.PERIOD_NUM AND C4.`订单来源` = '商城复消') AS 商城复消,
		(SELECT SUM(V5.`商品金额`) AS 商城蓝区 FROM zr_order_vw V5 LEFT JOIN `订单来源` C5 ON V5.`订单号` = C5.`订单号` WHERE	V5.`期数` = P.PERIOD_NUM AND C5.`订单来源` = '商城蓝区') AS 商城蓝区,
		(SELECT SUM(V2.`商品金额`) AS 线下工作室 FROM zr_order_vw V2 LEFT JOIN `订单来源` C2 ON V2.`订单号` = C2.`订单号` WHERE	V2.`期数` = P.PERIOD_NUM AND C2.`订单来源` = '线下工作室') AS 线下工作室,
		(SELECT SUM(V3.`商品金额`) AS 线下其他 FROM zr_order_vw V3 LEFT JOIN `订单来源` C3 ON V3.`订单号` = C3.`订单号` WHERE	V3.`期数` = P.PERIOD_NUM AND C3.`订单来源` = '线下其他') AS 线下其他
	FROM
		 ar_period P
		WHERE P.PERIOD_NUM = 187) A