Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDを使用しない場合でもグラフ出力していたのを修正 #430

Merged
merged 4 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Composer install
uses: nanasess/composer-installer-action@master

- name: Setup PHP
uses: nanasess/setup-php@master
with:
Expand Down
21 changes: 14 additions & 7 deletions data/class/pages/admin/total/LC_Page_Admin_Total.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ public function lfGetOrderMember($type, $sdate, $edate)
}
}

$tpl_image = $this->lfGetGraphPie($arrTotalResults, 'member_name', 'member', '(売上比率)', $sdate, $edate);
$tpl_image = DRAW_IMAGE ? $this->lfGetGraphPie($arrTotalResults, 'member_name', 'member', '(売上比率)', $sdate, $edate) : '';


return array($arrTotalResults, $tpl_image);
}
Expand Down Expand Up @@ -598,7 +599,7 @@ public function lfGetOrderProducts($type, $sdate, $edate)
$objQuery->setOrder('total DESC');
$arrTotalResults = $objQuery->select($col, $from, $where, $arrWhereVal);

$tpl_image = $this->lfGetGraphPie($arrTotalResults, 'product_name', 'products_' . $type, '(売上比率)', $sdate, $edate);
$tpl_image = DRAW_IMAGE ? $this->lfGetGraphPie($arrTotalResults, 'product_name', 'products_' . $type, '(売上比率)', $sdate, $edate) : '';

return array($arrTotalResults, $tpl_image);
}
Expand Down Expand Up @@ -635,7 +636,8 @@ public function lfGetOrderJob($type, $sdate, $edate)
}

}
$tpl_image = $this->lfGetGraphPie($arrTotalResults, 'job_name', 'job_' . $type, '(売上比率)', $sdate, $edate);

$tpl_image = DRAW_IMAGE ? $this->lfGetGraphPie($arrTotalResults, 'job_name', 'job_' . $type, '(売上比率)', $sdate, $edate) : '';

return array($arrTotalResults, $tpl_image);
}
Expand Down Expand Up @@ -672,7 +674,8 @@ public function lfGetOrderAge($type, $sdate, $edate)
}

}
$tpl_image = $this->lfGetGraphBar($arrTotalResults, 'age_name', 'age_' . $type, '(年齢)', '(売上合計)', $sdate, $edate);

$tpl_image = DRAW_IMAGE ? $this->lfGetGraphBar($arrTotalResults, 'age_name', 'age_' . $type, '(年齢)', '(売上合計)', $sdate, $edate) : '';

return array($arrTotalResults, $tpl_image);
}
Expand Down Expand Up @@ -726,8 +729,9 @@ public function lfGetOrderTerm($type, $sdate, $edate)
$arrTotalResults = $objQuery->select($col, 'dtb_order', $where, $arrWhereVal);

$arrTotalResults = $this->lfAddBlankLine($arrTotalResults, $type, $sdate, $edate);
// todo GDない場合の処理
$tpl_image = $this->lfGetGraphLine($arrTotalResults, 'str_date', 'term_' . $type, $xtitle, $ytitle, $sdate, $edate, $xincline);

$tpl_image = DRAW_IMAGE ? $this->lfGetGraphLine($arrTotalResults, 'str_date', 'term_' . $type, $xtitle, $ytitle, $sdate, $edate, $xincline) : '';

$arrTotalResults = $this->lfAddTotalLine($arrTotalResults);

return array($arrTotalResults, $tpl_image);
Expand Down Expand Up @@ -815,7 +819,10 @@ public function lfAddTotalLine($arrResults)
}
}
// 平均値の計算
$arrTotal['total_average'] = $arrTotal['total'] / $arrTotal['total_order'];
$arrTotal['total_average'] = 0;
if ($arrTotal['total_order'] > 0) {
$arrTotal['total_average'] = $arrTotal['total'] / $arrTotal['total_order'];
}
if (is_nan($arrTotal['total_average'])) {
$arrTotal['total_average'] = 0;
}
Expand Down