From 169b2abbd035beffae4c3d26210ba9ac2552562c Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Tue, 25 Jul 2023 16:42:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/application/api/controller/pass/Create.php | 7 ++++--- source/application/common/dm/Dm.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/application/api/controller/pass/Create.php b/source/application/api/controller/pass/Create.php index 4454d12..61dce69 100644 --- a/source/application/api/controller/pass/Create.php +++ b/source/application/api/controller/pass/Create.php @@ -82,7 +82,7 @@ class Create extends Controller # 判断数据是否发生变化, 发生变化及更新 $queryUpdate = $dm->find('bt_passenger_flow',$insert_arr); if (!$queryUpdate) { - $dm->update('bt_passenger_flow',$queryUpdate,['id' => $query['id']]); + $dm->update('bt_passenger_flow',$insert_arr,['id' => $query['id']]); } } else { $dm->insert('bt_passenger_flow',$insert_arr); @@ -128,8 +128,9 @@ class Create extends Controller if ($query) { $updateQuery = $dm->find('bt_passenger_flow_all',$insert_arr); - if (!$updateQuery) $dm->update('bt_passenger_flow_all',$insert_arr,['id' => $query['id']]); - + if (!$updateQuery) { + $dm->update('bt_passenger_flow_all',$insert_arr,['id' => $query['id']]); + } } else { $dm->insert('bt_passenger_flow_all',$insert_arr); diff --git a/source/application/common/dm/Dm.php b/source/application/common/dm/Dm.php index d74cf63..aac5889 100644 --- a/source/application/common/dm/Dm.php +++ b/source/application/common/dm/Dm.php @@ -216,7 +216,7 @@ class Dm */ protected function where($where,$glue = 'AND') { - if (!is_array($where)) $where = [$where]; + $where = [$where]; $where_conditions = []; $allow_operator = array('>', '<', '<>', '!=', '>=', '<=', '+=', '-=');