添加订单编号

main
home.fengxinyhyl 6 months ago
parent 524bd10efb
commit 30bbc98dd2
  1. 7
      app/common/repositories/user/UserAssetsLogRepository.php
  2. 9
      view/admin/src/views/marketing/assets/index.vue

@ -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');

@ -74,6 +74,7 @@
<el-table-column label="用户昵称" prop="user_nickname" min-width="120"/>
<el-table-column label="手机" prop="user_phone" min-width="120"/>
<el-table-column label="货币类型" prop="asset_type" min-width="120"/>
<el-table-column label="订单编号" prop="order_sn" min-width="120"/>
<el-table-column label="分值来源" prop="type" min-width="120"/>
<el-table-column label="变动情况" prop="count" min-width="120"/>
<el-table-column label="变动时间" prop="create_time" min-width="120" />
@ -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');
},

Loading…
Cancel
Save