$sql="select sum(poci.`pay_amount`) as 'pay_amount' from pay_order_clearing_item poci join pay_order_item poi on poi.`order_item_id` = poci.`order_item_id` where poci.pay_sub_type = 105 and poci.account_id = ?";
if($type==1){
$sql.=" and poi.`notify_account_status`=2";
}else{
$sql.=" and poi.`notify_account_status`= 0 and poi.refund_order_status = 0";