系统是多店版2.3
我修改了app/services/other/export/exportservices.php 这一段,发觉提示“服务器内部错误”
想在EXCEL文件里加个手机号的内容
/**
* 用户资金导出
* @param array $data
* @param int $type 1:直接返回数据前端生成excel 2:后台生成excel
* @return array|mixed
*/
public function userFinance($data = [], $type = 1)
{
$header = ['会员ID', '昵称', '手机号', '金额', '类型', '备注', '创建时间'];
$title = ['资金监控', '资金监控', date('Y-m-d H:i:s', time())];
$filename = '资金监控_' . date('YmdHis', time());
$export = [];
$filekey = [];
if (!empty($data)) {
$i = 0;
foreach ($data as $value) {
$one_data = [
'uid' => $value['uid'],
'nickname' => $value['nickname'],
'phone' => $value['phone'],
'pm' => $value['pm'] == 0 ? '-' . $value['number'] : $value['number'],
'title' => $value['title'],
'mark' => $value['mark'],
'add_time' => $value['add_time'],
];
if ($type == 1) {
$export[] = $one_data;
if ($i == 0) {
$filekey = array_keys($one_data);
}
} else {
$export[] = array_values($one_data);
}
$i++;
}
}
if ($type == 1) {
return compact('header', 'filekey', 'export', 'filename');
} else {
return $this->export($header, $title, $export, $filename);
}
}
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}