Example #1
0
 public function update()
 {
     if (!$_GET['editMine']) {
         return parent::update();
     }
     $this->pretreatment();
     $model = D("User");
     $model->where("id=" . $this->user["id"])->save($_POST);
 }
 public function update()
 {
     vendor("common");
     $res = FS("Image")->save($key = 'shop_logo', $dir = 'share', $is_thumb = false, $whs = array(), $is_delete_origin = false, $is_water = false);
     if ($res) {
         $_POST['shop_logo'] = $res['url'];
     }
     Cookie::set('_currentUrl_', null);
     parent::update();
 }
 public function update()
 {
     if (!isset($_POST['is_flash'])) {
         $_POST['is_flash'] = 0;
         $_POST['flash_style'] = '';
     }
     $_POST['width'] = intval($_POST['width']);
     $_POST['height'] = intval($_POST['height']);
     parent::update();
 }
 public function update()
 {
     $desc = trim($_REQUEST['desc']);
     unset($_POST['conditions']);
     $_POST['allow_group'] = '';
     if (isset($_POST['allow_gid'])) {
         $_POST['allow_group'] = implode(',', $_POST['allow_gid']);
     }
     parent::update();
 }
 public function update()
 {
     Vendor("common");
     $pid = intval($_REQUEST['pid']);
     $share_id = D('ForumPost')->where("pid = '{$pid}'")->getField('share_id');
     if ($share_id > 0) {
         $content = trim($_REQUEST['content']);
         FS("Share")->updateShare($share_id, '', $content);
     }
     parent::update();
 }
 public function update()
 {
     $model = D("StockProductList");
     $model->where(array("factory_code_all" => $_POST["factory_code_all"]))->save(array("unit_price" => $_POST["unit_price"], "cost" => $_POST["cost"]));
     $allow = array("id", "store_min", "store_max");
     $tmp = array();
     foreach ($_POST as $k => $v) {
         if (!in_array($k, $allow)) {
             continue;
         }
         $tmp[$k] = $v;
     }
     $_POST = $tmp;
     $this->dataModelAlias = null;
     parent::update();
 }
Example #7
0
 /**
  * 查询工具更新相关的方法
  * (non-PHPdoc)
  * @see CommonAction::update()
  */
 public function update()
 {
     // 把上传图片添加到指定文件夹中
     if ($_FILES['photo']['name']) {
         $info = $this->uploadPic();
     }
     // 判断是否有上传图片如果有删除原来图片
     if ($info) {
         $_POST['pic'] = $info[0]['savename'];
         //	echo ROOT_PATH.'/Www/upload/searchToolsPic/'.$_REQUEST['oldPic'];
         if (file_exists(ROOT_PATH . '/Www/upload/searchToolsPic/' . $_REQUEST['oldPic'])) {
             //echo "111111111";
             // 删除原来文件夹中存在的文件
             unlink(ROOT_PATH . '/Www/upload/searchToolsPic/' . $_REQUEST['oldPic']);
         }
     }
     unset($_REQUEST['oldPic']);
     // 调用父类的update方法
     parent::update();
 }
 public function update()
 {
     Vendor("common");
     $tid = intval($_REQUEST['tid']);
     $topic = D('AskThread')->where("tid = '{$tid}'")->find();
     if ($topic['share_id'] > 0) {
         $share_id = $topic['share_id'];
         $title = trim($_REQUEST['title']);
         $content = trim($_REQUEST['content']);
         if ($topic['title'] != $title || $topic['content'] != $content) {
             FS("Share")->updateShare($share_id, $title, $content);
         }
         if ($topic['title'] != $title) {
             FS("Ask")->updateTopicRec($tid, $title);
         }
     }
     parent::update();
 }
 public function update()
 {
     Vendor("common");
     $_POST['valid_time'] = strZTime($_POST['valid_time']);
     $gid = intval($_REQUEST['gid']);
     $goods = D('SecondGoods')->where("gid = '{$gid}'")->find();
     if ($goods['share_id'] > 0) {
         $share_id = $goods['share_id'];
         $title = trim($_REQUEST['name']);
         $content = trim($_REQUEST['content']);
         if ($goods['title'] != $title || $goods['content'] != $content) {
             FS("Share")->updateShare($share_id, $title, $content);
         }
     }
     parent::update();
 }
 public function update()
 {
     $_POST['tag_code'] = $_POST['tag_name'];
     parent::update();
 }
 public function update()
 {
     Vendor("common");
     $_POST['is_best'] = intval($_POST['is_best']);
     $_POST['is_top'] = intval($_POST['is_top']);
     $_POST['is_event'] = intval($_POST['is_event']);
     $tid = intval($_REQUEST['tid']);
     $topic = D('ForumThread')->where("tid = '{$tid}'")->find();
     if ($topic['share_id'] > 0) {
         $share_id = $topic['share_id'];
         $title = trim($_REQUEST['title']);
         $content = trim($_REQUEST['content']);
         if ($topic['title'] != $title || $topic['content'] != $content) {
             FS("Share")->updateShare($share_id, $title, $content);
         }
         if ($topic['title'] != $title) {
             FS("Topic")->updateTopicRec($tid, $title);
         }
         FS("Topic")->updateTopicCache($tid);
     }
     parent::update();
 }
 public function update()
 {
     if (!isset($_POST['is_flash'])) {
         $_POST['is_flash'] = 0;
         $_POST['flash_style'] = '';
     }
     $_POST['width'] = intval($_POST['width']);
     $_POST['height'] = intval($_POST['height']);
     // 管理员默认通过审核
     if ($status = getAdVerifyStatus()) {
         $_POST['name'] = $_POST['name'];
         // 直接更新广告内容
     } else {
         $_POST['code'] = $_POST['name'];
         // 存放到待审核字段中
         $status = 3;
         // 编辑未通过审核状态
     }
     $_POST['status'] = $status;
     // 默认广告未通过审核
     parent::update();
 }