当前位置: 首页>网络资讯 > 网站建设 >

phpcms v9在删除推送的数据报错解决方案

来源:灵动网络    点击:    日期:2015-10-11 08:29:41

phpcms v9在删除推送的数据时会报错:

MySQL Error : BIGINT UNSIGNED value is out of range in '(`web`.`v9_category`.`items` - 1)'
MySQL Errno : 1690
Message : BIGINT UNSIGNED value is out of range in '(`web`.`v9_category`.`items` - 1)'

解决:

phpcms\model\content_model.class.php

 

	private function update_category_items($catid,$action = 'add',$cache = 0) {
		$this->category_db = pc_base::load_model('category_model');
		if($action=='add') {
			$this->category_db->update(array('items'=>'+=1'),array('catid'=>$catid));
		}  else {
			//$this->category_db->update(array('items'=>'-=1'),array('catid'=>$catid));//注释掉这句
		}
		if($cache) $this->cache_items();
	}