Преглед на файлове

后台证书显示用户名

赵启卫 преди 2 години
родител
ревизия
efe089aa8c
променени са 2 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 4 3
      application/admin/model/questions/CertificateRecord.php
  2. 1 1
      application/admin/view/questions/certificate/record.php

+ 4 - 3
application/admin/model/questions/CertificateRecord.php

xqd xqd xqd
@@ -44,7 +44,7 @@ class CertificateRecord extends ModelBasic
      */
     public static function getCertificateRecordList($where)
     {
-        $model = self::setWhere($where)->order('r.add_time desc')->field('r.*,c.title');
+        $model = self::setWhere($where)->order('r.add_time desc')->field('r.*,c.title, u.realname');
         if (isset($where['excel']) && $where['excel'] == 1) {
             $data = ($data = $model->select()) && count($data) ? $data->toArray() : [];
         } else {
@@ -70,6 +70,7 @@ class CertificateRecord extends ModelBasic
                     break;
             }
             $value['uids'] = $value['nickname'] . '/' . $value['uid'];
+            $value['realname'] = $value['realname'] ? $value['realname'] : $value['nickname'];
             $value['addTime'] = date('Y-m-d H:i:s', $value['add_time']);
         }
         if (isset($where['excel']) && $where['excel'] == 1) {
@@ -92,14 +93,14 @@ class CertificateRecord extends ModelBasic
                 $item['id'],
                 $item['title'],
                 $item['source'],
-                $item['uids'],
+                $item['realname'],
                 $item['obtains'],
                 $item['statu'],
                 $item['addTime']
             ];
         }
         $filename = '证书记录' . time() . '.xlsx';
-        $head = ['编号', '证书标题', '来源', '昵称/UID', '获取方式', '状态', '获得时间'];
+        $head = ['编号', '证书标题', '来源', '姓名', '获取方式', '状态', '获得时间'];
         PhpSpreadsheetService::outdata($filename, $export, $head);
     }
 }

+ 1 - 1
application/admin/view/questions/certificate/record.php

xqd
@@ -79,7 +79,7 @@
             {field: 'id', title: '编号', width: '8%', align: 'center'},
             {field: 'title', title: '证书标题', align: 'center'},
             {field: 'source', title: '来源', align: 'center', width: '10%'},
-            {field: 'uids', title: '昵称/UID', align: 'center', width: '10%'},
+            {field: 'realname', title: '姓名', align: 'center', width: '10%'},
             {field: 'obtains', title: '获取方式', align: 'center', width: '10%'},
             {field: 'statu', title: '状态', align: 'center', width: '10%'},
             {field: 'addTime', title: '获得时间', align: 'center', width: '12%'},