linwu hai 4 meses
pai
achega
20c92d3942
Modificáronse 1 ficheiros con 30 adicións e 24 borrados
  1. 30 24
      app/user/controller/AdminIndexController.php

+ 30 - 24
app/user/controller/AdminIndexController.php

@@ -102,7 +102,7 @@ class AdminIndexController extends AdminBaseController
                 }
             })
             ->count();
-        $this->assign('total',$count);
+        $this->assign('total', $count);
 
         $list = Db::name('user')
             ->where(function (Query $query) {
@@ -166,19 +166,19 @@ class AdminIndexController extends AdminBaseController
         }
 
         //获取信息
-        $info           = UserModel::get($id);
-        $info['family'] = $info['family'] ? implode(',', json_decode($info['family'], true)) : '未填写';
-        $info['have_house'] = Constant::COND_TINYINT[$info['have_house']];
-        $info['have_car'] = Constant::COND_TINYINT[$info['have_car']];
+        $info                     = UserModel::get($id);
+        $info['family']           = $info['family'] ? implode(',', json_decode($info['family'], true)) : '未填写';
+        $info['have_house']       = Constant::COND_TINYINT[$info['have_house']];
+        $info['have_car']         = Constant::COND_TINYINT[$info['have_car']];
         $info['with_parent_live'] = Constant::COND_TINYINT[$info['with_parent_live']];
         if (empty($info)) {
             $this->error(lang('信息不存在或已删除'));
         }
         $this->assign('info', $info);
 
-        $mating = UserMatingModel::get(['user_id' => $id]);
-        $mating['have_house'] = Constant::COND_TINYINT[$mating['have_house']];
-        $mating['have_car'] = Constant::COND_TINYINT[$mating['have_car']];
+        $mating                     = UserMatingModel::get(['user_id' => $id]);
+        $mating['have_house']       = Constant::COND_TINYINT[$mating['have_house']];
+        $mating['have_car']         = Constant::COND_TINYINT[$mating['have_car']];
         $mating['with_parent_live'] = Constant::COND_TINYINT[$mating['with_parent_live']];
         $this->assign('mating', $mating);
 
@@ -299,17 +299,20 @@ class AdminIndexController extends AdminBaseController
             $where[] = ['check_status', '=', $data['check_status']];
         }
 
-        $list  = UserModel::where($where)->order("check_status asc,create_time DESC")->select();
+        $list = UserModel::where($where)->order("check_status asc,create_time DESC")->select();
         $data = [];
         foreach ($list as $v) {
             $data[] = [
-                'name' => $v['realname'],
-                'sex' => $v['sex_text'],
-                'age' => Fun::getAgeByBirth($v['birthday']),
-                'mobile' => $v['mobile'],
-                'company' => $v['company'],
-                'native' => $v['native'],
-                'marry' => $v['marry'],
+                'name'      => $v['realname'],
+                'sex'       => $v['sex_text'],
+                'age'       => Fun::getAgeByBirth($v['birthday']),
+                'mobile'    => $v['mobile'],
+                'company'   => $v['company'],
+                'native'    => $v['native'],
+                'marry'     => $v['marry'],
+                'income'    => $v['income'],
+                'education' => $v['education'],
+                'job' => $v['job'],
             ];
         }
 
@@ -319,14 +322,17 @@ class AdminIndexController extends AdminBaseController
 
         $excel = new Excel();
         $title = [
-            ['name','姓名'],
-            ['sex','性别'],
-            ['age','年龄'],
-            ['mobile','电话'],
-            ['company','单位'],
-            ['native','籍贯'],
-            ['marry','婚姻状况'],
+            ['name', '姓名'],
+            ['sex', '性别'],
+            ['age', '年龄'],
+            ['mobile', '电话'],
+            ['company', '单位'],
+            ['native', '籍贯'],
+            ['marry', '婚姻状况'],
+            ['income', '收入'],
+            ['education', '学历'],
+            ['job', '职务'],
         ];
-        $excel->export('本站用户',$title,$data,['mobile']);
+        $excel->export('本站用户', $title, $data, ['mobile']);
     }
 }