diff --git a/Application/Admin/Controller/TransferMerchantController.class.php b/Application/Admin/Controller/TransferMerchantController.class.php index c3dec95d4..a17c8bc71 100644 --- a/Application/Admin/Controller/TransferMerchantController.class.php +++ b/Application/Admin/Controller/TransferMerchantController.class.php @@ -73,31 +73,26 @@ class TransferMerchantController extends ThinkController if($ways == 1){ $info = $this->TransferMerchant->getStatementPaymentInfo(); - }elseif($ways == 2){ + } + if($ways == 2){ $info = $this->TransferMerchant->getUnderPaymentInfo(); } - $flag = false; - if($info['id'] == $id){ - $this->ajaxReturn([ - 'status' => 1, - 'message' => '保存成功' - ]); + if($info['id'] != $id){ + $idinfo = $this->TransferMerchant->field("id,ways")->where("id = {$id}")->find(); + $idsave = [ + 'id'=>$id, + 'ways'=>$idinfo['ways']-0+$ways + ]; + $this->TransferMerchant->save($idsave); + //修改之前的 + $infosave = [ + 'id'=>$info['id'], + 'ways'=>$info['ways']-$ways + ]; + $this->TransferMerchant->save($infosave); } - $idinfo = $this->TransferMerchant->field("id,ways")->where("id = {$id}")->find(); - $idsave = [ - 'id'=>$id, - 'ways'=>$idinfo['ways']-0+$ways - ]; - $this->TransferMerchant->save($idsave); - //修改之前的 - $infosave = [ - 'id'=>$info['id'], - 'ways'=>$info['ways']-$ways - ]; - $this->TransferMerchant->save($infosave); - $this->ajaxReturn([ 'status' => 1, 'message' => '保存成功'