diff --git a/app/common/repositories/user/UserAssetsLogRepository.php b/app/common/repositories/user/UserAssetsLogRepository.php index 20aead5..cdf9614 100644 --- a/app/common/repositories/user/UserAssetsLogRepository.php +++ b/app/common/repositories/user/UserAssetsLogRepository.php @@ -16,6 +16,7 @@ namespace app\common\repositories\user; use app\common\dao\user\UserAssetsLogDao; use app\common\repositories\BaseRepository; use app\common\repositories\store\order\StoreOrderBaseRepository; +use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\store\product\ProductAssistRepository; use app\common\repositories\store\product\ProductRepository; use app\common\repositories\system\groupData\GroupDataRepository; @@ -761,6 +762,7 @@ class UserAssetsLogRepository extends BaseRepository $changeType = $this->getChangeType(); $assetsType = $this->getAssetType(); $userRepository = app(UserRepository::class); + $orderRepository = app(StoreOrderRepository::class); foreach ($data as $item) { $item['type'] = $changeType[$item['type']] ?? '未知'; $item['asset_type'] = $assetsType[$item['asset_type']] ?? '未知'; @@ -778,6 +780,11 @@ class UserAssetsLogRepository extends BaseRepository $item['user_nickname'] = '平台'; $item['user_phone'] = '未知'; } + $item['order_sn'] = ''; + if($item['order_id']){ + $order = $orderRepository->getDetail($item['order_id']); + $item['order_sn'] = $order['order_sn']; + } $list[] = $item; } return compact('count', 'list'); diff --git a/view/admin/src/views/marketing/assets/index.vue b/view/admin/src/views/marketing/assets/index.vue index 28c6669..6317934 100644 --- a/view/admin/src/views/marketing/assets/index.vue +++ b/view/admin/src/views/marketing/assets/index.vue @@ -74,6 +74,7 @@ + @@ -158,14 +159,14 @@ export default { exportTableToExcel(tableId, fileName) { /* 获取表格数据 */ const ws = XLSX.utils.table_to_sheet(document.getElementById(tableId)); - + /* 新建工作簿并添加工作表 */ const wb = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); - + /* 生成Excel文件 */ const wbout = XLSX.write(wb, { bookType: 'xlsx', type: 'binary' }); - + /* 字符串转ArrayBuffer */ function s2ab(s) { const buf = new ArrayBuffer(s.length); @@ -173,7 +174,7 @@ export default { for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF; return buf; } - + /* 保存文件 */ saveAs(new Blob([s2ab(wbout)], { type: 'application/octet-stream' }), fileName + '.xlsx'); },