作者 景龙
1 个管道 的构建 失败 耗费 0 秒

测试充值

@@ -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 }