统一web入口

This commit is contained in:
Yu Sun
2022-07-12 23:26:06 +08:00
parent 3148d70ed6
commit f841787187
2 changed files with 80 additions and 83 deletions

View File

@@ -12,13 +12,13 @@ class ENodeConfigure {
$exists = pg_query(sprintf(
"SELECT EXISTS(
SELECT 1 FROM hf_mes_scada_data_capture_node_configure WHERE code='%s'
)", $this -> post['code']
)", $this -> post -> code
));
if (pg_fetch_assoc($exists)['exists'] == 't') {
return "REPLICATED";
}
$table_name = "hf_mes_scada_data_capture_node_data_" . $this -> post['working_subclass'];
$table_name = "hf_mes_scada_data_capture_node_data_" . $this -> post -> working_subclass;
pg_query($this -> dbconn, "BEGIN");
$res[] = pg_query($this -> dbconn, sprintf(
@@ -37,7 +37,7 @@ class ENodeConfigure {
$res[] = pg_insert(
$this -> dbconn,
'hf_mes_scada_data_capture_node_configure',
$this -> post
(array) $this -> post
);
// 检查一下,如果超表已经有了就不要尝试重复创建了
$table_exists = pg_query(sprintf(
@@ -69,17 +69,17 @@ class ENodeConfigure {
$res[] = pg_delete(
$this -> dbconn,
'hf_mes_scada_data_capture_node_configure',
$this -> post,
(array) $this -> post,
);
$exists = pg_query(sprintf(
"SELECT EXISTS(
SELECT 1 FROM hf_mes_scada_data_capture_node_configure WHERE code='%s'
)", $this -> post['working_subclass']
)", $this -> post -> working_subclass
));
if (pg_fetch_assoc($exists)['exists'] == 'f') {
$res[] = pg_query(sprintf(
"DROP TABLE hf_mes_scada_data_capture_node_data_%s",
$this -> post['working_subclass']
$this -> post -> working_subclass
));
}
@@ -96,8 +96,8 @@ class ENodeConfigure {
return pg_update(
$this -> dbconn,
'hf_mes_scada_data_capture_node_configure',
$this -> post,
['code' => $this -> post['code']]
(array) $this -> post,
['code' => $this -> post -> code]
);
}