优化保存

master
chenzhi 4 years ago
parent a9951bd657
commit 5a303a6a7a

@ -82,13 +82,15 @@ class TransferMerchantController extends ThinkController
$idinfo = $this->TransferMerchant->field("id,ways")->where("id = {$id}")->find(); $idinfo = $this->TransferMerchant->field("id,ways")->where("id = {$id}")->find();
$idsave = [ $idsave = [
'id'=>$id, 'id'=>$id,
'ways'=>$idinfo['ways']-0+$ways 'ways'=>$idinfo['ways']-0+$ways,
'update_time'=>time()
]; ];
$this->TransferMerchant->save($idsave); $this->TransferMerchant->save($idsave);
//修改之前的 //修改之前的
$infosave = [ $infosave = [
'id'=>$info['id'], 'id'=>$info['id'],
'ways'=>$info['ways']-$ways 'ways'=>$info['ways']-$ways,
'update_time'=>time()
]; ];
$this->TransferMerchant->save($infosave); $this->TransferMerchant->save($infosave);
} }

Loading…
Cancel
Save