function mdl_submit()
{
$_arr_appData = array("app_name" => $this->appSubmit["app_name"], "app_url_notify" => $this->appSubmit["app_url_notify"], "app_url_sync" => $this->appSubmit["app_url_sync"], "app_note" => $this->appSubmit["app_note"], "app_status" => $this->appSubmit["app_status"], "app_ip_allow" => $this->appSubmit["app_ip_allow"], "app_ip_bad" => $this->appSubmit["app_ip_bad"], "app_sync" => $this->appSubmit["app_sync"], "app_allow" => $this->appSubmit["app_allow"]);
if ($this->appSubmit["app_id"] < 1) {
$_str_appKey = fn_rand(64);
$_arr_insert = array("app_key" => $_str_appKey, "app_time" => time());
$_arr_data = array_merge($_arr_appData, $_arr_insert);
$_num_appId = $this->obj_db->insert(BG_DB_TABLE . "app", $_arr_data);
//更新数据
if ($_num_appId > 0) {
$_str_alert = "y050101";
//更新成功
} else {
return array("alert" => "x050101");
}
} else {
$_str_appKey = "";
$_num_appId = $this->appSubmit["app_id"];
$_num_mysql = $this->obj_db->update(BG_DB_TABLE . "app", $_arr_appData, "app_id=" . $_num_appId);
//更新数据
if ($_num_mysql > 0) {
$_str_alert = "y050103";
//更新成功
} else {
return array("alert" => "x050103");
}
}
return array("app_id" => $_num_appId, "app_key" => $_str_appKey, "alert" => $_str_alert);
}