|
|
@@ -212,6 +212,30 @@ class MainController extends AdminBaseController
|
|
|
->where(['user_type'=>2,'user_status'=>-1])
|
|
|
->count('id');
|
|
|
|
|
|
+ // 报名人数
|
|
|
+ $counts['bookCount'] = Db::name('books')
|
|
|
+ ->where('status','in', [2,3])
|
|
|
+ ->count('id');
|
|
|
+ $counts['bookMoney'] = Db::name('books')
|
|
|
+ ->where('status','in', [2,3])
|
|
|
+ ->sum('money');
|
|
|
+ $counts['bookCancelCount'] = Db::name('books')
|
|
|
+ ->where('status','=',5)
|
|
|
+ ->count('id');
|
|
|
+ $counts['bookMoney'] = Db::name('books')
|
|
|
+ ->where('status','=',5)
|
|
|
+ ->sum('money');
|
|
|
+ $counts['monthBookCount'] = Db::name('books')
|
|
|
+ ->where('status','in', [2,3])
|
|
|
+ ->where('book_at','>=', date('Y-m-01'))
|
|
|
+ ->where('book_at','<=', date('Y-m-d', $time+86400))
|
|
|
+ ->count('id');
|
|
|
+ $counts['monthBookMoney'] = Db::name('books')
|
|
|
+ ->where('status','in', [2,3])
|
|
|
+ ->where('book_at','>=', date('Y-m-01'))
|
|
|
+ ->where('book_at','<=', date('Y-m-d', $time+86400))
|
|
|
+ ->sum('money');
|
|
|
+
|
|
|
$cacheKey = 'counts:users:'.date('Ymd').'_';
|
|
|
$counts['activity'] = PRedis::get($cacheKey.'activity'); // 活动列表
|
|
|
$counts['activity'] = $counts['activity']? $counts['activity'] : 0;
|