作者 郭盛
1 个管道 的构建 通过 耗费 1 秒

修改会员订单接口

... ... @@ -136,17 +136,22 @@ class Iphoneorder extends Backend
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
$user = Db::name('user')->where('id',$params['user_id'])->find();
//已经支付
if($params['status'] == 2){
//判断金额
if($params['money'] >= 8000){
$update['is_vip'] = 1;
$update['money'] = $user['money'] + $params['money'];
}else{
$update['money'] = $user['money'] + $params['money'];
//先查询一遍数据是否已经是支付状态
$data = Db::name('iphoneorder')->where('id',$ids)->find();
if($data['status'] == 1){
if($params['status'] == 2){
//判断金额
if($params['money'] >= 8000){
$update['is_vip'] = 1;
$update['money'] = $user['money'] + $params['money'];
}else{
$update['money'] = $user['money'] + $params['money'];
}
Db::name('user')->where('id',$user['id'])->update($update);
}
Db::name('user')->where('id',$user['id'])->update($update);
}
if ($params) {
$params = $this->preExcludeFields($params);
$result = false;
... ...