更新统计信息

This commit is contained in:
yaooo 2023-11-07 15:21:12 +08:00
parent 733c0b0405
commit 3357ee6a79
1 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ class HomeIndex extends ApiController
$this->uid = JWT_UID; $this->uid = JWT_UID;
$total = []; $total = [];
$noteCount = Db::name('Note')->where('status', '1')->count(); $noteCount = Db::name('Note')->where('status', '1')->count();
$approveCount = Db::name('Approve')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")]])->count(); $approveCount = Db::name('Approve')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")]])->fetchSql(false)->count();
$expenseCount = Db::name('Expense')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")],['delete_time', '=', 0]])->count(); $expenseCount = Db::name('Expense')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")],['delete_time', '=', 0]])->count();
$invoiceCount = Db::name('Invoice')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")],['delete_time', '=', 0]])->count(); $invoiceCount = Db::name('Invoice')->where([['', 'exp', Db::raw("FIND_IN_SET('{$this->uid}',check_admin_ids)")],['delete_time', '=', 0]])->count();
@ -52,17 +52,17 @@ class HomeIndex extends ApiController
'num' => $noteCount, 'num' => $noteCount,
); );
$total[] = array( $total[] = array(
'name' => '审批', 'name' => '待审审批',
'type' => 'approve', 'type' => 'approve',
'num' => $approveCount, 'num' => $approveCount,
); );
$total[] = array( $total[] = array(
'name' => '报销', 'name' => '待审报销',
'type' => 'expense', 'type' => 'expense',
'num' => $expenseCount, 'num' => $expenseCount,
); );
$total[] = array( $total[] = array(
'name' => '发票', 'name' => '待审发票',
'type' => 'invoice', 'type' => 'invoice',
'num' => $invoiceCount, 'num' => $invoiceCount,
); );