|
@@ -12,7 +12,7 @@ class MemberService
|
|
|
$data = [];
|
|
|
|
|
|
// 会员数量
|
|
|
- $data['memberCount'] = Member::where('member_is_owner', 'N')->count();
|
|
|
+ $data['memberCount'] = Member::where('member_is_owner', 'N')->where('member_mobile', '<>', '0000')->count();
|
|
|
// 业主数量
|
|
|
$data['ownerCount'] = Member::where('member_is_owner', 'Y')->count();
|
|
|
// 用户总数
|
|
@@ -22,7 +22,11 @@ class MemberService
|
|
|
$data['todayCount'] = Member::where('member_addtimes', '>', $todayTime)->where('member_is_owner', 'N')->count();
|
|
|
// 本月新增用户数
|
|
|
$monthTime = strtotime(date('Y-m-01 00:00:00'));
|
|
|
- $data['monthCount'] = Member::where('member_addtimes', '>', $monthTime)->where('member_is_owner', 'N')->count();
|
|
|
+ $monthEndTime = strtotime(date('y-m-t 23:59:59'));
|
|
|
+ $data['monthCount'] = Member::whereBetween('member_addtimes', [$monthTime, $monthEndTime])
|
|
|
+ ->where('member_is_owner', 'N')
|
|
|
+ ->where('member_mobile', '<>', '0000')
|
|
|
+ ->count();
|
|
|
|
|
|
// 折线图-会员
|
|
|
$newAddition = Db::select("
|
|
@@ -35,13 +39,13 @@ class MemberService
|
|
|
order by month asc ");
|
|
|
$newAddition12Month = [];
|
|
|
$months = month_12();
|
|
|
- foreach ($months as $key => $month){
|
|
|
- foreach ($newAddition as $item){
|
|
|
- if ($month == $item->month){
|
|
|
+ foreach ($months as $key => $month) {
|
|
|
+ foreach ($newAddition as $item) {
|
|
|
+ if ($month == $item->month) {
|
|
|
$newAddition12Month[$key] = $item;
|
|
|
}
|
|
|
}
|
|
|
- if (!isset($newAddition12Month[$key])){
|
|
|
+ if (!isset($newAddition12Month[$key])) {
|
|
|
$std = new \stdClass();
|
|
|
$std->month = $month;
|
|
|
$std->num = 0;
|