// 今日注册数
$today_member_num=Db::name('memberdata')->whereTime('regdate', 'd')->count();
// 昨日注册数
$yesterday_member_num=Db::name('memberdata')->whereTime('regdate', 'yesterday')->count();
// 本周注册数
$week_member_num=Db::name('memberdata')->whereTime('regdate', 'w')->count();
// 本月注册数
$month_member_num=Db::name('memberdata')->whereTime('regdate', 'm')->count();
// 今日IP数
$today_ip_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('accessip')->whereTime('accesstime', 'd')->select());
// 昨日IP数
$yesterday_ip_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('accessip')->whereTime('accesstime', 'yesterday')->select());
// 本周IP数
$week_ip_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('accessip')->whereTime('accesstime', 'w')->select());
// 本月IP数
$month_ip_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('accessip')->whereTime('accesstime', 'm')->select());
// 今日用户登录次数
$today_user_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('uid')->whereTime('accesstime', 'd')->select());
// 昨日用户登录次数
$yesterday_user_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('uid')->whereTime('accesstime', 'yesterday')->select());
// 本周用户登录次数
$week_user_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('uid')->whereTime('accesstime', 'w')->select());
// 本月用户登录次数
$month_user_num=count(Db::name('behaviorrecord_list')->distinct(true)->field('uid')->whereTime('accesstime', 'm')->select());
// 今日充值数
$today_rmb_num=Db::name('rmb_infull')->whereTime('posttime', 'd')->sum('money');
// 昨日充值数
$yesterday_rmb_num=Db::name('rmb_infull')->whereTime('posttime', 'yesterday')->sum('money');
// 本周充值数
$week_rmb_num=Db::name('rmb_infull')->whereTime('posttime', 'w')->sum('money');
// 本月充值数
$month_rmb_num=Db::name('rmb_infull')->whereTime('posttime', 'm')->sum('money');
//验证qb_signin_member表是否存在
$table_signin_member = Db::query('SHOW TABLES LIKE "qb_signin_member"');
if($table_signin_member==false){
$today_sign_num='未安装';
}
else{
// 今日共签到次数
$today_sign_num=Db::name('signin_member')->whereTime('create_time', 'd')->count();
// 昨日共签到次数
$yesterday_sign_num=Db::name('signin_member')->whereTime('create_time', 'yesterday')->count();
// 本周共签到次数
$week_sign_num=Db::name('signin_member')->whereTime('create_time', 'w')->count();
// 本月共签到次数
$month_sign_num=Db::name('signin_member')->whereTime('create_time', 'm')->count();
}
// 今日文章数
$today_cms_num=Db::name('cms_content')->whereTime('create_time', 'd')->count();
// 今日主题数
$today_bbs_num=Db::name('bbs_content')->whereTime('create_time', 'd')->count();
// 今日帖子数
$today_reply_num=Db::name('bbs_reply')->whereTime('create_time', 'd')->count();
// 昨日主题数
$yesterday_bbs_num=Db::name('bbs_content')->whereTime('create_time', 'yesterday')->count();
// 昨日帖子数
$yesterday_reply_num=Db::name('bbs_reply')->whereTime('create_time', 'yesterday')->count();
// 昨日文章数
$yesterday_cms_num=Db::name('cms_content')->whereTime('create_time', 'yesterday')->count();
// 本周文章数
$week_cms_num=Db::name('cms_content')->whereTime('create_time', 'w')->count();
// 本周主题数
$week_bbs_num=Db::name('bbs_content')->whereTime('create_time', 'w')->count();
// 本周帖子数
$week_reply_num=Db::name('bbs_reply')->whereTime('create_time', 'w')->count();
// 本月文章数
$month_cms_num=Db::name('cms_content')->whereTime('create_time', 'm')->count();
// 本月主题数
$month_bbs_num=Db::name('bbs_content')->whereTime('create_time', 'm')->count();
// 本月帖子数
$month_reply_num=Db::name('bbs_reply')->whereTime('create_time', 'm')->count();
/* 待办事项 */
// 待审评论数
$status_pl_num=Db::name('comment_content')->where('status', '=',0)->count();
// 待审帖子数
$status_bbs_num=Db::name('bbs_content')->where('status', '=',0)->count();
// 待审文章数
$status_cms_num=Db::name('cms_content')->where('status', '=',0)->count();
// 待审会员数
$status_user_num=Db::name('memberdata')->where('yz', '=',0)->count();
// 待审圈子数
$status_qun_num=Db::name('qun_content')->where('status', '=',0)->count();
//验证qb_mall_order表是否存在
$table_mall_order = Db::query('SHOW TABLES LIKE "qb_mall_order"');
if($table_mall_order==false){
$status_mall_num='未安装';
}
else{
// 待审发货数
$status_mall_num=Db::name('mall_order')->where('ifsend', '=',0)->count();
}
//验证qb_links_content表是否存在
$table_links_content = Db::query('SHOW TABLES LIKE "qb_links_content"');
if($table_links_content==false){
$status_link_num='未安装';
}
else{
// 待审友情链接
$status_link_num=Db::name('links_content')->where('status', '=',0)->count();
}
//验证qb_blacklist表是否存在
$table_blacklist_content = Db::query('SHOW TABLES LIKE "qb_blacklist"');
if($table_blacklist_content==false){
$status_black_num='未安装';
}
else{
// 待审申诉表
$status_black_num=Db::name('blacklist')->where('status', '=',0)->count();
}
//验证qb_jubao表是否存在
$table_jubao_content = Db::query('SHOW TABLES LIKE "qb_jubao"');
if($table_jubao_content==false){
$status_jubao_num='未安装';
}
else{
// 待审举报
$status_jubao_num=Db::name('jubao')->count();
}
//验证qb_baidu_api_rz表是否存在
$table_shenfen_content = Db::query('SHOW TABLES LIKE "qb_baidu_api_rz"');
if($table_shenfen_content==false){
$status_shenfen_num='未安装';
}
else{
// 身份认证
$status_shenfen_num=Db::name('baidu_api_rz')->count();
}
//验证qb_qunrenzheng_content表是否存在
$table_qunrenzheng_content = Db::query('SHOW TABLES LIKE "qb_qunrenzheng_content"');
if($table_qunrenzheng_content==false){
$status_qunrenzheng_num='未安装';
}
else{
// 待审圈子认证
$status_qunrenzheng_num=Db::name('qunrenzheng_content')->where('status', '=',0)->count();
}
//验证qb_giftshop_order表是否存在
$table_giftshop_content = Db::query('SHOW TABLES LIKE "qb_giftshop_order"');
if($table_giftshop_content==false){
$status_giftshop_num='未安装';
}
else{
// 待审兑换订单
$status_giftshop_num=Db::name('giftshop_order')->where('shipping_status', '=',0)->count();
}
//验证qb_turntable_record表是否存在
$table_turntable_content = Db::query('SHOW TABLES LIKE "qb_turntable_record"');
if($table_turntable_content==false){
$status_turntable_num='未安装';
}
else{
// 待审兑换订单
$status_turntable_num=Db::name('turntable_record')->where('status', '=',0)->count();
}
//验证qb_taskcard_record表是否存在
$table_taskcard_content = Db::query('SHOW TABLES LIKE "qb_taskcard_record"');
if($table_taskcard_content==false){
$status_taskcard_num='未安装';
}
else{
// 待审兑换订单
$status_taskcard_num=Db::name('taskcard_record')->where('status', '=',0)->count();
}
/* 版块信息 */
// 会员总数
$member_num=Db::table('qb_memberdata')->count();
// 关注总数
$member_gz_num=Db::table('qb_memberdata')->where('wx_attention','>',0)->count();
// 绑定总数
$member_bd_num=Db::table('qb_memberdata')->where('weixin_api','>',0)->count();
// 文章总数
$cms_num=Db::table('qb_cms_content')->count();
// 主题总数
$bbs_num=Db::table('qb_bbs_content')->count();
// 帖子总数
$reply_num=Db::table('qb_bbs_reply')->count();
// 圈子总数
$qun_num=Db::table('qb_qun_content')->count();