|
|
@@ -69,38 +69,131 @@ class GzcLogs extends BaseController
|
|
69
|
69
|
* created: 2021/3/24 13:56
|
|
70
|
70
|
*/
|
|
71
|
71
|
public function inGzc()
|
|
72
|
|
- {
|
|
73
|
|
- return app('json')->fail('不可执行');
|
|
74
|
|
- $params = $this->request->params(['account_type', 'bank_name', 'branch_name', 'bank_account', 'bank_no', 'alipay_account','alipay_no','wxpay_account','wxpay_no','deposit_dt']);
|
|
75
|
|
- Db::table('rrx_gzc_logs')
|
|
76
|
|
- ->where('gzc', 0)
|
|
77
|
|
- ->where('pension', '>', 0)
|
|
78
|
|
- ->update($params);
|
|
|
72
|
+ {
|
|
|
73
|
+ $id = intval($this->request->param('id'));
|
|
79
|
74
|
$cursor = Db::table('rrx_gzc_logs')
|
|
|
75
|
+ ->where('id', $id)
|
|
80
|
76
|
->where('gzc', 0)
|
|
|
77
|
+ ->where('success', 0)
|
|
81
|
78
|
->where('pension', '>', 0)
|
|
82
|
79
|
->cursor();
|
|
|
80
|
+
|
|
83
|
81
|
foreach($cursor as $log){
|
|
84
|
82
|
if (!$log){
|
|
85
|
83
|
return app('json')->fail('暂无记录');
|
|
86
|
84
|
}
|
|
87
|
|
- $phone= Db::table('rrx_user')->where('uid',$log['uid'])->value('phone');
|
|
88
|
|
- $OrderGzcRepository = app()->make(OrderGzcRepository::class);
|
|
89
|
|
- $uid = $OrderGzcRepository->register($phone);
|
|
90
|
|
- $OrderGzcRepository->gzc($uid,$log['pension']);
|
|
|
85
|
+ $mobile= $log['mobile'];
|
|
|
86
|
+ $user_name = Db::name('user_certification')->where('uid',$log['uid'])->value('user_name');
|
|
|
87
|
+ $user_card = Db::name('user_certification')->where('uid',$log['uid'])->value('user_card');
|
|
|
88
|
+ $card_positive = Db::name('user_certification')->where('uid',$log['uid'])->value('card_positive');
|
|
|
89
|
+ $card_reverse = Db::name('user_certification')->where('uid',$log['uid'])->value('card_reverse');
|
|
|
90
|
+ if(!$mobile || !$user_name || !$user_card || !$card_positive || !$card_reverse){
|
|
|
91
|
+ return app('json')->fail('暂无记录');
|
|
|
92
|
+ }
|
|
|
93
|
+
|
|
|
94
|
+ //发起入账gzc
|
|
|
95
|
+ $OrderGzcRepository = app()->make(OrderGzcRepository::class);
|
|
|
96
|
+ $register = $OrderGzcRepository->register($mobile);
|
|
|
97
|
+ if($register['status'] != 200) return app('json')->fail('入账失败:'.$register['message']);
|
|
|
98
|
+ $uid = $register['data']['uid'] ?? 0;
|
|
|
99
|
+ if(!$uid) return app('json')->fail('创建或获取用户失败');
|
|
|
100
|
+ $certification = $OrderGzcRepository->certification($uid, $mobile, $user_name, $user_card, $card_positive, $card_reverse);
|
|
|
101
|
+ if($certification['status'] != 200) return app('json')->fail('实名认证失败:'.$certification['message']);
|
|
|
102
|
+ $gzc = $OrderGzcRepository->gzc($uid,$log['pension']);
|
|
|
103
|
+ if($gzc['status'] != 200) return app('json')->fail('入账失败:'.$gzc['message']);
|
|
|
104
|
+ $gzc_deposit_no = $gzc['data'];
|
|
|
105
|
+ $gzc_confirm_result = $gzc['message'];
|
|
91
|
106
|
}
|
|
92
|
107
|
$OrderMerchantRepository = app()->make(OrderMerchantRepository::class);
|
|
93
|
108
|
$orderId = $OrderMerchantRepository->getNewOrderId('IN10');
|
|
94
|
109
|
Db::table('rrx_gzc_logs')
|
|
|
110
|
+ ->where('id', $id)
|
|
|
111
|
+ ->where('gzc', 0)
|
|
|
112
|
+ ->where('success', 0)
|
|
|
113
|
+ ->where('pension', '>', 0)
|
|
|
114
|
+ ->update([
|
|
|
115
|
+ 'gzc' => 1,
|
|
|
116
|
+ 'platform_no' => $orderId,
|
|
|
117
|
+ 'gzc_deposit_no' => $gzc_deposit_no,
|
|
|
118
|
+ 'gzc_confirm_result' => $gzc_confirm_result,
|
|
|
119
|
+ 'success' => 1,
|
|
|
120
|
+ 'update_time' => date('Y-m-d H:i:s')
|
|
|
121
|
+ ]);
|
|
|
122
|
+ return app('json')->success('发起成功');
|
|
|
123
|
+ }
|
|
|
124
|
+
|
|
|
125
|
+
|
|
|
126
|
+
|
|
|
127
|
+
|
|
|
128
|
+ /**
|
|
|
129
|
+ * 发起入账
|
|
|
130
|
+ * author: php迷途小书童
|
|
|
131
|
+ * created: 2021/3/24 13:56
|
|
|
132
|
+ */
|
|
|
133
|
+ public function inGzcAll()
|
|
|
134
|
+ {
|
|
|
135
|
+ $ids = intval($this->request->param('ids'));
|
|
|
136
|
+ if(!$ids) return app('json')->fail('请选择需要入账的记录');
|
|
|
137
|
+ $ids = explode(",", $ids);
|
|
|
138
|
+ if(!count($ids)){
|
|
|
139
|
+ return app('json')->fail('暂无记录');
|
|
|
140
|
+ }
|
|
|
141
|
+
|
|
|
142
|
+ $cursor = Db::table('rrx_gzc_logs')
|
|
|
143
|
+ ->whereIn('id', $ids)
|
|
95
|
144
|
->where('gzc', 0)
|
|
|
145
|
+ ->where('success', 0)
|
|
|
146
|
+ ->where('pension', '>', 0)
|
|
|
147
|
+ ->cursor();
|
|
|
148
|
+ foreach($cursor as $log){
|
|
|
149
|
+ if (!$log){
|
|
|
150
|
+ return app('json')->fail('暂无记录');
|
|
|
151
|
+ }
|
|
|
152
|
+ $mobile= $log['mobile'];
|
|
|
153
|
+ $user_name = Db::name('user_certification')->where('uid',$log['uid'])->value('user_name');
|
|
|
154
|
+ $user_card = Db::name('user_certification')->where('uid',$log['uid'])->value('user_card');
|
|
|
155
|
+ $card_positive = Db::name('user_certification')->where('uid',$log['uid'])->value('card_positive');
|
|
|
156
|
+ $card_reverse = Db::name('user_certification')->where('uid',$log['uid'])->value('card_reverse');
|
|
|
157
|
+ if(!$mobile || !$user_name || !$user_card || !$card_positive || !$card_reverse){
|
|
|
158
|
+ return app('json')->fail('暂无记录');
|
|
|
159
|
+ }
|
|
|
160
|
+
|
|
|
161
|
+ //发起入账gzc
|
|
|
162
|
+ $OrderGzcRepository = app()->make(OrderGzcRepository::class);
|
|
|
163
|
+ $register = $OrderGzcRepository->register($mobile);
|
|
|
164
|
+ if($register['status'] != 200) return app('json')->fail('入账失败:'.$register['message']);
|
|
|
165
|
+ $uid = $register['data']['uid'] ?? 0;
|
|
|
166
|
+ if(!$uid) return app('json')->fail('创建或获取用户失败');
|
|
|
167
|
+ $certification = $OrderGzcRepository->certification($uid, $mobile, $user_name, $user_card, $card_positive, $card_reverse);
|
|
|
168
|
+ if($certification['status'] != 200) return app('json')->fail('实名认证失败:'.$certification['message']);
|
|
|
169
|
+ $gzc = $OrderGzcRepository->gzc($uid,$log['pension']);
|
|
|
170
|
+ if($gzc['status'] != 200) return app('json')->fail('入账失败:'.$gzc['message']);
|
|
|
171
|
+ $gzc_deposit_no = $gzc['data'];
|
|
|
172
|
+ $gzc_confirm_result = $gzc['message'];
|
|
|
173
|
+
|
|
|
174
|
+ $OrderMerchantRepository = app()->make(OrderMerchantRepository::class);
|
|
|
175
|
+ $orderId = $OrderMerchantRepository->getNewOrderId('IN10');
|
|
|
176
|
+ Db::table('rrx_gzc_logs')
|
|
|
177
|
+ ->where('id', $log['id'])
|
|
|
178
|
+ ->where('gzc', 0)
|
|
|
179
|
+ ->where('success', 0)
|
|
96
|
180
|
->where('pension', '>', 0)
|
|
97
|
181
|
->update([
|
|
98
|
182
|
'gzc' => 1,
|
|
99
|
183
|
'platform_no' => $orderId,
|
|
|
184
|
+ 'gzc_deposit_no' => $gzc_deposit_no,
|
|
|
185
|
+ 'gzc_confirm_result' => $gzc_confirm_result,
|
|
|
186
|
+ 'success' => 1,
|
|
100
|
187
|
'update_time' => date('Y-m-d H:i:s')
|
|
101
|
188
|
]);
|
|
|
189
|
+ }
|
|
102
|
190
|
return app('json')->success('发起成功');
|
|
103
|
191
|
}
|
|
|
192
|
+
|
|
|
193
|
+
|
|
|
194
|
+
|
|
|
195
|
+
|
|
|
196
|
+
|
|
104
|
197
|
/**
|
|
105
|
198
|
* TODO 导出文件
|
|
106
|
199
|
* @author Qinii
|