Ejemplo n.º 1
0
// if (Common::isPost ()) {
// if($start_date != '' && $end_date !=''){
$page_size = PAGE_SIZE;
$page_no = $page_no < 1 ? 1 : $page_no;
$start = ($page_no - 1) * $page_size;
$wanResult = Complaint::customSpAnalayzeWan($param);
if ($wan) {
    $data['result'] = array_slice($wanResult, $start, $page_size);
    $row_count = count($wanResult);
} else {
    if ($_GET['download'] == 1) {
        $data['result'] = Complaint::customSpAnalayze($param, $start, 0);
    } else {
        $data['result'] = Complaint::customSpAnalayze($param, $start, $page_size);
    }
    $row_count = Complaint::customSpAnalayzeNum($param);
}
$wan = array_slice($wanResult, 0, 20);
foreach ($wan as $key => $value) {
    $name[] = $value['name'];
    $score[] = sprintf("%.2f", $value['score']);
}
$data['wanName'] = $name ? '"' . implode('","', $name) . '"' : '';
$data['chartWan'] = $score ? '' . implode(',', $score) . '' : '';
$charData = Complaint::customSpAnalayze($param, 0, 20);
if ($charData) {
    foreach ($charData as $key => $value) {
        $tmp['name'][] = $value['part_name'];
        $tmp['value'][] = $value['num'];
        $tmp['wan'][] = $value['wan'];
    }