首页新增客户、项目统计
This commit is contained in:
parent
214d89dd98
commit
8f36f7905d
@ -61,11 +61,13 @@ class Index extends BaseController
|
||||
}
|
||||
|
||||
foreach ($statistics as $key => $value) {
|
||||
if (!$value ) unset($statistics[$key]);
|
||||
if (!$value) {
|
||||
unset($statistics[$key]);
|
||||
}
|
||||
|
||||
}
|
||||
return to_assign(0, 'ok', $statistics);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$admin = get_login_admin();
|
||||
if (get_cache('menu' . $admin['id'])) {
|
||||
$list = get_cache('menu' . $admin['id']);
|
||||
@ -95,8 +97,8 @@ class Index extends BaseController
|
||||
$total = [];
|
||||
$adminCount = Db::name('Admin')->where('status', '1')->count();
|
||||
$approveCount = Db::name('Approve')->count();
|
||||
$expenseCount = Db::name('Expense')->count();
|
||||
$invoiceCount = Db::name('Invoice')->count();
|
||||
$expenseCount = Db::name('Expense')->where('status', '1')->count();
|
||||
$invoiceCount = Db::name('Invoice')->where('status', '1')->count();
|
||||
$total[] = array(
|
||||
'name' => '员工',
|
||||
'num' => $adminCount,
|
||||
@ -114,9 +116,23 @@ class Index extends BaseController
|
||||
'num' => $invoiceCount,
|
||||
);
|
||||
$module = Db::name('AdminModule')->column('name');
|
||||
if (in_array('customer', $module)) {
|
||||
$customerCount = Db::name('Customer')->where([['delete_time', '=', 0]])->count();
|
||||
$total[] = array(
|
||||
'name' => '客户',
|
||||
'num' => $customerCount,
|
||||
);
|
||||
}
|
||||
if (in_array('contract', $module)) {
|
||||
$contractCount = Db::name('Contract')->where([['delete_time', '=', 0]])->count();
|
||||
$total[] = array(
|
||||
'name' => '合同',
|
||||
'num' => $contractCount,
|
||||
);
|
||||
}
|
||||
if (in_array('project', $module)) {
|
||||
$projectCount = Db::name('Project')->where([['delete_time','>',0]])->count();
|
||||
$taskCount = Db::name('ProjectTask')->where([['delete_time','>',0]])->count();
|
||||
$projectCount = Db::name('Project')->where([['delete_time', '=', 0]])->count();
|
||||
$taskCount = Db::name('ProjectTask')->where([['delete_time', '=', 0]])->count();
|
||||
$total[] = array(
|
||||
'name' => '项目',
|
||||
'num' => $projectCount,
|
||||
@ -127,7 +143,7 @@ class Index extends BaseController
|
||||
);
|
||||
}
|
||||
if (in_array('article', $module)) {
|
||||
$articleCount = Db::name('Article')->where([['delete_time','>',0]])->count();
|
||||
$articleCount = Db::name('Article')->where([['delete_time', '=', 0]])->count();
|
||||
$total[] = array(
|
||||
'name' => '文章',
|
||||
'num' => $articleCount,
|
||||
|
Loading…
x
Reference in New Issue
Block a user