<?php
class netsuserdaily extends netsDb {
	private $sysErrorClassID='0000';
	private $sysErrorFuncID=0;
	private $sysErrorID=0;
	
	public function netsuserdaily($pConnection){
		$this->netsDb($pConnection);
	}
	public function Check(&$pTableDescriptAR,$pExceptionAR1,$pExceptionAR2){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';

		if(count($pExceptionAR1)==0){
			$pExceptionAR1=array();
		}
		 parent::Check($pTableDescriptAR,$pExceptionAR1,$pExceptionAR2);
		//
		$tmpSTR='udtName';
		if(strlen($pTableDescriptAR[0]['Columns'][$tmpSTR]['Value'])<1 && !in_array($tmpSTR,$pExceptionAR2)){
			$this->sysLastError='提交内容错误:1.名称不能为空';
			return $this->sysErrorFuncID.'001';
		}
		
		return 0;
	}
	
	public function clearDaily(){
		$this->TransStart();
		//-- ------ ### ------ --
		//-- ### --
		$tmpSQL=' DROP TABLE IF EXISTS {Nets.TableHead}netsuserdaily; ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->sysLastError='操作失败:请稍换后再试或与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ### --
		$tmpSQL=' 
CREATE TABLE {Nets.TableHead}netsuserdaily (
  udtID int(11) NOT NULL auto_increment COMMENT \'ID\',
  udtName varchar(180) default \'-\' COMMENT \'名称\',
  udtNumCode varchar(42) default \'-\' COMMENT \'表内唯一编号\',
  udtType int(11) default \'0\' COMMENT \'操作类型:0.登陆,1.登出,2.找回密码,3.注销,4.验证邮箱\',
  udtState int(2) default \'0\' COMMENT \'找回密码状态:0.已发送,1.已过期,2.已完成\',
  udtCreateBy int(11) default \'0\' COMMENT \'发布人\',
  udtCreateTime datetime default NULL COMMENT \'发布时间\',
  udtIntroduct varchar(250) default NULL COMMENT \'简单说明\',
  udtValue_STR varchar(180) default \'-\' COMMENT \'值\',
  udtValue_INT int(11) default \'0\' COMMENT \'值\',
  udtValue_DECIMAL decimal(9,2) default \'0.00\' COMMENT \'值\',
  PRIMARY KEY  (udtID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

		';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->sysLastError='操作失败:请稍换后再试或与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ### --
		$tmpSQL=' DROP TABLE IF EXISTS {Nets.TableHead}netsuserdailycont; ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->sysLastError='操作失败:请稍换后再试或与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//-- ### --
		$tmpSQL=' 
CREATE TABLE {Nets.TableHead}netsuserdailycont (
  udctID int(11) NOT NULL auto_increment COMMENT \'ID\',
  udctIndexID int(11) default \'0\' COMMENT \'主表ID号\',
  udctIpAddress varchar(180) default \'127.0.0.1\' COMMENT \'操作IP地址\',
  udctIntroduct text COMMENT \'介绍\',
  PRIMARY KEY  (udctID),
  KEY umdctIndexID (udctIndexID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

		';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpINT=$this->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->sysLastError='操作失败:请稍换后再试或与客服人员联系';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		
		
		
		$this->TransCommit();
		return 0;
	}
	
	
}
?>