case sensitive voucher check

This commit is contained in:
Ibnu Maksum
2024-08-11 19:54:33 +07:00
parent 4d7c2bd373
commit 3f7c17d9b1
4 changed files with 20 additions and 19 deletions

View File

@ -482,8 +482,8 @@ switch ($action) {
}
$time3months = strtotime('-3 months');
$d = ORM::for_table('tbl_voucher')->where_equal('status', '1')
->where_raw("UNIX_TIMESTAMP(used_date) < $time3months")
->findMany();
->where_raw("UNIX_TIMESTAMP(used_date) < $time3months")
->findMany();
if ($d) {
$jml = 0;
foreach ($d as $v) {
@ -756,9 +756,9 @@ switch ($action) {
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
}
$code = _post('code');
$code = Text::alphanumeric(_post('code'), "-_.,");
$user = ORM::for_table('tbl_customers')->where('id', _post('id_customer'))->find_one();
$v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one();
$v1 = ORM::for_table('tbl_voucher')->whereRaw("BINARY `code` = '?'", [$code])->where('status', 0)->find_one();
run_hook('refill_customer'); #HOOK
if ($v1) {