diff --git a/source/application/api/controller/pass/Create.php b/source/application/api/controller/pass/Create.php index 9a88448..7ebcd57 100644 --- a/source/application/api/controller/pass/Create.php +++ b/source/application/api/controller/pass/Create.php @@ -58,6 +58,7 @@ class Create extends Controller ]; if ($query) { + $this->mergeYearlyData($insert_arr); # 判断数据是否发生变化, 发生变化及更新 $queryUpdate = $dm->find('bt_passenger_flow',$insert_arr); if (!$queryUpdate) { @@ -108,7 +109,7 @@ class Create extends Controller ]; if ($query) { - + $this->mergeYearlyData($insert_arr); $updateQuery = $dm->find('bt_passenger_flow_all',$insert_arr); if (!$updateQuery) { $dm->update('bt_passenger_flow_all',$insert_arr,['id' => $query['id']]); @@ -123,6 +124,33 @@ class Create extends Controller return $this->renderSuccess(); } + protected function mergeYearlyData(&$val) + { + if ($val['granularity'] == 'yearly' && date("Y") == '2023') { + $mergeData = [ + '110' => [ + 'flowInNum' => 0, + 'noRepeatInNum' => 0, + ], + '210' => [ + 'flowInNum' => 0, + 'noRepeatInNum' => 0, + ], + '310' => [ + 'flowInNum' => 0, + 'noRepeatInNum' => 0, + ], + '510' => [ + 'flowInNum' => 0, + 'noRepeatInNum' => 0, + ], + ]; + + $val['flowInNum'] = bcadd($val['flowInNum'],$mergeData[$val['groupId']]['flowInNum']); + $val['noRepeatInNum'] = bcadd($val['noRepeatInNum'],$mergeData[$val['groupId']]['noRepeatInNum']); + } + } + /** * 创建总客流统计数据 * @return array diff --git a/web/create_bt_library_data.php b/web/create_bt_library_data.php index 658b89c..221bbc1 100644 --- a/web/create_bt_library_data.php +++ b/web/create_bt_library_data.php @@ -10,8 +10,8 @@ $config = require_once __DIR__ . '../../source/application/database.php'; $dm = new Dm($config['connections']['dm']); -$countBaz = '200000'; -$countBaf = '50000'; +$countBaz = '376378'; +$countBaf = '28100'; $data = [ 'baz001' => [ diff --git a/web/create_pass_all.php b/web/create_pass_all.php index 2caeb8b..a5bd892 100644 --- a/web/create_pass_all.php +++ b/web/create_pass_all.php @@ -201,6 +201,10 @@ foreach ($groupArr as $groupId => $val) { $dm->update('bt_passenger_flow',$update,'"id" = ' . "'{$querySum['id']}'"); } + + echo "
";
+    var_dump($groupId);
+    var_dump($sumFlowInNum);
 }
 
 //var_dump($returnData);