QQ扫一扫联系
1 本地转换参照文档
https://modstart.com/m/Wenku/doc/58
https://modstart.com/m/Wenku/doc/57
2 图片技术上是不可避免被保存、截图的,可通过禁用页面鼠标邮件等操作来屏蔽小白用户。
2 导出Excel数据,可参考报名管理系统
public function export(ExportHandle $handle) { $headTitles = [ '票号', '创建时间', '用户ID', ]; return $handle ->withPageTitle('导出报名单') ->withDefaultExportName('报名单') ->withHeadTitles($headTitles) ->handleFetch(function ($page, $pageSize, $search, $param) { $result = $query->paginate($pageSize, ['*'], 'page', $page)->toArray(); $list = []; foreach ($result['data'] as $item) { $one = []; $one[] = $item['checkCode']; $one[] = $item['created_at']; $one[] = $item['memberUserId']; $list[] = $one; } return [ 'list' => $list, 'total' => $result['total'], ]; }) ->performExcel(); }
1 联合查询可使用Laravel的模型关联,参考以下代码。
protected function crud(AdminCRUDBuilder $builder) { MemberFieldUtil::register(); $builder ->init(WenkuDocDownload::with('doc')) ->field(function ($builder) { /** @var HasFields $builder */ $builder->id('id', 'ID')->editable(false); $builder->display('created_at', '时间')->editable(true); $builder->adminMemberInfo('memberUserId', '用户')->memberFieldName(['phone', 'username']); $builder->display('doc.title', '文档')->asLink(modstart_web_url('doc/{doc.hash}')); $builder->display('creditCost', '积分'); $builder->display('moneyCost', '金额'); }) ->gridFilter(function (GridFilter $filter) { $filter->like('doc.title', '文档标题'); $filter->eq('memberUserId', '用户ID'); $filter->eq('memberUser.username', '用户名'); $filter->eq('memberUser.phone', '用户手机'); $filter->eq('docId', '文档ID'); }) ->disableCUD()->canShow(false) ->title('文档下载记录'); }