|
|
@@ -47,23 +47,70 @@ class UserExtract extends BaseController
|
|
47
|
47
|
*/
|
|
48
|
48
|
public function lst()
|
|
49
|
49
|
{
|
|
50
|
|
- [$page,$limit] = $this->getPage();
|
|
51
|
|
- $where = $this->request->params(['status','keyword','date','extract_type','mer_id','mer_name',['identity', '']]);
|
|
52
|
|
- if($where['mer_id']==''){
|
|
|
50
|
+ [$page, $limit] = $this->getPage();
|
|
|
51
|
+ $where = $this->request->params(['status', 'keyword', 'date', 'extract_type', 'mer_id', 'mer_name', ['identity', '']]);
|
|
|
52
|
+
|
|
|
53
|
+ // 导出
|
|
|
54
|
+ $is_excel = request()->param('is_excel', 0);
|
|
|
55
|
+
|
|
|
56
|
+ if ($where['mer_id'] == '') {
|
|
53
|
57
|
unset($where['mer_id']);
|
|
54
|
|
- }else if($where['mer_id']==0){
|
|
55
|
|
- $where['mer_id']='';
|
|
|
58
|
+ } else if ($where['mer_id'] == 0) {
|
|
|
59
|
+ $where['mer_id'] = '';
|
|
56
|
60
|
}
|
|
57
|
|
- $res = $this->repository->serach($where,$page,$limit);
|
|
58
|
|
- foreach ($res['list'] as $k=>$v){
|
|
59
|
|
- $res['list'][$k]['certification']= Db::name('user_certification')->where('uid', $v['uid'])->find();
|
|
60
|
|
- $res['list'][$k]['list']=$this->repository->get_user_extract_item($v['extract_id']);
|
|
61
|
|
- $res['list'][$k]['bank_info_data']=[];
|
|
62
|
|
- if($v['bank_info']){
|
|
63
|
|
- $res['list'][$k]['bank_info_data']=json_decode($v['bank_info'],true);
|
|
|
61
|
+ $res = $this->repository->serach($where, $page, $limit);
|
|
|
62
|
+ foreach ($res['list'] as $k => $v) {
|
|
|
63
|
+ $res['list'][$k]['certification'] = Db::name('user_certification')->where('uid', $v['uid'])->find();
|
|
|
64
|
+ $res['list'][$k]['list'] = $this->repository->get_user_extract_item($v['extract_id']);
|
|
|
65
|
+ $res['list'][$k]['bank_info_data'] = [];
|
|
|
66
|
+ if ($v['bank_info']) {
|
|
|
67
|
+ $res['list'][$k]['bank_info_data'] = json_decode($v['bank_info'], true);
|
|
64
|
68
|
}
|
|
65
|
69
|
|
|
66
|
70
|
}
|
|
|
71
|
+
|
|
|
72
|
+ if ($is_excel == 1) {
|
|
|
73
|
+ $data = $res['list'];
|
|
|
74
|
+ $arr = [];
|
|
|
75
|
+ foreach ($data as $item) {
|
|
|
76
|
+ $arr[] = [
|
|
|
77
|
+ // ID
|
|
|
78
|
+ $item['extract_id'],
|
|
|
79
|
+ // 申请时间
|
|
|
80
|
+ $item['create_time'],
|
|
|
81
|
+ // 手机号
|
|
|
82
|
+ $item['phone'],
|
|
|
83
|
+ // 用户信息
|
|
|
84
|
+ $item['real_name'],
|
|
|
85
|
+ // 提现金额
|
|
|
86
|
+ $item['extract_price'],
|
|
|
87
|
+ // 综合服务费
|
|
|
88
|
+ $item['service_money'],
|
|
|
89
|
+ // 实际到账金额
|
|
|
90
|
+ $item['extract_price'] - $item['service_money'],
|
|
|
91
|
+ // 提现方式
|
|
|
92
|
+ $item['extract_type'] == 1 ? '微信' : ($item['extract_type'] == 2 ? '支付宝' : '银行卡'),
|
|
|
93
|
+ // 所属银行
|
|
|
94
|
+ $item['bank_address'],
|
|
|
95
|
+ // 账号
|
|
|
96
|
+ $item['bank_code'],
|
|
|
97
|
+ ];
|
|
|
98
|
+ }
|
|
|
99
|
+ return app('json')->success($this->getStatisticsExcel([
|
|
|
100
|
+ 'ID',
|
|
|
101
|
+ '申请时间',
|
|
|
102
|
+ '手机号',
|
|
|
103
|
+ '用户信息',
|
|
|
104
|
+ '提现金额',
|
|
|
105
|
+ '综合服务费',
|
|
|
106
|
+ '实际到账金额',
|
|
|
107
|
+ '提现方式',
|
|
|
108
|
+ '所属银行',
|
|
|
109
|
+ '账号'
|
|
|
110
|
+ ], $arr, '订单明细'));
|
|
|
111
|
+ }
|
|
|
112
|
+
|
|
|
113
|
+
|
|
67
|
114
|
return app('json')->success($res);
|
|
68
|
115
|
}
|
|
69
|
116
|
|
|
|
@@ -271,4 +318,33 @@ class UserExtract extends BaseController
|
|
271
|
318
|
$res['brokerage_price'] = $user['brokerage_price'];
|
|
272
|
319
|
return app('json')->success($res);
|
|
273
|
320
|
}
|
|
|
321
|
+
|
|
|
322
|
+ public function getStatisticsExcel($header,$arr,$title)
|
|
|
323
|
+ {
|
|
|
324
|
+ $filename = $title.'_'.date('YmdHis').'_'.rand(10000,99999);
|
|
|
325
|
+ $name = $filename;
|
|
|
326
|
+ $info = '生成时间:' . date('Y-m-d H:i:s',time());
|
|
|
327
|
+ $suffix='xlsx';
|
|
|
328
|
+ $path='extract';
|
|
|
329
|
+ unset($_instance);
|
|
|
330
|
+
|
|
|
331
|
+ $_instance = SpreadsheetExcelService::instance_xin();
|
|
|
332
|
+
|
|
|
333
|
+ $_path =$_instance
|
|
|
334
|
+ ->createOrActive()
|
|
|
335
|
+ ->setExcelHeader($header)
|
|
|
336
|
+ ->setExcelTile($title, $name, $info)
|
|
|
337
|
+ ->setExcelContent($arr)
|
|
|
338
|
+ ->excelSave($filename, $suffix, $path);
|
|
|
339
|
+
|
|
|
340
|
+ $domain = request()->domain();
|
|
|
341
|
+ $data= [
|
|
|
342
|
+ 'name' => $filename.'.'.$suffix,
|
|
|
343
|
+ 'status' => 1,
|
|
|
344
|
+ 'path' => $domain.'/'.$_path
|
|
|
345
|
+ ];
|
|
|
346
|
+
|
|
|
347
|
+ return $data;
|
|
|
348
|
+ }
|
|
|
349
|
+
|
|
274
|
350
|
}
|