public function foreverdelete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; $ecv_type_id = 0; if (isset($id)) { $condition = array('id' => array('in', explode(',', $id))); $rel_data = M(MODULE_NAME)->where($condition)->findAll(); foreach ($rel_data as $data) { $info[] = $data['sn']; $ecv_type_id = $data['ecv_type_id']; } if ($info) { $info = implode(",", $info); } $list = M(MODULE_NAME)->where($condition)->delete(); if ($list !== false) { M("EcvType")->where("id=" . $ecv_type_id)->setField("gen_count", M("Ecv")->where("ecv_type_id=" . $ecv_type_id)->count()); save_log($info . l("FOREVER_DELETE_SUCCESS"), 1); $this->success(l("FOREVER_DELETE_SUCCESS"), $ajax); } else { save_log($info . l("FOREVER_DELETE_FAILED"), 0); $this->error(l("FOREVER_DELETE_FAILED"), $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function delete() { $id = intval($_REQUEST['id']); $tid = intval($_REQUEST['tid']); $data = M("TopicImage")->getById($id); if (!$data) { $this->ajaxReturn(l("IMAGE_NOT_EXIST"), "", 0); } $info = $data['topic_id'] . l("TOPIC_IMAGE"); // @unlink(APP_ROOT_PATH.$data['path']); // @unlink(APP_ROOT_PATH.$data['o_path']); $list = M("TopicImage")->where("id=" . $id)->delete(); if ($list !== false) { $Model = new Model(); $img_array = $Model->query("select path,o_path,width,height,id,name from " . DB_PREFIX . "topic_image where topic_id=" . $tid); $count_img = count($img_array); if ($count_img > 0) { $is_img = 1; } else { $is_img = 0; } $img_cache = serialize($img_array); $Model->query("update " . DB_PREFIX . "topic set image_list = '" . $img_cache . "' ,has_img=" . $is_img . " ,image_count=" . $count_img . " where id = " . $tid); save_log($info . l("DELETE_SUCCESS"), 0); $this->ajaxReturn("", "", 1); } else { save_log($info . l("删除图片失败"), 0); $this->error(l("DELETE_FAILED"), $ajax); } }
public function delete($id) { $this->user->soft_delete($id); save_log('Excluiu usuário id: ' . $id); flashdata('Usuário excluído com Sucesso!'); redirect('app/users'); }
public function update() { //$data = M(MODULE_NAME)->create (); $data = array(); $data['id'] = intval($_REQUEST['id']); $data['name'] = strim($_REQUEST['name']); //$data['content'] = $_REQUEST['content']; $data['content'] = stripslashes($_REQUEST['content']); $data['is_html'] = intval($_REQUEST['is_html']); $return = array('info' => '', 'status' => '0'); if ($data['name'] == '' || $data['id'] == 0) { $info = l("SELECT_MSG_TPL"); header("Content-Type:text/html; charset=utf-8"); echo $info; } $log_info = $data['name']; // 更新数据 $list = M(MODULE_NAME)->save($data); if (false !== $list) { //成功提示 save_log($log_info . L("UPDATE_SUCCESS"), 1); $info = '"' . L("LANG_" . $data['name']) . '"模板' . L("UPDATE_SUCCESS"); $return['status'] = 1; header("Content-Type:text/html; charset=utf-8"); echo $info; } else { //错误提示 save_log($log_info . L("UPDATE_FAILED"), 0); $info = L("LANG_" . $data['name']) . "模板" . L("UPDATE_FAILED"); $return['status'] = 0; header("Content-Type:text/html; charset=utf-8"); echo $info; } }
public function delete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; if (isset($id)) { $condition = array('id' => array('in', explode(',', $id))); $rel_data = M(MODULE_NAME)->where($condition)->findAll(); $list = M(MODULE_NAME)->where($condition)->delete(); foreach ($rel_data as $data) { $info[] = "[单号:" . $data['notice_sn'] . "]"; } if ($info) { $info = implode(",", $info); } if ($list !== false) { save_log($info . "成功删除", 1); $this->success("成功删除", $ajax); } else { save_log($info . "删除出错", 0); $this->error("删除出错", $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function update() { $conf_res = M("Conf")->where("is_effect = 1 and is_conf = 1")->findAll(); foreach ($conf_res as $k => $v) { conf($v['name'], $_REQUEST[$v['name']]); if ($v['name'] == 'URL_MODEL' && $v['value'] != $_REQUEST[$v['name']]) { clear_dir_file(get_real_path() . "public/runtime/app/data_caches/"); clear_dir_file(get_real_path() . "public/runtime/app/tpl_caches/"); clear_dir_file(get_real_path() . "public/runtime/app/tpl_compiled/"); clear_dir_file(get_real_path() . "public/runtime/app/data_caches/"); clear_dir_file(get_real_path() . "public/runtime/data/page_static_cache/"); clear_dir_file(get_real_path() . "public/runtime/data/dynamic_avatar_cache/"); } } //开始写入配置文件 $sys_configs = M("Conf")->findAll(); $config_str = "<?php\n"; $config_str .= "return array(\n"; foreach ($sys_configs as $k => $v) { $config_str .= "'" . $v['name'] . "'=>'" . addslashes($v['value']) . "',\n"; } $config_str .= ");\n ?>"; $filename = get_real_path() . "public/sys_config.php"; if (!($handle = fopen($filename, 'w'))) { $this->error(l("OPEN_FILE_ERROR") . $filename); } if (fwrite($handle, $config_str) === FALSE) { $this->error(l("WRITE_FILE_ERROR") . $filename); } fclose($handle); save_log(l("CONF_UPDATED"), 1); //clear_cache(); write_timezone(); $this->success(L("UPDATE_SUCCESS")); }
function all_reg_func($post_data, $session_data) { if ($post_data['load'] == 'Clients') { save_log('load table Clients', $session_data['user']); $all_reg = get_all_reg('Clients', 'id'); } if ($post_data['load'] == 'ClientsGarage') { save_log('load table ClientsGarage', $session_data['user']); $all_reg = get_all_reg('ClientsGarage', 'id'); } if ($post_data['load'] == 'ClientsLab') { save_log('load table ClientsLab', $session_data['user']); $all_reg = get_all_reg('ClientsLab', 'id'); } if ($post_data['load'] == 'ClientsFreddy') { save_log('load table ClientsFreddy', $session_data['user']); $all_reg = get_all_reg('ClientsFreddy', 'id'); } if ($post_data['load'] == 'ClientsRed') { save_log('load table red', $session_data['user']); $all_reg = get_all_reg('ClientsRed', 'id'); } if ($post_data['load'] == 'Clients007') { save_log('load table Clients007', $session_data['user']); $all_reg = get_all_reg('Clients007', 'id'); } if ($post_data['load'] == 'ClientsBunker') { save_log('load table Clients007', $session_data['user']); $all_reg = get_all_reg('ClientsBunker', 'id'); } return $all_reg; }
public function delete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; if (isset($id)) { $condition = array('id' => array('in', explode(',', $id))); $rel_data = M(MODULE_NAME)->where($condition)->findAll(); foreach ($rel_data as $data) { $info[] = "[" . $data['deal_name'] . $data['deal_price'] . "支持人:" . $data['user_name'] . "状态:" . $data['order_status'] . "]"; } if ($info) { $info = implode(",", $info); } $list = M(MODULE_NAME)->where($condition)->delete(); if ($list !== false) { // $deal_id=$GLOBALS['db']->getOne("select deal_id from ".DB_PREFIX."deal_order where id=$id"); // syn_deal($deal_id); save_log($info . "成功删除", 1); $this->success("成功删除", $ajax); } else { save_log($info . "删除出错", 0); $this->error("删除出错", $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function foreverdelete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; if (isset($id)) { $condition = array('id' => array('in', explode(',', $id))); $rel_data = M(MODULE_NAME)->where($condition)->findAll(); foreach ($rel_data as $data) { $info[] = $data['id']; } if ($info) { $info = implode(",", $info); } $list = M(MODULE_NAME)->where($condition)->delete(); if ($list !== false) { //将已返利的数字减一 foreach ($rel_data as $data) { M("User")->setDec('referral_count', "id=" . $data['rel_user_id']); // 用户返利次数减一 } save_log($info . l("FOREVER_DELETE_SUCCESS"), 1); $this->success(l("FOREVER_DELETE_SUCCESS"), $ajax); } else { save_log($info . l("FOREVER_DELETE_FAILED"), 0); $this->error(l("FOREVER_DELETE_FAILED"), $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function foreverdelete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; if (isset($id)) { $condition = array('id' => array('in', explode(',', $id))); $rel_data = M(MODULE_NAME)->where($condition)->findAll(); foreach ($rel_data as $data) { $info[] = $data['name']; } if ($info) { $info = implode(",", $info); } $list = M(MODULE_NAME)->where($condition)->delete(); if ($list !== false) { clear_auto_cache("cache_shop_cate"); save_log($info . l("FOREVER_DELETE_SUCCESS"), 1); $this->success(l("FOREVER_DELETE_SUCCESS"), $ajax); } else { save_log($info . l("FOREVER_DELETE_FAILED"), 0); $this->error(l("FOREVER_DELETE_FAILED"), $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function update_debit() { $borrow_amount_cfg = array(); foreach ($_REQUEST["borrow_amount_cfg"] as $k => $v) { if ($v != "") { $borrow_amount_cfg[] = htmlspecialchars(addslashes(trim($v))); } } $data = array(); $data["borrow_amount_cfg"] = serialize($borrow_amount_cfg); $data["loantype"] = intval($_REQUEST["loantype"]); $data["services_fee"] = floatval($_REQUEST["services_fee"]); $data["manage_fee"] = floatval($_REQUEST["manage_fee"]); $data["manage_impose_fee_day1"] = strim($_REQUEST["manage_impose_fee_day1"]); $data["manage_impose_fee_day2"] = strim($_REQUEST["manage_impose_fee_day2"]); $data["impose_fee_day1"] = strim($_REQUEST["impose_fee_day1"]); $data["impose_fee_day2"] = strim($_REQUEST["impose_fee_day2"]); $data["rate_cfg"] = intval($_REQUEST["rate_cfg"]); $data["enddate"] = intval($_REQUEST["enddate"]); $data["first_relief"] = floatval($_REQUEST["first_relief"]); $count = $GLOBALS["db"]->getOne("select count(*) from " . DB_PREFIX . "debit_conf"); if ($count == 0) { $GLOBALS['db']->autoExecute(DB_PREFIX . "debit_conf", $data); } else { $GLOBALS['db']->autoExecute(DB_PREFIX . "debit_conf", $data, "UPDATE", " 1=1 "); } save_log(l("DEBIT_UPDATED"), 1); $this->success(L("UPDATE_SUCCESS")); }
public function foreverdelete() { //删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; if (!empty($id)) { $name = $this->getActionName(); $model = D($name); $pk = $model->getPk(); $condition = array($pk => array('in', explode(',', $id))); $res = $model->where($condition)->findAll(); if (false !== $model->where($condition)->delete()) { foreach ($res as $k => $v) { $count = $model->where("dp_id=" . $v['dp_id'])->count(); M("SupplierLocationDp")->where("id=" . $v['dp_id'])->setField("reply_count", $count); } save_log($res . l("FOREVER_DELETE_SUCCESS"), 1); $this->success(l("FOREVER_DELETE_SUCCESS"), $ajax); } else { save_log($res . l("FOREVER_DELETE_FAILED"), 0); $this->error(l("FOREVER_DELETE_FAILED"), $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function delete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; if (isset($id)) { $condition = array('id' => array('in', explode(',', $id))); $rel_data = M(MODULE_NAME)->where($condition)->count(); $list = M(MODULE_NAME)->where($condition)->delete(); if ($list !== false) { foreach ($rel_data as $k => $v) { if ($v['log_id'] == 0) { $GLOBALS['db']->query("update " . DB_PREFIX . "deal set comment_count = comment_count - 1 where id = " . $v['deal_id']); } } save_log($info . "成功删除", 1); $this->success("成功删除", $ajax); } else { save_log($info . "删除出错", 0); $this->error("删除出错", $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function refuse() { $id = intval($_REQUEST['id']); $ajax = intval($_REQUEST['ajax']); $info = "活动报名ID:" . $id; require_once APP_ROOT_PATH . "system/model/event.php"; refuse_event_submit($id); save_log($info . "报名审核被拒绝", 1); $this->success("操作成功"); }
function write_comment() { $info = load_log(); $tag = isset($_GET["tag"]) ? $_GET["tag"] : ""; $memo = isset($_GET["memo"]) ? $_GET["memo"] : ""; if (empty($info[$tag]["comment"])) { $info[$tag]["comment"] = array(); } $info[$tag]["comment"][] = $memo; save_log($info); header("location:" . $_SERVER["SCRIPT_NAME"]); }
public function do_login() { $adm_name = trim($_REQUEST['adm_name']); $adm_password = trim($_REQUEST['adm_password']); $ajax = intval($_REQUEST['ajax']); //是否ajax提交 if ($adm_name == '') { $this->error(L('ADM_NAME_EMPTY', $ajax)); } if ($adm_password == '') { $this->error(L('ADM_PASSWORD_EMPTY', $ajax)); } if (es_session::get("verify") != md5($_REQUEST['adm_verify'])) { $this->error(L('ADM_VERIFY_ERROR'), $ajax); } $condition['adm_name'] = $adm_name; $condition['is_effect'] = 1; $condition['is_delete'] = 0; $adm_data = M("Admin")->where($condition)->find(); if ($adm_data) { if ($adm_data['adm_password'] != md5($adm_password)) { save_log($adm_name . L("ADM_PASSWORD_ERROR"), 0); //记录密码登录错误的LOG $this->error(L("ADM_PASSWORD_ERROR"), $ajax); } else { if ($adm_data['role_id'] != 6) { $this->error("您登录的角色不属于店铺系统,请检查您登录的系统是否正确!", $ajax); } else { //登录成功 $adm_session['adm_name'] = $adm_data['adm_name']; $adm_session['adm_id'] = $adm_data['id']; es_session::set(md5(conf("AUTH_KEY")), $adm_session); es_session::set('bid', $adm_data['id']); //商户就是admin es_session::set('role', $adm_data['role_id']); //role_id=6 是商户老板, role_id=7 是店铺老板 es_session::set('location_id', $GLOBALS['db']->getOne("select location_id from zsh_supplier_account_location_link where account_id=" . $adm_data['id'])); //店铺 //重新保存记录 $adm_data['login_ip'] = get_client_ip(); $adm_data['login_time'] = get_gmtime(); M("Admin")->save($adm_data); save_log($adm_data['adm_name'] . L("LOGIN_SUCCESS"), 1); $this->success(L("LOGIN_SUCCESS"), $ajax); } } } else { save_log($adm_name . L("ADM_NAME_ERROR"), 0); //记录用户名登录错误的LOG $this->error(L("ADM_NAME_ERROR"), $ajax); } }
public function set_effect() { $id = intval($_REQUEST['id']); $ajax = intval($_REQUEST['ajax']); $info = M("DealCity")->where("id=" . $id)->getField("name"); $c_is_effect = M("DealCity")->where("id=" . $id)->getField("is_effect"); //当前状态 $n_is_effect = $c_is_effect == 0 ? 1 : 0; //需设置的状态 M("DealCity")->where("id=" . $id)->setField("is_effect", $n_is_effect); save_log($info . l("SET_EFFECT_" . $n_is_effect), 1); $this->ajaxReturn($n_is_effect, l("SET_EFFECT_" . $n_is_effect), 1); }
public function foreverdelete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $condition = array("log_time" => array("lt", next_replay_month(TIME_UTC, -6))); $list = M(MODULE_NAME)->where($condition)->delete(); if ($list !== false) { save_log("清除半年前的记录", 1); $this->success(l("FOREVER_DELETE_SUCCESS"), $ajax); } else { save_log("清除半年前的记录", 0); $this->error(l("FOREVER_DELETE_FAILED"), $ajax); } }
public function save() { $post = $this->group->get_postdata(); if ($post['id']) { $this->group->update($post['id'], $post); flashdata('Grupo {name} atualizado com sucesso!', $post); save_log('Atualizou grupo: {id} -> {name}', $post); } else { $post['id'] = $this->group->save($post); flashdata('Grupo {name} cadastrado com sucesso!', $post); save_log('Cadastrou grupo: {id} -> {name}', $post); } ajax_redirect('groups'); }
public function set_effect() { $id = intval($_REQUEST['id']); $ajax = intval($_REQUEST['ajax']); $info = M(MODULE_NAME)->where("id=" . $id)->getField("name"); $c_is_effect = M(MODULE_NAME)->where("id=" . $id)->getField("status"); //当前状态 $n_is_effect = $c_is_effect == 0 ? 1 : 0; //需设置的状态 M(MODULE_NAME)->where("id=" . $id)->setField("status", $n_is_effect); save_log($info . l("SET_EFFECT_" . $n_is_effect), 1); rm_auto_cache("cache_nav_list"); $this->ajaxReturn($n_is_effect, l("SET_EFFECT_" . $n_is_effect), 1); }
/** * 按页读取数据 * @param array $param 选择参数 格式:请参考initSelectParam方法; * @param bool $isTotal 是否返回总记录数 */ public function selectPage($param = '', $isTotal = true) { $this->initSelectParam($param); if ($param['initPage'] === true) { $list['rows'] = $this->where($param['where'])->field($param['field'], $param['fieldExcept'])->order($param['sortOrder'])->select(); } else { $list['rows'] = $this->where($param['where'])->field($param['field'], $param['fieldExcept'])->order($param['sortOrder'])->page($param['page'], $param['pageSize'])->select(); } save_log('execute_sql', array('sql' => $this->getLastSql())); if ($isTotal) { $list['total'] = $this->where($param['where'])->count(); } return $this->returnListData($list); }
public function delete() { $id = intval($_REQUEST['id']); $data = M("TopicImage")->getById($id); if (!$data) { $this->ajaxReturn(l("IMAGE_NOT_EXIST"), "", 0); } $info = $data['topic_id'] . l("TOPIC_IMAGE"); @unlink(APP_ROOT_PATH . $data['path']); @unlink(APP_ROOT_PATH . $data['o_path']); M("TopicImage")->where("id=" . $id)->delete(); save_log($info . l("DELETE_SUCCESS"), 0); $this->ajaxReturn("", "", 1); }
public function deleteImg() { B('FilterString'); $ajax = intval($_REQUEST['ajax']); $file = $_REQUEST['file']; $file = explode("..", $file); $file = $file[4]; $file = substr($file, 1); @unlink(get_real_path() . $file); if (app_conf("PUBLIC_DOMAIN_ROOT") != '') { $syn_url = app_conf("PUBLIC_DOMAIN_ROOT") . "/es_file.php?username="******"IMAGE_USERNAME") . "&password="******"IMAGE_PASSWORD") . "&path=" . $file . "&act=1"; @file_get_contents($syn_url); } save_log(l("DELETE_SUCCESS"), 1); $this->success(l("DELETE_SUCCESS"), $ajax); }
public function do_login() { $adm_name = strim($_POST['adm_name']); $adm_password = trim(FW_DESPWD(trim($_POST['adm_password']))); $adm_dog_key = strim($_POST['adm_dog_key']); $ajax = intval($_REQUEST['ajax']); //是否ajax提交 if ($adm_name == '') { $this->error(L('ADM_NAME_EMPTY', $ajax)); } if ($adm_password == '') { $this->error(L('ADM_PASSWORD_EMPTY', $ajax)); } if (es_session::get("verify") != md5($_REQUEST['adm_verify'])) { $this->error(L('ADM_VERIFY_ERROR'), $ajax); } $condition['adm_name'] = $adm_name; $condition['is_effect'] = 1; $condition['is_delete'] = 0; $adm_data = M("Admin")->where($condition)->find(); if ($adm_data) { if ($adm_data['adm_password'] != md5($adm_password)) { save_log($adm_name . L("ADM_PASSWORD_ERROR"), 0); //记录密码登录错误的LOG $this->error(L("ADM_PASSWORD_ERROR"), $ajax); } else { //登录成功 $adm_session['adm_name'] = $adm_data['adm_name']; $adm_session['adm_id'] = $adm_data['id']; $adm_session['adm_dog_key'] = $adm_dog_key; es_session::set(md5(conf("AUTH_KEY")), $adm_session); //重新保存记录 $adm_data['login_ip'] = CLIENT_IP; $adm_data['login_time'] = TIME_UTC; M("Admin")->save($adm_data); save_log($adm_data['adm_name'] . L("LOGIN_SUCCESS"), 1); $this->success(L("LOGIN_SUCCESS"), $ajax); } } else { save_log($adm_name . L("ADM_NAME_ERROR"), 0); //记录用户名登录错误的LOG $this->error(L("ADM_NAME_ERROR"), $ajax); } }
public function save() { if (empty($_POST['hw'])) { $this->error("所添加热词为空"); } else { $hotword_file = APP_ROOT_PATH . "public/hotword.php"; $hotwords = trim($_POST['hw']); $r = @file_put_contents($hotword_file, $hotwords); $this->assign("jumpUrl", u(MODULE_NAME . "/index")); if ($r === FALSE) { $this->error("热词写入失败"); } else { //成功提示 $log_info = "热搜索词库"; save_log($log_info . L("INSERT_SUCCESS"), 1); $this->success(L("INSERT_SUCCESS")); } } }
/** * 异步加载信息:龄段 */ public function loadAct() { $type = I('get.type', ''); if ($type == 'stage') { //龄段 $stages = get_cache('Stage'); foreach ($stages as $k => $v) { $data[] = array('id' => $v['id'], 'name' => $v['name']); } save_log('load', $data); } elseif ($type == 'key') { //关键字 $proConf = get_pro_config_content('proConfig'); foreach ($proConf['keys'] as $k => $v) { $data[] = array('id' => $k, 'name' => $v); } } $this->ajaxReturn($data); }
public function foreverdelete() { //彻底删除指定记录 $ajax = intval($_REQUEST['ajax']); $id = $_REQUEST['id']; if (isset($id)) { $condition = array('id' => array('in', explode(',', $id))); $list = M(MODULE_NAME)->where($condition)->delete(); if ($list !== false) { save_log(l("FOREVER_DELETE_SUCCESS"), 1); $this->success(l("FOREVER_DELETE_SUCCESS"), $ajax); } else { save_log(l("FOREVER_DELETE_FAILED"), 0); $this->error(l("FOREVER_DELETE_FAILED"), $ajax); } } else { $this->error(l("INVALID_OPERATION"), $ajax); } }
public function do_change_password() { $adm_id = intval($_REQUEST['adm_id']); if (!check_empty($_REQUEST['adm_password'])) { $this->error(L("ADM_PASSWORD_EMPTY_TIP")); } if (!check_empty($_REQUEST['adm_new_password'])) { $this->error(L("ADM_NEW_PASSWORD_EMPTY_TIP")); } if ($_REQUEST['adm_confirm_password'] != $_REQUEST['adm_new_password']) { $this->error(L("ADM_NEW_PASSWORD_NOT_MATCH_TIP")); } if (M("Admin")->where("id=" . $adm_id)->getField("adm_password") != md5($_REQUEST['adm_password'])) { $this->error(L("ADM_PASSWORD_ERROR")); } M("Admin")->where("id=" . $adm_id)->setField("adm_password", md5($_REQUEST['adm_new_password'])); save_log(M("Admin")->where("id=" . $adm_id)->getField("adm_name") . L("CHANGE_SUCCESS"), 1); $this->success(L("CHANGE_SUCCESS")); }
public function update() { $data = M(MODULE_NAME)->create(); if ($data['name'] == '' || $data['id'] == 0) { $this->error(l("SELECT_MSG_TPL")); } $log_info = $data['name']; $this->assign("jumpUrl", u(MODULE_NAME . "/index")); // 更新数据 $list = M(MODULE_NAME)->save($data); if (false !== $list) { //成功提示 save_log($log_info . L("UPDATE_SUCCESS"), 1); $this->success(L("UPDATE_SUCCESS")); } else { //错误提示 save_log($log_info . L("UPDATE_FAILED"), 0); $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED")); } }
public function update() { B('FilterString'); $data = M(MODULE_NAME)->create(); //开始验证有效性 //$this->assign("jumpUrl",u(MODULE_NAME."/edit",array("id"=>$data['id']))); print_r($data); die; // 更新数据 $list = M(MODULE_NAME)->save($data); if (false !== $list) { //成功提示 save_log($log_info . L("UPDATE_SUCCESS"), 1); $this->success(L("UPDATE_SUCCESS")); } else { //错误提示 save_log($log_info . L("UPDATE_FAILED"), 0); $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED")); } }