Browse Source

2023-5-22-1 新增服务区-2

yingzi 1 year ago
parent
commit
4b778d98a3
1 changed files with 3 additions and 17 deletions
  1. 3 17
      app/api/controller/Pub.php

+ 3 - 17
app/api/controller/Pub.php

@@ -321,20 +321,6 @@ class Pub extends BaseController
      */
     public function getCardLookCountRank(Request $request) {
         $time = $request->param();
-//        $list = (new UserModel)->where('card_look_count', '>', 0);
-//        if ($time > 0) {
-//            $list = $list->whereTime('regtime', '>=', $time);
-//        }
-//        $list = $list->order('card_look_count', 'desc')->select();
-        //统计访问量
-//        $au_id = UserModel::where('status',1)->column('uid');
-//        $return = [];
-//        foreach ($au_id as $au){
-//            $au['number'] = AccessIp::where('add_time','>=',$time['time'])
-//                                    ->where('add_time','<=',$time['times'])
-//                                    ->sum('status');
-//            $return[] = $au;
-//        }
         $users = AccessIp::where('add_time','>=',$time['time'])
             ->where('add_time','<=',$time['times'])
             ->field('uid, count(*) as ip_count')
@@ -355,9 +341,9 @@ class Pub extends BaseController
                 'avatar' => $userInfo['avatar'],
                 'card_look_count' => $value['ip_count'],
                 'template' => $template,
-                'is_type_audit'=>$auth['status']==1?1:0,
-                'ancestral_place'=>$auth['ancestral_place'],
-                'auth_info' => $auth->toArray(),
+                'is_type_audit' => $auth && $auth['status'] == 1 ? 1 : 0,
+                'ancestral_place' => $auth ? $auth['ancestral_place'] : '',
+                'auth_info' => $auth ? $auth->toArray() : [],
                 'user_work_type_id' => $user_work_type_title['title'],
             ];
         }