Browse Source

优化

master
wanghongjun 3 years ago
parent
commit
169b2abbd0
  1. 7
      source/application/api/controller/pass/Create.php
  2. 2
      source/application/common/dm/Dm.php

7
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);

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

Loading…
Cancel
Save