Example #1
0
 function save_cell_value($id, $key)
 {
     if (empty($_POST['data'])) {
         $this->begin('index.php?ctl=goods/gtype&act=index');
         trigger_error(__('类型名称为必填项'), E_USER_ERROR);
         $this->end();
     }
     if ($key == 'name') {
         $otype = $this->system->loadModel('goods/gtype');
         if ($otype->checkTypeByName($_POST['data'], $id)) {
             $otype->nameSave($id, $_POST['data']);
             parent::save_cell_value($id, $key);
         }
     }
 }
Example #2
0
 function save_cell_value($id, $key)
 {
     if ($key == 'bn') {
         $oGoods =& $this->system->loadModel('trading/goods');
         $gnum = $oGoods->checkGoodsValid($d = array('bn' => $_POST['data'], 'goods_id' => $id));
         if ($gnum > 0) {
             return;
         }
     } else {
         if ($key == 'name') {
             if (!empty($_POST['data'])) {
                 $oPro =& $this->system->loadModel('goods/products');
                 $oPro->setProNameByGoodsId($id, $_POST['data']);
             } else {
                 echo "商品名称不能为空";
                 exit;
             }
         }
     }
     parent::save_cell_value($id, $key);
 }
Example #3
0
 function save_cell_value($id, $key)
 {
     if ($key == "ordernum") {
         if (intval($_POST['data']) <= 0) {
             echo "排序必须为正整数";
             exit;
         }
     }
     parent::save_cell_value($id, $key);
 }