fix: fix #182,#170

This commit is contained in:
Spirit 2020-01-04 19:33:32 +08:00
parent 680d3b515f
commit 978937bb90
2 changed files with 4 additions and 4 deletions

View File

@ -1879,8 +1879,8 @@ function create_sakura_table()
$wpdb->insert($sakura_table_name, $privkey);
}
//reduce sql query
$sakura_image_array = $wpdb->get_var("SELECT `mate_value` FROM `wp_sakura` WHERE `mate_key`='manifest_json'");
$sakura_privkey = $wpdb->get_var("SELECT `mate_value` FROM `wp_sakura` WHERE `mate_key`='privkey'");
$sakura_image_array = $wpdb->get_var("SELECT `mate_value` FROM $sakura_table_name WHERE `mate_key`='manifest_json'");
$sakura_privkey = $wpdb->get_var("SELECT `mate_value` FROM $sakura_table_name WHERE `mate_key`='privkey'");
}
add_action('after_setup_theme', 'create_sakura_table');

View File

@ -399,8 +399,8 @@ function update_database() {
"mate_value" => date("Y-m-d H:i:s",time())
);
$wpdb->query("DELETE FROM `wp_sakura` WHERE `mate_key` ='manifest_json'");
$wpdb->query("DELETE FROM `wp_sakura` WHERE `mate_key` ='json_time'");
$wpdb->query("DELETE FROM $sakura_table_name WHERE `mate_key` ='manifest_json'");
$wpdb->query("DELETE FROM $sakura_table_name WHERE `mate_key` ='json_time'");
$wpdb->insert($sakura_table_name,$manifest);
$wpdb->insert($sakura_table_name,$time);
$output = "manifest.json has been stored into database.";