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('>', '<', '<>', '!=', '>=', '<=', '+=', '-=');