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

调试支付

... ... @@ -211,18 +211,12 @@ class Wxpay extends Api
if($data['return_code'] == 'SUCCESS' && $data['result_code'] == 'SUCCESS') {
$userModel = new User();
$user = $userModel->where(['openid'=>$data['openid']])->find();
$accountModel = new Account();
$accountModel->money = $data['total_fee']/100;
$accountModel->uid = $user['id'];
$accountModel->type = config('site.pay_charge');
$accountModel->save();
$money = $data['total_fee']/100;
$account = $accountModel::create(['uid'=>$user['id'],'type'=>config('site.pay_charge'),'money'=>$money]);
$messageModel = new Message();
$messageModel->account_id = $accountModel->id;
$messageModel->type = config('site.pay_charge');
$messageModel->title = config('site.message');
$messageModel->save();
$messageModel::create(['account_id'=>$account->id,'type'=>config('site.pay_charge'),'title'=>config('site.message')]);
//下面这句必须要执行,且在此之前不能有任何输出
$this->success('成功',$pay->success());
}
... ...