linwu 7 сар өмнө
parent
commit
08335b3796

+ 31 - 31
app/mainapp/controller/Screen.php

@@ -26,7 +26,7 @@ class Screen extends BaseController
         $res     = [];
 
         //街道数据
-        /*$comjobs_community = ComjobsModel::field("count(community),community")->group('community')->column('count(community)', 'community');
+        $comjobs_community = ComjobsModel::field("count(community),community")->group('community')->column('count(community)', 'community');
         $community         = RensheCode::getList('community')->toArray();
         $broker_town       = BrokerModel::field("count(town),town")->group('town')->column('count(town)', 'town');
         foreach ($community as &$v) {
@@ -48,8 +48,8 @@ class Screen extends BaseController
             'code'         => '',
             'count'        => $comjobs_community[''] ?? 0,
             'broker_count' => $broker_town[''] ?? 0,
-        ];*/
-        $community = [
+        ];
+        /*$community = [
             [
                 "id"=> 2,
                 "name"=> "青阳街道",
@@ -197,18 +197,18 @@ class Screen extends BaseController
                 "count"=> 289,
                 "broker_count"=> 1
             ]
-        ];
+        ];*/
         $res['community'] = $community;
 
         //岗位类别
-        /*$comjobs_cate = ComjobsModel::field("count(cateid),cateid")->group('cateid')->column('count(cateid)', 'cateid');
+        $comjobs_cate = ComjobsModel::field("count(cateid),cateid")->group('cateid')->column('count(cateid)', 'cateid');
         $cateids      = array_keys($comjobs_cate);
         $cate         = ComjobsCateModel::where('id', 'in', $cateids)->select()->toArray();
         foreach ($cate as &$v) {
             $v['count'] = $comjobs_cate[$v['id']];
             unset($v);
-        }*/
-        $cate = [
+        }
+        /*$cate = [
             [
                 "id"=> 26,
                 "pid"=> 0,
@@ -409,12 +409,12 @@ class Screen extends BaseController
                 "code"=> "",
                 "count"=> 26
             ]
-        ];
+        ];*/
         $res['cate'] = $cate;
 
         //岗位类型
-//        $comjobs_type = ComjobsModel::field("count(wtype) count,wtype")->group('wtype')->select();
-        $comjobs_type = [
+        $comjobs_type = ComjobsModel::field("count(wtype) count,wtype")->group('wtype')->select();
+        /*$comjobs_type = [
             [
                 "count" => 2405,
                 "wtype" => 1,
@@ -435,7 +435,7 @@ class Screen extends BaseController
                 "count" => 567,
                 "wtype" => 5,
             ],
-        ];
+        ];*/
         $res['type']  = $comjobs_type;
 
         //岗位数据
@@ -465,7 +465,7 @@ class Screen extends BaseController
         $res['comjobs']['hot'] = $comjobs_hot_data;
 
         //学历
-        /*$user_education = UserModel::field("count(education),education")->group('education')->column('count(education)', 'education');
+        $user_education = UserModel::field("count(education),education")->group('education')->column('count(education)', 'education');
         $education_data = ['' => '未知', 1 => '初中及以下', 2 => '高中', 3 => '中技', 4 => '中专', 5 => '大专', 6 => '本科', 7 => '硕士', 8 => '博士'];
         $education      = [];
         foreach ($education_data as $k => $v) {
@@ -476,8 +476,8 @@ class Screen extends BaseController
                 $item['count'] = $user_education[$k];
             }
             $education[] = $item;
-        }*/
-        $education = [
+        }
+        /*$education = [
             [
                 "name"=> "未知",
                 "count"=> 11401
@@ -514,11 +514,11 @@ class Screen extends BaseController
                 "name"=> "博士",
                 "count"=> 16
             ]
-        ];
+        ];*/
         $res['eduction'] = $education;
 
         //年龄分布
-        /*$user_age_other = UserModel::where('idcard', '')->count();
+        $user_age_other = UserModel::where('idcard', '')->count();
         $user_idcard    = UserModel::field('idcard')->where('idcard', '<>', '')->select();
         $user_age       = [
             ['name' => '16-25', 'count' => 0],
@@ -538,38 +538,38 @@ class Screen extends BaseController
             } elseif ($age >= 45) {
                 $user_age[3]['count']++;
             }
-        }*/
-        $user_age        = [
+        }
+        /*$user_age        = [
             ['name' => '16-25', 'count' => 10981],
             ['name' => '25-35', 'count' => 0],
             ['name' => '35-45', 'count' => 0],
             ['name' => '45以上', 'count' => 0],
             ['name' => '其他', 'count' => 2196],
-        ];
+        ];*/
         $res['user_age'] = $user_age;
 
         //注册相关
-        /*$user_gender         = UserModel::field("count(gender),gender")->group('gender')->column('count(gender)', 'gender');
+        $user_gender         = UserModel::field("count(gender),gender")->group('gender')->column('count(gender)', 'gender');
         $res['people_total'] = array_sum($user_gender);
         $res['people_man']   = $user_gender[1];
         $res['people_woman'] = $user_gender[2];
-        $res['broker_total'] = BrokerModel::count();*/
-        $res['people_total'] = 13177;
+        $res['broker_total'] = BrokerModel::count();
+        /*$res['people_total'] = 13177;
         $res['people_man']   = 9224;
         $res['people_woman'] = 3953;
-        $res['broker_total'] = 416;
+        $res['broker_total'] = 416;*/
 
         //岗位相关
-        /*$res['company_total'] = WorkerModel::where('status', 'in', '4,5')->count();
-        $res['comjobs_total'] = ComjobsModel::where($comjobs_map)->count();*/
-        $res['company_total'] = 420;
-        $res['comjobs_total'] = 4559;
+        $res['company_total'] = WorkerModel::where('status', 'in', '4,5')->count();
+        $res['comjobs_total'] = ComjobsModel::where($comjobs_map)->count();
+        /*$res['company_total'] = 420;
+        $res['comjobs_total'] = 4559;*/
 
         //培训相关
-        /*$res['train']      = TrainModel::count();
-        $res['train_join'] = TrainJoinModel::count();*/
-        $res['train']      = 74;
-        $res['train_join'] = 731;
+        $res['train']      = TrainModel::count();
+        $res['train_join'] = TrainJoinModel::count();
+        /*$res['train']      = 74;
+        $res['train_join'] = 731;*/
 
         //月注册相关
         $year       = date('Y');