...
|
...
|
@@ -1859,13 +1859,12 @@ class User extends Api |
|
|
$this->error(['code'=>2,'msg'=>'sql执行失败']);
|
|
|
}else{
|
|
|
$send = new Pay();
|
|
|
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
//修改用户余额以及订单状态 同时给用户发送短信
|
|
|
$update = $user['money'] - $param['total'];
|
|
|
Db::name('user')->where('id',$param['user_id'])->update(['money'=>$update]);
|
|
|
Db::name('iphone')->where('id',$data_order)->update(['status'=>2]);
|
|
|
|
|
|
|
|
|
//查询订单数据
|
|
|
$order_info = Db::name('iphone')->where('id',$data_order)->find();
|
|
|
//用户购买的什么素材
|
...
|
...
|
@@ -1893,7 +1892,13 @@ class User extends Api |
|
|
}
|
|
|
//发送短信
|
|
|
$send->sms($mobile,$content);
|
|
|
}
|
|
|
Db::commit();
|
|
|
$this->success('success');
|
|
|
} catch (\Exception $e) {
|
|
|
// 回滚事务
|
|
|
Db::rollback();
|
|
|
$this->error('error');
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|