Kirin преди 1 година
родител
ревизия
06851bebc3
променени са 2 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 8 0
      app/dao/user/UserExtractDao.php
  2. 1 1
      app/services/user/UserExtractServices.php

+ 8 - 0
app/dao/user/UserExtractDao.php

@@ -91,6 +91,14 @@ class UserExtractDao extends BaseDao
             }])->page($page, $limit)->order('id desc')->select()->toArray();
     }
 
+    public function getExtractAll(array $where, string $field = '*')
+    {
+        return $this->search($where)->field($field)->with([
+            'user' => function ($query) {
+                $query->field('uid,nickname');
+            }])->order('id desc')->select()->toArray();
+    }
+
     /**
      * 获取某个字段总和
      * @param array $where

+ 1 - 1
app/services/user/UserExtractServices.php

@@ -286,7 +286,7 @@ class UserExtractServices extends BaseServices
      */
     public function getExportList(array $where)
     {
-        $list = $this->dao->getExtractList($where);
+        $list = $this->dao->getExtractAll($where);
         foreach ($list as &$item) {
             $item['nickname'] = $item['user']['nickname'] ?? '';
         }