$endDate) { break; } if ($platform != "") { $prize = daoInst()->select('sum(`amount`) as amt')->from('tpl_order_tab') ->where('status')->eq(1) ->andWhere('channel')->eq($platform) ->andWhere('close_ts')->ge($iday) ->andWhere('close_ts')->lt(intval($iday + 86400)) ->fetch('amt'); } else { $prize = daoInst()->select('sum(`amount`) as amt')->from('tpl_order_tab') ->where('status')->eq(1) ->andWhere('close_ts')->ge($iday) ->andWhere('close_ts')->lt(intval($iday + 86400)) ->fetch('amt'); } $prize = ((int) $prize) / 100; $prize = (float) sprintf("%.2f", $prize); $array[] = $prize; $labels[] = $day; $totalPrize += $prize; } $result = new stdClass(); $result->data = $array; $result->labels = $labels; $result->totalPrize = $totalPrize; echo json_encode($result);