-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.php
60 lines (50 loc) · 1.24 KB
/
constants.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
52
53
54
55
56
57
58
59
60
<?php
function getIsApprovedStatus($old)
{
$isApproved = [
'0' => 'pending',
'1' => 'approved',
'2' => 'rejected',
];
return (isset($isApproved[$old])) ? $isApproved[$old] : NULL;
}
function getRedemptionTypeFromCoupon($key)
{
$redemptionType = [
'normal' => 'normal',
'merchantApp' => 'app-merchant',
'appExclusive' => 'app-exclusive',
'social' => 'social'
];
return ($key !== NULL && isset($key)) ? $redemptionType[$key] : NULL;
}
function getOfferTypeFromCoupon($key)
{
$redemptionType = [
'Exclusive' => 'exclusive',
'Card Offer' => 'bank-card',
'General' => NULL
];
return (isset($redemptionType[$key])) ? $redemptionType[$key] : NULL;
}
function getGenderFromCoupon($key)
{
$gender = [
'0' => NULL,
'1' => 'male',
'2' => 'female',
'3' => 'unisex'
];
return ($key !== NULL && isset($key)) ? $gender[$key] : NULL;
}
function getDiscountTypeFromCoupon($key)
{
$discountType = [
'Percentage' => 'percentage',
'Amount' => 'value',
'FreeItem' => 'free-item',
'Cashback' => 'cashback'
];
return ($key !== NULL && isset($key)) ? $discountType[$key] : NULL;
}
?>