-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhotopay.admin.model.php
51 lines (44 loc) · 1.33 KB
/
hotopay.admin.model.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* Hoto Pay
*
* Copyright (c) Waterticket
*
* Generated with https://www.poesis.org/tools/modulegen/
*/
class HotopayAdminModel extends Hotopay
{
public function getSales($startPeriod = 0, $endPeriod = -1)
{
$args = new stdClass();
$args->startPeriod = $startPeriod;
if($endPeriod != -1) $args->endPeriod = $endPeriod;
$output = executeQuery('hotopay.getSalesAmount', $args);
return $output->data;
}
public function setNumberComp($var, $decimal_point = 0, $compare_value = 0)
{
if($var > $compare_value)
return '▲ '.number_format($var, $decimal_point);
else if($var < $compare_value)
return '▼ '.number_format(abs($var), $decimal_point);
else
return 'ㅡ '.number_format($var, $decimal_point);
}
public function getNumberStatus($var)
{
if($var > 0)
return 'positive';
else if($var < 0)
return 'negative';
else
return 'neutral';
}
public function getPercentage($value, $compare = 0)
{
if($value + $compare == 0) return '0%';
if($compare == 0) return '-%';
if($value == $compare) return '100%';
return $this->setNumberComp(($value-$compare)/$compare * 100 + 100, 1, 100) . '%';
}
}