Esempio n. 1
0
 /**
  * 价格配置段修改
  */
 public function editAction()
 {
     if ($this->_request->isPost()) {
         //修改密码验证
         $aCookie = Util_Cookie::get(Yaf_G::getConf('authkey', 'cookie'));
         $iAdminID = $aCookie['iAdminID'];
         $aUser = Model_Admin::getDetail($iAdminID);
         $pwd = $this->getParam('pwd');
         if (!isset($pwd) || $pwd == '') {
             return $this->showMsg('修改密码不可以为空', false);
         }
         if ($aUser['sEditPassword'] != md5($pwd)) {
             return $this->showMsg('修改密码不正确', false);
         }
         $aPrice = $this->_checkData('update');
         if (empty($aPrice)) {
             return null;
         }
         $aPrice['iAutoID'] = intval($this->getParam('iAutoID'));
         $aOldPrice = Model_Price::getDetail($aPrice['iAutoID']);
         if (empty($aOldPrice)) {
             return $this->showMsg('价格配置段不存在!', false);
         }
         if (1 == Model_Price::updData($aPrice)) {
             return $this->showMsg('价格配置段信息更新成功!', true);
         } else {
             return $this->showMsg('价格配置段信息更新失败!', false);
         }
     } else {
         $iPriceID = intval($this->getParam('id'));
         $aPrice = Model_Price::getDetail($iPriceID);
         $this->assign('aPrice', $aPrice);
     }
 }