From 944a424b3ccec08abed3d2a1b0c2b66b4738a5c4 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Mon, 6 Jul 2020 11:40:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=82=E5=9C=BA=E4=B8=93=E5=91=98=E4=B8=9A?= =?UTF-8?q?=E7=BB=A9=E6=8F=90=E6=88=90bug=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MarketPercentageController.class.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/MarketPercentageController.class.php b/Application/Admin/Controller/MarketPercentageController.class.php index ab5443d27..5edb9c892 100644 --- a/Application/Admin/Controller/MarketPercentageController.class.php +++ b/Application/Admin/Controller/MarketPercentageController.class.php @@ -632,19 +632,25 @@ class MarketPercentageController extends ThinkController $data['time'] = strtotime($data['timestart']); $data['create_time'] = time(); - $is_save = M("tax_radio","tab_")->add($data); + $is_hav = M("tax_radio","tab_") + ->where(['time'=>strtotime($data['timestart'])]) + ->find(); - if ($is_save) { - $this->success("保存成功",U("index")); + if ($is_hav) { + $is_save = M("tax_radio","tab_") + ->where(['time'=>strtotime($data['timestart'])]) + ->add($data); } else { - $this->error("保存失败"); + $is_save = M("tax_radio","tab_")->add($data); } + $this->success("保存成功",U("index")); + } else { $data = M("tax_radio","tab_") ->field("tax_radio,time timestart") - ->order("time DESC") + ->order("create_time DESC") ->find(); $data['timestart'] = Date("Y-m",$data['timestart']);