public function update()
 {
     $data['id'] = $_REQUEST['id'];
     $data['name'] = $_REQUEST['name'];
     $data['second_price'] = $_REQUEST['second_price'];
     $data['market_price'] = $_REQUEST['market_price'];
     $data['start_time'] = strtotime($_REQUEST['start_time']);
     $data['end_time'] = strtotime($_REQUEST['end_time']);
     $data['remain'] = $_REQUEST['remain'];
     $data['cart_model'] = $_REQUEST['cart_model'];
     $data['detail'] = $_REQUEST['detail'];
     $data['effect'] = $_REQUEST['effect'];
     $data['status'] = $_REQUEST['status'];
     if ($_REQUEST['pics']) {
         $data['pics'] = json_encode($_REQUEST['pics']);
     }
     $model = CM("Activity");
     // 更新数据
     $list = $model->save($data);
     if (false !== $list) {
         //成功提示
         $this->success('编辑成功!', cookie('_currentUrl_'));
     } else {
         //错误提示
         $this->error('编辑失败!');
     }
 }
 public function index()
 {
     $model = CM("City");
     $map = $this->_search("City");
     //         $pid = $_REQUEST['pid'] ? $_REQUEST['pid'] : 0;
     //         $map['pid'] = $pid;
     $this->assign("map", $map);
     if (!empty($model)) {
         $this->_list($model, $map);
     }
     $this->display();
 }
Beispiel #3
0
 public function update()
 {
     //B('FilterString');
     $model = CM('Student');
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     // 更新数据
     $list = $model->save();
     if (false !== $list) {
         //成功提示
         $this->assign('jumpUrl', Cookie::get('_currentUrl_'));
         $this->success('编辑成功!');
     } else {
         //错误提示
         $this->error('编辑失败!');
     }
 }
 public function index()
 {
     $model = CM("merchant_bidding");
     $map = $this->_search("merchant_bidding");
     $merchantName = $_REQUEST['merchant_name'];
     if (!empty($merchantName)) {
         $merchantModel = M("Merchant");
         $merchant = $merchantModel->where("merchant_name='" . $merchantName . "'")->select();
         if ($merchant) {
             $map['merchant_id'] = $merchant[0]['id'];
         } else {
             $map['merchant_id'] = 0;
         }
     }
     $this->assign("map", $map);
     if (!empty($model)) {
         $this->_list($model, $map);
     }
     $this->display();
 }
 public function insert()
 {
     $_POST['editor_id'] = $_SESSION[C('USER_AUTH_KEY')];
     $_POST['createtime'] = time();
     $_POST['status'] = '1';
     $name = $this->getActionName();
     $model = CM($name);
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     //保存当前数据对象
     $list = $model->add();
     if ($list !== false) {
         //保存成功
         $this->assign('jumpUrl', Cookie::get('_currentUrl_'));
         $this->success('新增成功!');
     } else {
         //失败提示
         $this->error('新增失败!');
     }
 }
Beispiel #6
0
 public function pj()
 {
     $name = 'Student';
     $model = CM($name);
     $pk = $model->getPk();
     $time_id = $_REQUEST[$pk];
     if ($_POST['account'] || $_POST['nickname'] || $_POST['class_id'] || $_POST['dormitory_id'] || $_POST['gender']) {
         if ($_POST['account']) {
             $map2['account'] = array('like', "%" . $_POST['account'] . "%");
         }
         if ($_POST['nickname']) {
             $map2['nickname'] = array('like', "%" . $_POST['nickname'] . "%");
         }
         if ($_POST['gender']) {
             $map2['gender'] = array('like', "%" . $_POST['gender'] . "%");
         }
         if ($_POST['class_id']) {
             $map2['class_id'] = array('eq', $_POST['class_id']);
         }
         if ($_POST['dormitory_id']) {
             $map2['dormitory_id'] = array('eq', $_POST['dormitory_id']);
         }
         $ids = M('Student')->where($map2)->select();
         foreach ($ids as $key => $value) {
             $idss[] = $value['id'];
         }
         $map['id'] = array('in', $idss);
         $time_id = $_POST['time_id'];
     }
     $model = CM($name);
     if (!empty($model)) {
         $this->_list($model, $map);
     }
     $this->assign('time_id', $time_id);
     $this->display();
 }
 public function update()
 {
     $_POST['hdtime'] = strtotime($_POST['hdtime']);
     $name = $this->getActionName();
     $model = CM($name);
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     // 更新数据
     $list = $model->save();
     if (false !== $list) {
         //成功提示
         $this->assign('jumpUrl', Cookie::get('_currentUrl_'));
         $this->success('编辑成功!');
     } else {
         //错误提示
         $this->error('编辑失败!');
     }
 }
 public function _before_edit()
 {
     $model = CM(CONTROLLER_NAME);
     $this->assign('list', $model->field('id,name')->select());
 }
