正在显示
1 个修改的文件
包含
10 行增加
和
3 行删除
@@ -211,11 +211,18 @@ class Wxpay extends Api | @@ -211,11 +211,18 @@ class Wxpay extends Api | ||
211 | if($data['return_code'] == 'SUCCESS' && $data['result_code'] == 'SUCCESS') { | 211 | if($data['return_code'] == 'SUCCESS' && $data['result_code'] == 'SUCCESS') { |
212 | $userModel = new User(); | 212 | $userModel = new User(); |
213 | $user = $userModel->where(['openid'=>$data['openid']])->find(); | 213 | $user = $userModel->where(['openid'=>$data['openid']])->find(); |
214 | + | ||
214 | $accountModel = new Account(); | 215 | $accountModel = new Account(); |
215 | - $money = $data['total_fee']/100; | ||
216 | - $account = $accountModel::create(['uid'=>$user['id'],'type'=>config('site.pay_charge'),'money'=>$money]); | 216 | + $accountModel->money = $data['total_fee']/100; |
217 | + $accountModel->uid = $user['id']; | ||
218 | + $accountModel->type = config('site.pay_charge'); | ||
219 | + $accountModel->save(); | ||
220 | + | ||
217 | $messageModel = new Message(); | 221 | $messageModel = new Message(); |
218 | - $messageModel::create(['account_id'=>$account->id,'title'=>config('site.message')]); | 222 | + $messageModel->account_id = $accountModel->id; |
223 | + $messageModel->type = config('site.pay_charge'); | ||
224 | + $messageModel->title = config('site.message'); | ||
225 | + $messageModel->save(); | ||
219 | //下面这句必须要执行,且在此之前不能有任何输出 | 226 | //下面这句必须要执行,且在此之前不能有任何输出 |
220 | $this->success('成功',$pay->success()); | 227 | $this->success('成功',$pay->success()); |
221 | } | 228 | } |
-
请 注册 或 登录 后发表评论