优化保存

master
chenzhi 4 years ago
parent 30d6f53582
commit a9951bd657

@ -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' => '保存成功'

Loading…
Cancel
Save