feat: add fullname field to activation report and update language file
This commit is contained in:
parent
dc28298d53
commit
7bfbdb1efb
@ -258,18 +258,29 @@ switch ($action) {
|
|||||||
die();
|
die();
|
||||||
case 'by-date':
|
case 'by-date':
|
||||||
case 'activation':
|
case 'activation':
|
||||||
$q = (_post('q') ? _post('q') : _get('q'));
|
$q = trim(_post('q') ?: _get('q'));
|
||||||
$keep = _post('keep');
|
$keep = _post('keep');
|
||||||
|
|
||||||
if (!empty($keep)) {
|
if (!empty($keep)) {
|
||||||
ORM::raw_execute("DELETE FROM tbl_transactions WHERE date < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $keep DAY))");
|
ORM::raw_execute("DELETE FROM tbl_transactions WHERE date < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL ? DAY))", [$keep]);
|
||||||
r2(getUrl('logs/list/'), 's', "Delete logs older than $keep days");
|
r2(getUrl('reports/activation/'), 's', "Deleted logs older than $keep days");
|
||||||
}
|
}
|
||||||
if ($q != '') {
|
|
||||||
$query = ORM::for_table('tbl_transactions')->where_like('invoice', '%' . $q . '%')->order_by_desc('id');
|
$query = ORM::for_table('tbl_transactions')
|
||||||
|
->left_outer_join('tbl_customers', 'tbl_transactions.username = tbl_customers.username')
|
||||||
|
->select('tbl_transactions.*')
|
||||||
|
->select('tbl_customers.fullname', 'fullname')
|
||||||
|
->order_by_desc('tbl_transactions.id');
|
||||||
|
|
||||||
|
if ($q !== '') {
|
||||||
|
$query->where_like('invoice', "%$q%");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
$d = Paginator::findMany($query, ['q' => $q]);
|
$d = Paginator::findMany($query, ['q' => $q]);
|
||||||
} else {
|
} catch (Exception $e) {
|
||||||
$query = ORM::for_table('tbl_transactions')->order_by_desc('id');
|
r2(getUrl('reports/activation/'), 'e','Database query failed: ' . $e->getMessage());
|
||||||
$d = Paginator::findMany($query);
|
$d = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$ui->assign('activation', $d);
|
$ui->assign('activation', $d);
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>{Lang::T('Invoice')}</th>
|
<th>{Lang::T('Invoice')}</th>
|
||||||
<th>{Lang::T('Username')}</th>
|
<th>{Lang::T('Username')}</th>
|
||||||
|
<th>{Lang::T('Fullname')}</th>
|
||||||
<th>{Lang::T('Plan Name')}</th>
|
<th>{Lang::T('Plan Name')}</th>
|
||||||
<th>{Lang::T('Plan Price')}</th>
|
<th>{Lang::T('Plan Price')}</th>
|
||||||
<th>{Lang::T('Type')}</th>
|
<th>{Lang::T('Type')}</th>
|
||||||
@ -48,6 +49,7 @@
|
|||||||
style="cursor:pointer;">{$ds['invoice']}</td>
|
style="cursor:pointer;">{$ds['invoice']}</td>
|
||||||
<td onclick="window.location.href = '{Text::url('')}customers/viewu/{$ds['username']}'"
|
<td onclick="window.location.href = '{Text::url('')}customers/viewu/{$ds['username']}'"
|
||||||
style="cursor:pointer;">{$ds['username']}</td>
|
style="cursor:pointer;">{$ds['username']}</td>
|
||||||
|
<td>{$ds['fullname']}</td>
|
||||||
<td>{$ds['plan_name']}</td>
|
<td>{$ds['plan_name']}</td>
|
||||||
<td>{Lang::moneyFormat($ds['price'])}</td>
|
<td>{Lang::moneyFormat($ds['price'])}</td>
|
||||||
<td>{$ds['type']}</td>
|
<td>{$ds['type']}</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user