Beispiel #9
0
 function saveSort()
 {
     $seqNoList = $_POST['seqNoList'];
     if (!empty($seqNoList)) {
         //更新数据对象
         $name = $this->getActionName();
         $model = CM($name);
         $col = explode(',', $seqNoList);
         //启动事务
         $model->startTrans();
         foreach ($col as $val) {
             $val = explode(':', $val);
             $model->id = $val[0];
             $model->sort = $val[1];
             $result = $model->save();
             if (!$result) {
                 break;
             }
         }
         //提交事务
         $model->commit();
         if ($result !== false) {
             //采用普通方式跳转刷新页面
             $this->success('更新成功');
         } else {
             $this->error($model->getError());
         }
     }
 }
Beispiel #10
0
 public function update()
 {
     //B('FilterString');
     if (is_numeric($_POST['province'])) {
         $_POST['province'] = getProvince($_POST['province']);
         $_POST['city'] = getCity($_POST['city']);
         $_POST['dist'] = getDistrict($_POST['dist']);
     }
     $_POST['birthday'] = strtotime($_POST['birthday']);
     $name = $this->getActionName();
     $model = CM($name);
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     // 更新数据
     $list = $model->save();
     if (false !== $list) {
         //成功提示
         $this->assign('jumpUrl', Cookie::get('_currentUrl_'));
         $this->success('编辑成功!');
     } else {
         //错误提示
         $this->error('编辑失败!');
     }
 }
Beispiel #11
0
function get_child($item_parent, &$result)
{
    $where['item_parent'] = $item_parent;
    $res = CM('cm_list_item')->where($where)->select();
    if (count($res) > 0) {
        foreach ($res as $row) {
            $result[] = $row;
            get_child($row['list_item_id'], $result);
        }
    }
}
 function update($dwz_db_name = '')
 {
     $group_id = $_POST['group_id'];
     $uid = $_POST['id'];
     $dwz_db_name = $dwz_db_name ? $dwz_db_name : strtolower(CONTROLLER_NAME);
     $model = CM($dwz_db_name);
     if (false === $model->create()) {
         $this->error($model->getError());
     }
     // 更新数据
     $list = $model->save();
     if (false === $list) {
         //错误提示
         $this->error('编辑失败!');
     } else {
         //成功提示
         $this->editRole($uid, $group_id);
         $this->success('编辑成功!', cookie('_currentUrl_'));
     }
 }
Beispiel #13
0
 public function resumeregister()
 {
     //恢复指定记录
     $name = 'Register_data';
     $model = CM($name);
     $pk = $model->getPk();
     $id = $_GET[$pk];
     $condition = array($pk => array('in', $id));
     if (false !== $model->resume($condition)) {
         $model->where('id=' . $id)->setField('registertime', time());
         $this->assign("jumpUrl", $this->getReturnUrl());
         $this->success('注册成功!');
     } else {
         $this->error('注册失败!');
     }
 }
 function update()
 {
     $model = CM("Service");
     $data['id'] = $_REQUEST['id'];
     $data['name'] = $_REQUEST['name'];
     $data['merchant_id'] = $_REQUEST['merchant_id'];
     $data['province_id'] = $_REQUEST['province_id'];
     $data['city_id'] = $_REQUEST['city_id'];
     $data['area_id'] = $_REQUEST['area_id'];
     $data['pcat_id'] = $_REQUEST['pcat_id'];
     $data['cat_id'] = $_REQUEST['cat_id'];
     $data['intro'] = $_REQUEST['intro'];
     $data['price'] = $_REQUEST['price'];
     $data['timeout'] = $_REQUEST['timeout'];
     if ($_REQUEST['pics']) {
         $data['pics'] = json_encode($_REQUEST['pics']);
     }
     // 更新数据
     $list = $model->save($data);
     if (false !== $list) {
         //成功提示
         $this->success('编辑成功!', cookie('_currentUrl_'));
     } else {
         //错误提示
         $this->error('编辑失败!');
     }
 }