diff --git a/plugins/cultural-space/src/models/CulturalSpace.php b/plugins/cultural-space/src/models/CulturalSpace.php index f42eecdb..02d311da 100644 --- a/plugins/cultural-space/src/models/CulturalSpace.php +++ b/plugins/cultural-space/src/models/CulturalSpace.php @@ -47,13 +47,17 @@ class CulturalSpace extends BaseModel ]); // 信息获取 $totalContribution = $model->sum('contribution'); - $list = $model->select(['id', 'uid', 'contribution']) + $totalVoucherNumber = $model->sum('voucher_number'); + $list = $model->select(['id', 'uid', 'contribution','voucher_number']) ->orderBy('id', 'DESC') ->paginate(10) ->toArray(); foreach ($list['data'] as &$item) { $item['total_proportion'] = (float)sprintf("%.2f", $totalContribution); $item['ratio'] = (float)sprintf("%.2f", $item['contribution'] / $totalContribution * 100); + + $item['total_voucher_number'] = (float)sprintf("%.6f", $totalVoucherNumber); + $item['voucher_number_ratio'] = (float)sprintf("%.6f", $item['voucher_number'] / $totalVoucherNumber * 100); } return $list; diff --git a/plugins/cultural-space/views/fund/index.blade.php b/plugins/cultural-space/views/fund/index.blade.php index ab55c40c..082d2231 100644 --- a/plugins/cultural-space/views/fund/index.blade.php +++ b/plugins/cultural-space/views/fund/index.blade.php @@ -72,6 +72,51 @@
历史文创豆:[[fundData.history_number || 0]]
+ + {{--搜索--}} + + + + + + 查询 + + + {{--表单--}} + + + + + + + + + + + + + + {{--搜索--}} @@ -98,10 +143,16 @@ - - - - + + + + + + @@ -148,18 +199,20 @@ let loading = _this.showLoading(); let link = "{!! yzWebUrl('plugin.cultural-space.admin.fund.getfund') !!}"; if(_this.tabs_active === 'show_group') link = "{!! yzWebUrl('plugin.cultural-space.admin.fund.getfundRecord') !!}"; + if(_this.tabs_active === 'show_user') link = "{!! yzWebUrl('plugin.cultural-space.admin.contribution.index') !!}"; $.ajax({ url: link, type: "post", data: { page: _this.page, search: _this.search_list, - is_get: 1 + is_get: 1, + tabs_active: 'show_group', }, success: function(result) { loading.close(0); let data = result.data; - if(_this.tabs_active != 'show_group'){ + if(_this.tabs_active == 'show_detail'){ _this.fundData= data; return; } @@ -201,7 +254,14 @@ spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)' }); - } + }, + // 用户持有统计中查看某个用户的变更记录 + seeChangeRecord(uid){ + this.search_list.member_id = uid; + this.page = 1; + this.tabs_active = 'show_group'; + this.getData() + }, }, })