<?php
class gsnavigationunit extends netsDb {
	private $sysErrorClassID='0000';
	private $sysErrorFuncID=0;
	private $sysErrorID=0;
	
	public function gsnavigationunit($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='gsnutName';
		if(strlen($pTableDescriptAR[0]['Columns'][$tmpSTR]['Value'])<1 && !in_array($tmpSTR,$pExceptionAR2)){
			$this->sysLastError='提交内容错误:1.名称不能为空';
			return $this->sysErrorFuncID.'001';
		}
		return 0;
	}
	
	public function initialObject($pID){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$tmpHtml=new netsHtml();
		$this->TransStart();
		//-- ------ #Check cookie exist ------ --
		//Get cookie
		$tmpCookieName=$this->sysCookieHead.'Cookie_Gsnavigationunit_'.$pID;
		$tmpAR0=$tmpHtml->AnalyerRequest($tmpCookieName,'',2);
		$tmpCookieValue=$tmpAR0[0];
		//-- ------ #Update data ------ --
		//-- #Update Discuss --
		$tmpCountConfigs=array();
		//#Info
		$tmpAR1=$this->sCountUpdateConfig_Template;
		$tmpAR1['Parent_TableName']=$this->sysTableHead.'gsnavigationunitcont';
		$tmpAR1['Parent_CountColumnName']='gsnuctCount_Discuss';
		$tmpAR1['Parent_Condition']=' AND gsnuctID='.$pID;
		$tmpAR1['Child_A_TableName']=$this->sysTableHead.'gsnavigationunitdiscuss';
		$tmpAR1['Child_A_CountColumnName']='gsnudtID';
		$tmpAR1['Child_A_Condition']=' AND gsnudtRecycle=0 AND gsnudtChecked>1 AND gsnudtParid='.$pID;
		$tmpCountConfigs[]=$tmpAR1;
		//#Group
		$tmpSQL=' SELECT A.gsnutID,A.gsnutParid
			FROM {Nets.TableHead}gsnavigationunit AS A 
			WHERE 1=1 AND A.gsnutRecycle=0 AND A.gsnutChecked>1 AND A.gsnutID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pID,$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		$tmpParid=0;
		if (count($tmpData0)>0) {
			$tmpParid=$tmpData0[0]['gsnutParid'];
		}
		
		$tmpAR1=$this->sCountUpdateConfig_Template;
		$tmpAR1['Parent_TableName']=$this->sysTableHead.'gsnavigationunitgroupcont';
		$tmpAR1['Parent_CountColumnName']='gsnugctCount_Info';
		$tmpAR1['Parent_Condition']=' AND gsnugctID='.$tmpParid;
		$tmpAR1['Child_A_TableName']=$this->sysTableHead.'gsnavigationunit';
		$tmpAR1['Child_A_CountColumnName']='gsnutID';
		$tmpAR1['Child_A_Condition']=' AND gsnutRecycle=0 AND gsnutChecked>1 AND gsnutParid='.$tmpParid;
		$tmpCountConfigs[]=$tmpAR1;
		
		$tmpINT=$this->updateCount($tmpCountConfigs);
		//-- #Update Hit --
		if($tmpCookieValue==''){
			$tmpSQL=' UPDATE {Nets.TableHead}gsnavigationunitcont SET gsnuctCount_Views=gsnuctCount_Views+1 WHERE 1=1 AND gsnuctIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$pID,$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			if($tmpINT!=0){
				$this->sysLastError='更新团购数据时出错，请稍后再试。';
				$this->TransRollback();
				return $tmpINT;
			}
			$this->writeCookie($this->sysNormalCookiePath,$tmpCookieName,1);
		}
		
		$this->TransCommit();
		return 0;
	}
	public function collection_ClearOld($pID,$pState,$pType,$pALL){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpApp_Code=new netsCode();
		//-- ------ ### ------ --
		$tmpSQL=' SELECT A.gsnatID
			FROM {Nets.TableHead}gsnavigationactive AS A
			WHERE 1=1 ';
		if ($pID==0) {
		}else if ($pALL==0) {
			$tmpSQL.=' AND A.gsnatParid='.$pID;
		}
		if ($pState==0) {
		}else if ($pALL==0) {
			$tmpSQL.=' AND (A.gsnatState=3 OR A.gsnatState=4 OR A.gsnatState=5 OR A.gsnatState=6) ';
		}
		if ($pType==0) {
		}else if ($pALL==0) {
			$tmpINT_0=$tmpApp_Code->TimeToInt_T(date($this->sysTimeFormat));
			$tmpINT_1=$tmpApp_Code->TimeToInt_T('0-0-7 0:0:0');
			$tmpINT_0=$tmpINT_0-$tmpINT_1;
			$tmpSTR=$tmpApp_Code->IntToTime_T($tmpINT_0);
			$tmpSQL.=' AND A.gsnatCreateTime<\''.$tmpSTR.'\' ';
		}
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->Search($tmpSTR);
		//-- ------ ### ------ --
		foreach ($tmpData0 as $Row0){
			$tmpSQL=' DELETE FROM {Nets.TableHead}gsnavigationactive WHERE 1=1 AND gsnatID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$Row0['gsnatID'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			$tmpSQL=' DELETE FROM {Nets.TableHead}gsnavigationactivecont WHERE 1=1 AND gsnactIndexID={Nets.ID} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.ID}',$Row0['gsnatID'],$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			
		}
		
		return 0;
	}
	public function collection_ID(&$pDbDescriptions,&$pIndex){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		//-- ------ #Read unit ------ --
		$tmpSQL=' SELECT A.gsnutID,A.gsnutName,A.gsnutNumCode,A.gsnutURL,
			B.gsnuctURL_Type,B.gsnuctURL_Auto,B.gsnuctURL_Weburl,B.gsnuctURL_XML,B.gsnuctURL_Lasttime,B.gsnuctURL_Charset
			FROM {Nets.TableHead}gsnavigationunit AS A
			INNER JOIN {Nets.TableHead}gsnavigationunitcont AS B ON B.gsnuctIndexID=A.gsnutID
			WHERE 1=1 AND A.gsnutRecycle=0 AND A.gsnutChecked>1 AND A.gsnutID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$pDbDescriptions[0]['Columns']['gsnutID']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if (count($tmpData0)!=1) {
			$this->sysLastError='对不起，您申请采集的NUMCODE不存在，请确认后再试或与客户人员联系。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		$pDbDescriptions[0]['Columns']['gsnutID']['Value']=$tmpData0[0]['gsnutID'];
		$pDbDescriptions[0]['Columns']['gsnutName']['Value']=$tmpData0[0]['gsnutName'];
		$pDbDescriptions[0]['Columns']['gsnutNumCode']['Value']=$tmpData0[0]['gsnutNumCode'];
		$pDbDescriptions[0]['Columns']['gsnutURL']['Value']=$tmpData0[0]['gsnutURL'];
		
		$pDbDescriptions[1]['Columns']['gsnuctURL_Type']['Value']=$tmpData0[0]['gsnuctURL_Type'];
		$pDbDescriptions[1]['Columns']['gsnuctURL_Auto']['Value']=$tmpData0[0]['gsnuctURL_Auto'];
		$pDbDescriptions[1]['Columns']['gsnuctURL_Weburl']['Value']=$tmpData0[0]['gsnuctURL_Weburl'];
		$pDbDescriptions[1]['Columns']['gsnuctURL_XML']['Value']=$tmpData0[0]['gsnuctURL_XML'];
		$pDbDescriptions[1]['Columns']['gsnuctURL_Lasttime']['Value']=$tmpData0[0]['gsnuctURL_Lasttime'];
		$pDbDescriptions[1]['Columns']['gsnuctURL_Charset']['Value']=$tmpData0[0]['gsnuctURL_Charset'];
		
		//-- ------ ### ------ --
		if ($tmpData0[0]['gsnuctURL_Type']==0) {
			$this->collectionByWeb($pDbDescriptions,$pIndex);
			
		}else if ($tmpData0[0]['gsnuctURL_Type']==1) {
			$this->collectionByAPI($pDbDescriptions,$pIndex);

		}
		
		
		return 0;
	}
	public function collection_Add(&$pDbDescriptions,$pParName,$pStateName,$pZoneName,$pShoppingName){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$tmpHtml=new netsHtml();
		$this->TransStart();
		$tmpDbDescriptions=$pDbDescriptions;
		//-- ------ ### ------ --
		//-- #gsnactInfo_Numcode --
		$tmpSQL=' SELECT A.gsnatID,B.gsnactInfo_Numcode
			FROM {Nets.TableHead}gsnavigationactive AS A
			INNER JOIN {Nets.TableHead}gsnavigationactivecont AS B ON B.gsnactIndexID=A.gsnatID
			WHERE 1=1 AND A.gsnatRecycle=0 AND A.gsnatChecked>1 AND B.gsnactInfo_Numcode LIKE \'{Nets.Info_NumCode}\'
			LIMIT 0,2 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Info_NumCode}',$tmpDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value'],$tmpSTR);
		$tmpData0=$this->Search($tmpSTR);
		if (count($tmpData0)==1) {
			//-- ------ #MODIFY ------ --
			//-- ------ #Operate ------ --
			$tmpDbDescriptions[0]['Columns']['gsnatID']['Value']=$tmpData0[0]['gsnatID'];
			$Coun0=1;
			while(count($tmpDbDescriptions)>$Coun0){
				$tmpDbDescriptions[$Coun0]['Columns']['gsnactIndexID']['Value']=$tmpData0[0]['gsnatID'];
				$Coun0++;
			}
			$this->getOne($tmpDbDescriptions);
			//-- #gsnatName --
			$tmpDbDescriptions[0]['Columns']['gsnatName']['Value']=$pDbDescriptions[0]['Columns']['gsnatName']['Value'];
			//-- #gsnatNumCode --
			//$tmpDbDescriptions[0]['Columns']['gsnatNumCode']['Value']=$pDbDescriptions[0]['Columns']['gsnatNumCode']['Value'];
			//-- #gsnatParid --
			$tmpDbDescriptions[0]['Columns']['gsnatParid']['Value']=$pDbDescriptions[0]['Columns']['gsnatParid']['Value'];
			//-- #pParName --
			$tmpSQL=' SELECT A.gsnutID,A.gsnutName
				FROM {Nets.TableHead}gsnavigationunit AS A
				WHERE 1=1 AND A.gsnutName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$pParName,$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatParid']['Value']=$tmpData0[0]['gsnutID'];
			}
			
			//-- #gsnatState --
			$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=$pDbDescriptions[0]['Columns']['gsnatState']['Value'];
			//-- #gsnatStateName --
			if ($pStateName=='进行中') {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=0;
			}else if ($pStateName=='完成') {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=1;
			}
			
			//-- #gsnatCreateTime --
			$tmpDbDescriptions[0]['Columns']['gsnatCreateTime']['Value']=$pDbDescriptions[0]['Columns']['gsnatCreateTime']['Value'];
			//-- #gsnatURL --
			$tmpDbDescriptions[0]['Columns']['gsnatURL']['Value']=$pDbDescriptions[0]['Columns']['gsnatURL']['Value'];
			//-- #gsnatZoneid --
			$tmpDbDescriptions[0]['Columns']['gsnatZoneid']['Value']=$pDbDescriptions[0]['Columns']['gsnatZoneid']['Value'];
			//-- #pZoneName --
			$tmpSQL=' SELECT A.sztID,A.sztName
				FROM {Nets.TableHead}netssyszone AS A
				WHERE 1=1 AND A.sztName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$pZoneName,$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatZoneid']['Value']=$tmpData0[0]['sztID'];
			}
			
			//-- #gsnatShoppingid --
			$tmpDbDescriptions[0]['Columns']['gsnatShoppingid']['Value']=$pDbDescriptions[0]['Columns']['gsnatShoppingid']['Value'];
			//-- #pShoppingName --
			$tmpSQL=' SELECT A.sztID,A.sztName
				FROM {Nets.TableHead}netssyszone AS A
				WHERE 1=1 AND A.sztName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$pShoppingName,$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatShoppingid']['Value']=$tmpData0[0]['sztID'];
			}
			
			//-- #gsnactZones --
			$tmpDbDescriptions[1]['Columns']['gsnactZones']['Value']=$pDbDescriptions[1]['Columns']['gsnactZones']['Value'];
			//-- #gsnactShoppings --
			$tmpDbDescriptions[1]['Columns']['gsnactShoppings']['Value']=$pDbDescriptions[1]['Columns']['gsnactShoppings']['Value'];
			//-- #gsnactBrands --
			$tmpDbDescriptions[1]['Columns']['gsnactBrands']['Value']=$pDbDescriptions[1]['Columns']['gsnactBrands']['Value'];
			//-- #gsnactRealshops --
			$tmpDbDescriptions[1]['Columns']['gsnactRealshops']['Value']=$pDbDescriptions[1]['Columns']['gsnactRealshops']['Value'];
			//-- #gsnactUnits --
			$tmpDbDescriptions[1]['Columns']['gsnactUnits']['Value']=$pDbDescriptions[1]['Columns']['gsnactUnits']['Value'];
			//-- #gsnactInfo_Numcode --
			$tmpDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value']=$pDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value'];
			//-- #gsnactPrice_StartTime --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value'];
			//-- #gsnactPrice_EndTime --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value'];
			//-- #gsnactPrice_Origin --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Origin']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Origin']['Value'];
			//-- #gsnactPrice_Now --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Now']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Now']['Value'];
			//-- #gsnactPrice_Sale --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Sale']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Sale']['Value'];
			//-- #gsnactPrice_Save --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Save']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Save']['Value'];
			//-- #gsnactPrice_LimitPeople --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value'];
			//-- #gsnactPrice_LimitOnes --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_LimitOnes']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_LimitOnes']['Value'];
			//-- #gsnactPrice_TotalCount --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_TotalCount']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_TotalCount']['Value'];
			//-- #gsnactCount_Order --
			$tmpDbDescriptions[1]['Columns']['gsnactCount_Order']['Value']=$pDbDescriptions[1]['Columns']['gsnactCount_Order']['Value'];
			//-- #gsnactSpeak --
			$tmpDbDescriptions[1]['Columns']['gsnactSpeak']['Value']=$pDbDescriptions[1]['Columns']['gsnactSpeak']['Value'];
			//-- #gsnactCom_Logo --
			$tmpDbDescriptions[1]['Columns']['gsnactCom_Logo']['Value']=$pDbDescriptions[1]['Columns']['gsnactCom_Logo']['Value'];
			//-- #gsnactCom_Introduct --
			$tmpDbDescriptions[1]['Columns']['gsnactCom_Introduct']['Value']=$pDbDescriptions[1]['Columns']['gsnactCom_Introduct']['Value'];
			//-- #gsnactMapIntroduct --
			$tmpDbDescriptions[1]['Columns']['gsnactMapIntroduct']['Value']=$pDbDescriptions[1]['Columns']['gsnactMapIntroduct']['Value'];
			//-- #gsnactMapX --
			$tmpDbDescriptions[1]['Columns']['gsnactMapX']['Value']=$pDbDescriptions[1]['Columns']['gsnactMapX']['Value'];
			//-- #gsnactMapY --
			$tmpDbDescriptions[1]['Columns']['gsnactMapY']['Value']=$pDbDescriptions[1]['Columns']['gsnactMapY']['Value'];
			//-- #gsnactSourceR00 --
			$tmpDbDescriptions[1]['Columns']['gsnactSourceR00']['Value']=$pDbDescriptions[1]['Columns']['gsnactSourceR00']['Value'];
			//-- #gsnactContent --
			$tmpDbDescriptions[1]['Columns']['gsnactContent']['Value']=$pDbDescriptions[1]['Columns']['gsnactContent']['Value'];
			//-- #gsnactPublisher_Address --
			$tmpDbDescriptions[1]['Columns']['gsnactPublisher_Address']['Value']=$pDbDescriptions[1]['Columns']['gsnactPublisher_Address']['Value'];

			//-- #EVALUE --
			$tmpAR0=explode('_',$tmpDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value']);
			$tmpSQL=' SELECT A.gsnutID,A.gsnutName
				FROM {Nets.TableHead}gsnavigationunit AS A
				WHERE 1=1 AND A.gsnutRecycle=0 AND A.gsnutChecked>1 AND A.gsnutName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$tmpAR0[0],$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatUnitid']['Value']=$tmpData0[0]['gsnutID'];
			}
			if ($tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']==$tmpCode->Int32($tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value'],0)) {
				$tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']=$tmpCode->IntToTime_T($tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']);
			}
			if ($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']==$tmpCode->Int32($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value'],0)) {
				$tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']=$tmpCode->IntToTime_T($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']);
			}
			if ($tmpCode->TimeToInt_T($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value'])>=$tmpCode->TimeToInt_T(date($this->sysTimeFormat))) {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=3;
			}else {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=2;
			}
			/*
			$tmpDbDescriptions[0]['Columns']['gsnatChecked']['Value']=2;
			$tmpDbDescriptions[0]['Columns']['gsnatCreateTime']['Value']=date($this->sysTimeFormat);
			*/
			
			//#Add
			$tmpINT=parent::check($tmpDbDescriptions,array(),array());
			if($tmpINT!=0){
				$this->sysLastError='提交内容错误:1.名称不能为空';
				return $this->sysErrorFuncID.'001';
			}
			$tmpDbDescriptions[0]['TableDescription']['SearchColumn']='gsnatNumCode,gsnatID';
			$tmpDbDescriptions[1]['TableDescription']['SearchColumn']='gsnactIndexID';
			$tmpINT=$this->modify($tmpDbDescriptions);
			if($tmpINT!=0){
				$this->sysLastError='保存团购信息时出错；';
				return $this->sysErrorFuncID.'001';
			}
		}else {
			//-- ------ #ADD ------ --
			//-- ------ #Clear ------ --
			$tmpSQL=' SELECT A.gsnatID,B.gsnactInfo_Numcode
				FROM {Nets.TableHead}gsnavigationactive AS A
				INNER JOIN {Nets.TableHead}gsnavigationactivecont AS B ON B.gsnactIndexID=A.gsnatID
				WHERE 1=1 AND A.gsnatRecycle=0 AND A.gsnatChecked>1 AND B.gsnactInfo_Numcode LIKE \'{Nets.Info_NumCode}\'
				LIMIT 0,2 ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Info_NumCode}',$tmpDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value'],$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			$tmpSTR_0='';
			$tmpSTR_1='';
			foreach ($tmpData0 as $Row0){
				$tmpSTR_0.=' OR gsnatID='.$Row0['gsnatID'];
				$tmpSTR_1.=' OR gsnactIndexID='.$Row0['gsnatID'];
			}
			$tmpSQL=' DELETE FROM {Nets.TableHead}gsnavigationactive WHERE 1=1 AND (1=2 {Nets.IDS}) ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.IDS}',$tmpSTR_0,$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			$tmpSQL=' DELETE FROM {Nets.TableHead}gsnavigationactivecont WHERE 1=1 AND (1=2 {Nets.IDS}) ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.IDS}',$tmpSTR_1,$tmpSTR);
			$tmpINT=$this->Execute($tmpSTR);
			//-- ------ #Operate ------ --
			$tmpSTR='gsnatNumCode';
			$tmpDbDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
			$tmpDbDescriptions[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
			$this->numCode($tmpDbDescriptions[0]);
			
			//-- #gsnatName --
			$tmpDbDescriptions[0]['Columns']['gsnatName']['Value']=$pDbDescriptions[0]['Columns']['gsnatName']['Value'];
			//-- #gsnatNumCode --
			//$tmpDbDescriptions[0]['Columns']['gsnatNumCode']['Value']=$pDbDescriptions[0]['Columns']['gsnatNumCode']['Value'];
			//-- #gsnatParid --
			$tmpDbDescriptions[0]['Columns']['gsnatParid']['Value']=$pDbDescriptions[0]['Columns']['gsnatParid']['Value'];
			//-- #pParName --
			$tmpSQL=' SELECT A.gsnutID,A.gsnutName
				FROM {Nets.TableHead}gsnavigationunit AS A
				WHERE 1=1 AND A.gsnutName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$pParName,$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatParid']['Value']=$tmpData0[0]['gsnutID'];
			}
			
			//-- #gsnatState --
			$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=$pDbDescriptions[0]['Columns']['gsnatState']['Value'];
			//-- #gsnatStateName --
			if ($pStateName=='进行中') {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=0;
			}else if ($pStateName=='完成') {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=1;
			}
			
			//-- #gsnatCreateTime --
			$tmpDbDescriptions[0]['Columns']['gsnatCreateTime']['Value']=$pDbDescriptions[0]['Columns']['gsnatCreateTime']['Value'];
			//-- #gsnatURL --
			$tmpDbDescriptions[0]['Columns']['gsnatURL']['Value']=$pDbDescriptions[0]['Columns']['gsnatURL']['Value'];
			//-- #gsnatZoneid --
			$tmpDbDescriptions[0]['Columns']['gsnatZoneid']['Value']=$pDbDescriptions[0]['Columns']['gsnatZoneid']['Value'];
			//-- #pZoneName --
			$tmpSQL=' SELECT A.sztID,A.sztName
				FROM {Nets.TableHead}netssyszone AS A
				WHERE 1=1 AND A.sztName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$pZoneName,$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatZoneid']['Value']=$tmpData0[0]['sztID'];
			}
			
			//-- #gsnatShoppingid --
			$tmpDbDescriptions[0]['Columns']['gsnatShoppingid']['Value']=$pDbDescriptions[0]['Columns']['gsnatShoppingid']['Value'];
			//-- #pShoppingName --
			$tmpSQL=' SELECT A.sztID,A.sztName
				FROM {Nets.TableHead}netssyszone AS A
				WHERE 1=1 AND A.sztName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$pShoppingName,$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatShoppingid']['Value']=$tmpData0[0]['sztID'];
			}
			
			//-- #gsnactZones --
			$tmpDbDescriptions[1]['Columns']['gsnactZones']['Value']=$pDbDescriptions[1]['Columns']['gsnactZones']['Value'];
			//-- #gsnactShoppings --
			$tmpDbDescriptions[1]['Columns']['gsnactShoppings']['Value']=$pDbDescriptions[1]['Columns']['gsnactShoppings']['Value'];
			//-- #gsnactBrands --
			$tmpDbDescriptions[1]['Columns']['gsnactBrands']['Value']=$pDbDescriptions[1]['Columns']['gsnactBrands']['Value'];
			//-- #gsnactRealshops --
			$tmpDbDescriptions[1]['Columns']['gsnactRealshops']['Value']=$pDbDescriptions[1]['Columns']['gsnactRealshops']['Value'];
			//-- #gsnactUnits --
			$tmpDbDescriptions[1]['Columns']['gsnactUnits']['Value']=$pDbDescriptions[1]['Columns']['gsnactUnits']['Value'];
			//-- #gsnactInfo_Numcode --
			$tmpDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value']=$pDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value'];
			//-- #gsnactPrice_StartTime --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value'];
			//-- #gsnactPrice_EndTime --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value'];
			//-- #gsnactPrice_Origin --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Origin']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Origin']['Value'];
			//-- #gsnactPrice_Now --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Now']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Now']['Value'];
			//-- #gsnactPrice_Sale --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Sale']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Sale']['Value'];
			//-- #gsnactPrice_Save --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_Save']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_Save']['Value'];
			//-- #gsnactPrice_LimitPeople --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value'];
			//-- #gsnactPrice_LimitOnes --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_LimitOnes']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_LimitOnes']['Value'];
			//-- #gsnactPrice_TotalCount --
			$tmpDbDescriptions[1]['Columns']['gsnactPrice_TotalCount']['Value']=$pDbDescriptions[1]['Columns']['gsnactPrice_TotalCount']['Value'];
			//-- #gsnactCount_Order --
			$tmpDbDescriptions[1]['Columns']['gsnactCount_Order']['Value']=$pDbDescriptions[1]['Columns']['gsnactCount_Order']['Value'];
			//-- #gsnactSpeak --
			$tmpDbDescriptions[1]['Columns']['gsnactSpeak']['Value']=$pDbDescriptions[1]['Columns']['gsnactSpeak']['Value'];
			//-- #gsnactCom_Logo --
			$tmpDbDescriptions[1]['Columns']['gsnactCom_Logo']['Value']=$pDbDescriptions[1]['Columns']['gsnactCom_Logo']['Value'];
			//-- #gsnactCom_Introduct --
			$tmpDbDescriptions[1]['Columns']['gsnactCom_Introduct']['Value']=$pDbDescriptions[1]['Columns']['gsnactCom_Introduct']['Value'];
			//-- #gsnactMapIntroduct --
			$tmpDbDescriptions[1]['Columns']['gsnactMapIntroduct']['Value']=$pDbDescriptions[1]['Columns']['gsnactMapIntroduct']['Value'];
			//-- #gsnactMapX --
			$tmpDbDescriptions[1]['Columns']['gsnactMapX']['Value']=$pDbDescriptions[1]['Columns']['gsnactMapX']['Value'];
			//-- #gsnactMapY --
			$tmpDbDescriptions[1]['Columns']['gsnactMapY']['Value']=$pDbDescriptions[1]['Columns']['gsnactMapY']['Value'];
			//-- #gsnactSourceR00 --
			$tmpDbDescriptions[1]['Columns']['gsnactSourceR00']['Value']=$pDbDescriptions[1]['Columns']['gsnactSourceR00']['Value'];
			//-- #gsnactContent --
			$tmpDbDescriptions[1]['Columns']['gsnactContent']['Value']=$pDbDescriptions[1]['Columns']['gsnactContent']['Value'];
			//-- #gsnactPublisher_Address --
			$tmpDbDescriptions[1]['Columns']['gsnactPublisher_Address']['Value']=$pDbDescriptions[1]['Columns']['gsnactPublisher_Address']['Value'];

			//-- #EVALUE --
			$tmpAR0=explode('_',$tmpDbDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value']);
			$tmpSQL=' SELECT A.gsnutID,A.gsnutName
				FROM {Nets.TableHead}gsnavigationunit AS A
				WHERE 1=1 AND A.gsnutRecycle=0 AND A.gsnutChecked>1 AND A.gsnutName LIKE \'{Nets.Name}\' ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$tmpAR0[0],$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpDbDescriptions[0]['Columns']['gsnatUnitid']['Value']=$tmpData0[0]['gsnutID'];
			}
			if ($tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']==$tmpCode->Int32($tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value'],0)) {
				$tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']=$tmpCode->IntToTime_T($tmpDbDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']);
			}
			if ($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']==$tmpCode->Int32($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value'],0)) {
				$tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']=$tmpCode->IntToTime_T($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']);
			}
			if ($tmpCode->TimeToInt_T($tmpDbDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value'])>=$tmpCode->TimeToInt_T(date($this->sysTimeFormat))) {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=3;
			}else {
				$tmpDbDescriptions[0]['Columns']['gsnatState']['Value']=2;
			}
			$tmpDbDescriptions[0]['Columns']['gsnatChecked']['Value']=2;
			$tmpDbDescriptions[0]['Columns']['gsnatCreateTime']['Value']=date($this->sysTimeFormat);
			
			
			//#Add
			$tmpINT=parent::check($tmpDbDescriptions,array(),array());
			if($tmpINT!=0){
				$this->sysLastError='提交内容错误:1.名称不能为空';
				return $this->sysErrorFuncID.'001';
			}
			$tmpDbDescriptions[0]['TableDescription']['SearchColumn']='gsnatNumCode,gsnatID';
			$tmpDbDescriptions[1]['TableDescription']['SearchColumn']='gsnactIndexID';
			$tmpINT=$this->add($tmpDbDescriptions);
			if($tmpINT!=0){
				$this->sysLastError='保存团购信息时出错；';
				return $this->sysErrorFuncID.'001';
			}
		}
		
		
		
		
		$this->TransCommit();
		echo ($this->sysSQL);
		return 0;
	}
	/**
Name
URL
gsnatZoneid
gsnatState
gsnatTag
gsnactInfo_Numcode
gsnactPrice_StartTime
gsnactPrice_EndTime
gsnactPrice_Origin
gsnactPrice_Now
gsnactPrice_Sale
gsnactPrice_Save
gsnactPrice_LimitPeople
gsnactPrice_LimitOnes
gsnactPrice_TotalCount
gsnactSpeak
gsnactCom_Logo
gsnactCom_Introduct
gsnactMapIntroduct
gsnactMapX
gsnactMapY
gsnactCount_Order
gsnactCount_Views
gsnactCount_Discuss
gsnactSourceR00
gsnactSourceR01
gsnactIntroduct
gsnactContent

	 *
	 * @param unknown_type $pDbDescriptions
	 * @param unknown_type $pIndex
	 * @return unknown
	 */
	public function collectionByWeb(&$pDbDescriptions,&$pIndex){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$tmpHtml=new netsHtml();
		$tmpCollection=new netsCollection();
		$this->TransStart();
		$tmpNonString='------NON------';
		$tmpCollection->sCharset=$pDbDescriptions[1]['Columns']['gsnuctURL_Charset']['Value'];
		
		//-- ------ #Read url ------ --
		$tmpSTR=$pDbDescriptions[1]['Columns']['gsnuctURL_Weburl']['Value'];
		$tmpSTR=str_replace($this->sysSPLIT4.$this->sysSPLIT6.$this->sysSPLIT4,$this->sysSPLIT6,$tmpSTR);
		$tmpSTR=str_replace($this->sysSPLIT4.$this->sysSPLIT6,$this->sysSPLIT4,$tmpSTR);
		$tmpAR0=explode($this->sysSPLIT6,$tmpSTR);
		$tmpAR_Weburl=array();
		$Coun0=0;
		foreach ($tmpAR0 as $Row0){
			$tmpAR1=explode($this->sysSPLIT4,$Row0);
			if (count($tmpAR1)>=8) {
				$tmpAR_Weburl[$Coun0]=array(
					'Name'=>$tmpAR1[0],
					'URL_List'=>$tmpAR1[1],
					'URL_Detail'=>$tmpAR1[2],
					'RULE_List'=>$tmpAR1[3],
					'RULE_Detail'=>$tmpAR1[4],
					'RULE_Class'=>$tmpAR1[5],
					'Zoneid'=>$tmpAR1[6],
					'Parid'=>$tmpAR1[7],
					);
				$Coun0++;
			}
		}
		//-- ------ ### ------ --
		if (count($tmpAR_Weburl)>0) {
			require($this->sysFileConfig['PathRoot'].$this->sysFileConfig['CollectionFileRoot'].$tmpAR_Weburl[0]['RULE_Class']);
		}else {
			require($this->sysFileConfig['PathRoot'].$this->sysFileConfig['CollectionFileRoot'].$this->sysFileConfig['CollectionClassPath']);
		}
		$tmpCollectionOperate=new CollectionOperate();
		$Coun_URL=$pIndex;
		$Coun_URL_End=$pIndex+1;
		while (count($tmpAR_Weburl)>$Coun_URL && $Coun_URL_End>$Coun_URL) {
			$tmpZoneid=0;
			$tmpSQL=' SELECT A.sztID
				FROM {Nets.TableHead}netssyszone AS A
				WHERE 1=1 AND A.sztRecycle=0 AND A.sztChecked>1 AND A.sztName LIKE \'{Nets.Name}\'
				ORDER BY A.sztType DESC ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$tmpAR_Weburl[$Coun_URL]['Zoneid'],$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)>0) {
				$tmpZoneid=$tmpData0[0]['sztID'];
			}
			//-- ------ #LIST ------ --
			//-- #Read list --
			$tmpWeb_list=array();
			require($this->sysFileConfig['PathRoot'].$this->sysFileConfig['CollectionFileRoot'].$tmpAR_Weburl[$Coun_URL]['RULE_List']);
			$tmpINT=$tmpCollection->onCollection(array($tmpAR_Weburl[$Coun_URL]['URL_List'],),$sysCollectionRULE,0,$tmpWeb_list);
			$tmpINT=$tmpCollectionOperate->FilterDescriptions_List($tmpWeb_list);
			//-- #Get list --
			$Coun_List=0;
			foreach ($tmpWeb_list as $Row0){
				//-- ------ #DETAIL ------ --
				$tmpWeb_detail=array();
				require($this->sysFileConfig['PathRoot'].$this->sysFileConfig['CollectionFileRoot'].$tmpAR_Weburl[$Coun_URL]['RULE_Detail']);
				$tmpINT=$tmpCollection->onCollection(array($Row0['{Nets.URL}'],),$sysCollectionRULE,0,$tmpWeb_detail);
				$tmpWeb_detail[0]['{Nets.URL}']=$Row0['{Nets.URL}'];
				if (count($tmpWeb_detail[0])<5) {
					$tmpWeb_detail[0]['{Nets.Name}']=$Row0['{Nets.Name}'];
					$tmpWeb_detail[0]['{Nets.URL}']=$Row0['{Nets.URL}'];
					$tmpWeb_detail[0]['{Nets.gsnatZoneid}']=$Row0['{Nets.gsnatZoneid}'];
					$tmpWeb_detail[0]['{Nets.gsnatState}']=$Row0['{Nets.gsnatState}'];
					$tmpWeb_detail[0]['{Nets.gsnatTag}']=$Row0['{Nets.gsnatTag}'];
					$tmpWeb_detail[0]['{Nets.gsnactInfo_Numcode}']=$Row0['{Nets.gsnactInfo_Numcode}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_StartTime}']=$Row0['{Nets.gsnactPrice_StartTime}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_EndTime}']=$Row0['{Nets.gsnactPrice_EndTime}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_Origin}']=$Row0['{Nets.gsnactPrice_Origin}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_Now}']=$Row0['{Nets.gsnactPrice_Now}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_Sale}']=$Row0['{Nets.gsnactPrice_Sale}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_Save}']=$Row0['{Nets.gsnactPrice_Save}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_LimitPeople}']=$Row0['{Nets.gsnactPrice_LimitPeople}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_LimitOnes}']=$Row0['{Nets.gsnactPrice_LimitOnes}'];
					$tmpWeb_detail[0]['{Nets.gsnactPrice_TotalCount}']=$Row0['{Nets.gsnactPrice_TotalCount}'];
					$tmpWeb_detail[0]['{Nets.gsnactSpeak}']=$Row0['{Nets.gsnactSpeak}'];
					$tmpWeb_detail[0]['{Nets.gsnactCom_Logo}']=$Row0['{Nets.gsnactCom_Logo}'];
					$tmpWeb_detail[0]['{Nets.gsnactCom_Introduct}']=$Row0['{Nets.gsnactCom_Introduct}'];
					$tmpWeb_detail[0]['{Nets.gsnactMapIntroduct}']=$Row0['{Nets.gsnactMapIntroduct}'];
					$tmpWeb_detail[0]['{Nets.gsnactMapX}']=$Row0['{Nets.gsnactMapX}'];
					$tmpWeb_detail[0]['{Nets.gsnactMapY}']=$Row0['{Nets.gsnactMapY}'];
					$tmpWeb_detail[0]['{Nets.gsnactCount_Order}']=$Row0['{Nets.gsnactCount_Order}'];
					$tmpWeb_detail[0]['{Nets.gsnactCount_Views}']=$Row0['{Nets.gsnactCount_Views}'];
					$tmpWeb_detail[0]['{Nets.gsnactCount_Discuss}']=$Row0['{Nets.gsnactCount_Discuss}'];
					$tmpWeb_detail[0]['{Nets.gsnactSourceR00}']=$Row0['{Nets.gsnactSourceR00}'];
					$tmpWeb_detail[0]['{Nets.gsnactSourceR01}']=$Row0['{Nets.gsnactSourceR01}'];
					$tmpWeb_detail[0]['{Nets.gsnactIntroduct}']=$Row0['{Nets.gsnactIntroduct}'];
					$tmpWeb_detail[0]['{Nets.gsnactContent}']=$Row0['{Nets.gsnactContent}'];
					
				}
				$tmpINT=$tmpCollectionOperate->FilterDescriptions_Detail($tmpWeb_detail);
				//-- ------ #ADD or UPDATE ------ --
				$tmpDescriptions=array(
					$this->sDbDescriptions_Other[0],
					$this->sDbDescriptions_Other[1],
					);
				//-- #Check repeate --
				$tmpSQL=' SELECT A.gsnatID,A.gsnatName
					FROM {Nets.TableHead}gsnavigationactive AS A
					INNER JOIN {Nets.TableHead}gsnavigationactivecont AS B ON B.gsnactIndexID=A.gsnatID
					WHERE 1=1 AND A.gsnatName LIKE \'{Nets.Name}\' AND A.gsnatUnitid={Nets.Unitid} ';
				$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
				$tmpSTR=str_replace('{Nets.Name}',$tmpWeb_detail[0]['{Nets.Name}'],$tmpSTR);
				//$tmpSTR=str_replace('{Nets.Numcode}',$Row_url->data->display->Numcode,$tmpSTR);
				$tmpSTR=str_replace('{Nets.Unitid}',$pDbDescriptions[0]['Columns']['gsnutID']['Value'],$tmpSTR);
				$tmpData0=$this->Search($tmpSTR);
				if (count($tmpData0)==0 && $tmpWeb_detail[0]['{Nets.Name}']!=$tmpNonString) {
					//#Get numCode
					$tmpSTR='gsnatNumCode';
					$tmpDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
					$tmpDescriptions[0]['Columns'][$tmpSTR]['Value']='GNA'.$this->sysSPLIT11.date('YmdHis');
					$this->numCode($tmpDescriptions[0]);
					
				}else if (count($tmpData0)==1){
					//#Get one
					$tmpDescriptions[0]['Columns']['gsnatID']['Value']=$tmpData0[0]['gsnatID'];
					$tmpDescriptions[1]['Columns']['gsnactIndexID']['Value']=$tmpData0[0]['gsnatID'];
					$this->getOne($tmpDescriptions);
					
				}else if (count($tmpData0)>1 && $tmpWeb_detail[0]['{Nets.Name}']!=$tmpNonString) {
					$this->sysLastError='团购信息不正确，请与客服人员联系。';
					$this->TransRollback();
					return $this->sysErrorFuncID.'001';
				}
				//#Set value
				$tmpDescriptions[0]['Columns']['gsnatZoneid']['Value']=$tmpWeb_detail[0]['{Nets.gsnatZoneid}'];
				$tmpDescriptions[0]['Columns']['gsnatState']['Value']=$tmpWeb_detail[0]['{Nets.gsnatState}'];
				$tmpDescriptions[0]['Columns']['gsnatTag']['Value']=$tmpWeb_detail[0]['{Nets.gsnatTag}'];
				$tmpDescriptions[1]['Columns']['gsnactInfo_Numcode']['Value']=$tmpWeb_detail[0]['{Nets.gsnactInfo_Numcode}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_StartTime}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_EndTime}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_Origin']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_Origin}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_Now']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_Now}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_Sale']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_Sale}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_Save']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_Save}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_LimitPeople}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_LimitOnes']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_LimitOnes}'];
				$tmpDescriptions[1]['Columns']['gsnactPrice_TotalCount']['Value']=$tmpWeb_detail[0]['{Nets.gsnactPrice_TotalCount}'];
				$tmpDescriptions[1]['Columns']['gsnactSpeak']['Value']=$tmpWeb_detail[0]['{Nets.gsnactSpeak}'];
				$tmpDescriptions[1]['Columns']['gsnactCom_Logo']['Value']=$tmpWeb_detail[0]['{Nets.gsnactCom_Logo}'];
				$tmpDescriptions[1]['Columns']['gsnactCom_Introduct']['Value']=$tmpWeb_detail[0]['{Nets.gsnactCom_Introduct}'];
				$tmpDescriptions[1]['Columns']['gsnactMapIntroduct']['Value']=$tmpWeb_detail[0]['{Nets.gsnactMapIntroduct}'];
				$tmpDescriptions[1]['Columns']['gsnactMapX']['Value']=$tmpWeb_detail[0]['{Nets.gsnactMapX}'];
				$tmpDescriptions[1]['Columns']['gsnactMapY']['Value']=$tmpWeb_detail[0]['{Nets.gsnactMapY}'];
				$tmpDescriptions[1]['Columns']['gsnactCount_Order']['Value']=$tmpWeb_detail[0]['{Nets.gsnactCount_Order}'];
				$tmpDescriptions[1]['Columns']['gsnactCount_Views']['Value']=$tmpWeb_detail[0]['{Nets.gsnactCount_Views}'];
				$tmpDescriptions[1]['Columns']['gsnactCount_Discuss']['Value']=$tmpWeb_detail[0]['{Nets.gsnactCount_Discuss}'];
				$tmpDescriptions[1]['Columns']['gsnactSourceR00']['Value']=$tmpWeb_detail[0]['{Nets.gsnactSourceR00}'];
				$tmpDescriptions[1]['Columns']['gsnactSourceR01']['Value']=$tmpWeb_detail[0]['{Nets.gsnactSourceR01}'];
				$tmpDescriptions[1]['Columns']['gsnactIntroduct']['Value']=$tmpWeb_detail[0]['{Nets.gsnactIntroduct}'];
				$tmpDescriptions[1]['Columns']['gsnactContent']['Value']=$tmpWeb_detail[0]['{Nets.gsnactContent}'];

				$tmpDescriptions[0]['Columns']['gsnatZoneid']['Value']=$tmpZoneid;
				$tmpSTR_A=$tmpCode->Int32($tmpWeb_detail[0]['{Nets.gsnatZoneid}'],0).' ';
				$tmpSTR_B=$tmpWeb_detail[0]['{Nets.gsnatZoneid}'].' ';
				if ($tmpSTR_A!=$tmpSTR_B) {
					$tmpSQL=' SELECT A.sztID
						FROM {Nets.TableHead}netssyszone AS A
						WHERE 1=1 AND A.sztRecycle=0 AND A.sztChecked>1 AND A.sztName LIKE \'{Nets.Name}\'
						ORDER BY A.sztType DESC ';
					$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
					$tmpSTR=str_replace('{Nets.Name}',$tmpWeb_detail[0]['{Nets.gsnatZoneid}'],$tmpSTR);
					$tmpData_Zone=$this->Search($tmpSTR);
					if (count($tmpData_Zone)>0) {
						$tmpDescriptions[0]['Columns']['gsnatZoneid']['Value']=$tmpData_Zone[0]['sztID'];
					}
				}
				$tmpDescriptions[0]['Columns']['gsnatParid']['Value']=$tmpAR_Weburl[$Coun_URL]['Parid'];
				
				$tmpDescriptions[0]['Columns']['gsnatName']['Value']=$tmpCode->SubString($tmpWeb_detail[0]['{Nets.Name}'],0,120);
				$tmpDescriptions[0]['Columns']['gsnatUnitid']['Value']=$pDbDescriptions[0]['Columns']['gsnutID']['Value'];
				$tmpDescriptions[0]['Columns']['gsnatURL']['Value']=$Row0['{Nets.URL}'];
				$tmpDescriptions[0]['Columns']['gsnatState']['Value']=2;
				$tmpDescriptions[0]['Columns']['gsnatChecked']['Value']=2;
				$tmpDescriptions[0]['Columns']['gsnatCreateTime']['Value']=date($this->sysTimeFormat);
				$tmpDescriptions[0]['Columns']['gsnatAlphabet']['Value']=$tmpCode->GetFirstchar($tmpWeb_detail[0]['{Nets.Name}']);
				$tmpDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value']=0;
				$tmpDescriptions[1]['Columns']['gsnactMapIntroduct']['Value']=$tmpWeb_detail[0]['{Nets.Name}'];
				
				//#ADD or UPDATE
				$tmpDescriptions[0]['TableDescription']['SearchColumn']='gsnatNumCode,gsnatID';
				$tmpDescriptions[1]['TableDescription']['SearchColumn']='gsnactIndexID';
				if (count($tmpData0)==0 && $tmpWeb_detail[0]['{Nets.Name}']!=$tmpNonString) {
					$tmpINT=$this->add($tmpDescriptions);
				}else if (count($tmpData0)==1){
					$tmpINT=$this->modify($tmpDescriptions);
				}else if (count($tmpData0)>1 && $tmpWeb_detail[0]['{Nets.Name}']!=$tmpNonString) {
					$this->sysLastError='团购信息不正确，请与客服人员联系。';
					$this->TransRollback();
					return $this->sysErrorFuncID.'001';
				}
				if($tmpINT!=0){
					$this->sysLastError='团购信息更新失败，请稍后再试';
					$this->TransRollback();
					return $tmpINT;
				}
				
				$Coun_List++;
			}
			
			$Coun_URL++;
		}
		//-- #Next index --
		if (count($tmpAR_Weburl)<=$Coun_URL) {
			$pIndex=-1;
		}else {
			$pIndex=$Coun_URL;
		}
		//-- ------ #Update lasttime ------ --
		$tmpSQL=' UPDATE {Nets.TableHead}gsnavigationunitcont AS A
			SET A.gsnuctURL_Lasttime=\'{Nets.Lasttime}\'
			WHERE 1=1 AND A.gsnuctIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Lasttime}',date($this->sysTimeFormat),$tmpSTR);
		$tmpSTR=str_replace('{Nets.ID}',$pDbDescriptions[0]['Columns']['gsnutID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='对不起，更新团购供应商时出错，请与客服人员联系';
			$this->TransRollback();
			return $tmpINT;
		}
		
		$this->TransCommit();
		return 0;
	}
	public function collectionByAPI(&$pDbDescriptions,&$pIndex){
		$this->sysErrorFuncID=$this->sysErrorClassID.'02';
		$tmpCode=new netsCode();
		$tmpHtml=new netsHtml();
		$tmpXml=new netsSimpleXml();
		$this->TransStart();
		//-- ------ #Read XML ------ --
		//COLLECTION URL
		$tmpCONTENT=$tmpCode->readURL($pDbDescriptions[1]['Columns']['gsnuctURL_XML']['Value']);
		//-- ------ #Analysis XML ------ --
		//LOAD
		$tmpINT=$tmpXml->loadXml($tmpCONTENT);
		if ($tmpINT!=0) {
			$this->sysLastError='对不起，您加载的XML格式不正确，请确认后再试。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		//Analysis
		if (!isset($tmpXml->sXmlElement->url)) {
			$this->sysLastError='对不起，您加载的XML格式不正确(url)，请参考本站API接口文档。';
			$this->TransRollback();
			return $this->sysErrorFuncID.'001';
		}
		$tmpAR0=$tmpXml->sXmlElement->url;
		if (!isset($tmpXml->sXmlElement->url[0])) {
			$tmpAR0=array($tmpXml->sXmlElement->url);
		}
		$Coun0=0;
		foreach ($tmpAR0 as $Row_url){
			//Check
			if (!isset($Row_url->loc)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.loc)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			
			if (!isset($Row_url->data->display->website)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.website)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Numcode)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Numcode)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->siteurl)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.siteurl)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->city)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.city)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->category)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.category)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->dpshopid)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.dpshopid)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->range)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.range)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->address)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.address)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->major)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.major)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->title)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.title)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->image)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.image)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->startTime)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.startTime)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->endTime)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.endTime)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->value)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.value)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->price)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.price)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->rebate)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.rebate)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->bought)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.bought)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Quantity)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Quantity)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->MinBought)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.MinBought)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->BoughtLimit)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.BoughtLimit)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->ProviderName)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.ProviderName)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->ProviderUrl)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.ProviderUrl)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->ImageUrlSet)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.ImageUrlSet)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Contact)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Contact)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Telephone)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Telephone)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Mobile)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Mobile)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Email)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Email)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Fax)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Fax)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Software)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Software)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Map)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Map)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->MapX)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.MapX)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->MapY)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.MapY)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->MapIntroduct)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.MapIntroduct)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if (!isset($Row_url->data->display->Description)) {
				$this->sysLastError='对不起，您加载的XML格式不正确(url.data.display.Description)，请参考本站API接口文档。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			//Make description
			//-- ------ #ADD or UPDATE ------ --
			$tmpDescriptions=array(
				$this->sDbDescriptions_Other[0],
				$this->sDbDescriptions_Other[1],
				);
			//-- #Check repeate --
			$tmpSQL=' SELECT A.gsnatID,A.gsnatName
				FROM {Nets.TableHead}gsnavigationactive AS A
				INNER JOIN {Nets.TableHead}gsnavigationactivecont AS B ON B.gsnactIndexID=A.gsnatID
				WHERE 1=1 AND A.gsnatName LIKE \'{Nets.Name}\' AND B.gsnactInfo_Numcode LIKE \'{Nets.Numcode}\' AND A.gsnatUnitid={Nets.Unitid} ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpSTR=str_replace('{Nets.Name}',$Row_url->data->display->title,$tmpSTR);
			$tmpSTR=str_replace('{Nets.Numcode}',$Row_url->data->display->Numcode,$tmpSTR);
			$tmpSTR=str_replace('{Nets.Unitid}',$tmpData_Unit[0]['gsnutID'],$tmpSTR);
			$tmpData0=$this->Search($tmpSTR);
			if (count($tmpData0)==0) {
				//#Get numCode
				$tmpSTR='gsnatNumCode';
				$tmpDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
				$tmpDescriptions[0]['Columns'][$tmpSTR]['Value']='GNA'.$this->sysSPLIT11.date('YmdHis');
				$this->numCode($tmpDbDescriptions[0]);
			}else if (count($tmpData0)==1){
				//#Get one
				$tmpDescriptions[0]['Columns']['gsnatID']['Value']=$tmpData_Unit[0]['gsnutID'];
				$tmpDescriptions[1]['Columns']['gsnactIndexID']['Value']=$tmpData_Unit[0]['gsnutID'];
				$this->getOne($tmpDescriptions);
				
			}else {
				$this->sysLastError='团购信息不正确，请与客服人员联系。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			//#Set value
			
			//$tmpDescriptions[0]['Columns']['gsnat']['Value']=$Row_url->data->display->website;
			$tmpDescriptions[0]['Columns']['gsnactInfo_Numcode']['Value']=$Row_url->data->display->Numcode;
			$tmpDescriptions[0]['Columns']['gsnatURL']['Value']=$Row_url->data->display->siteurl;
			$tmpDescriptions[0]['Columns']['gsnatZoneid']['Value']=$tmpCode->Int32($Row_url->data->display->city,0);
			$tmpDescriptions[0]['Columns']['gsnatParid']['Value']=$tmpCode->Int32($Row_url->data->display->category,0);
			//$tmpDescriptions[0]['Columns']['gsnat']['Value']=$Row_url->data->display->dpshopid;
			//$tmpDescriptions[0]['Columns']['gsnat']['Value']=$Row_url->data->display->range;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Address']['Value']=$Row_url->data->display->address;
			//$tmpDescriptions[0]['Columns']['gsnat']['Value']=$Row_url->data->display->major;
			$tmpDescriptions[0]['Columns']['gsnatName']['Value']=$Row_url->data->display->title;
			$tmpDescriptions[1]['Columns']['gsnactSourceR00']['Value']=$Row_url->data->display->image;
			$tmpDescriptions[1]['Columns']['gsnactPrice_StartTime']['Value']=$Row_url->data->display->startTime;
			$tmpDescriptions[1]['Columns']['gsnactPrice_EndTime']['Value']=$Row_url->data->display->endTime;
			$tmpDescriptions[1]['Columns']['gsnactPrice_Origin']['Value']=$Row_url->data->display->value;
			$tmpDescriptions[1]['Columns']['gsnactPrice_Now']['Value']=$Row_url->data->display->price;
			$tmpDescriptions[1]['Columns']['gsnactPrice_Sale']['Value']=$Row_url->data->display->rebate;
			$tmpDescriptions[1]['Columns']['gsnactCount_Order']['Value']=$Row_url->data->display->bought;
			$tmpDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value']=$Row_url->data->display->Quantity;
			$tmpDescriptions[1]['Columns']['gsnactPrice_LimitPeople']['Value']=$Row_url->data->display->MinBought;
			$tmpDescriptions[1]['Columns']['gsnactPrice_LimitOnes']['Value']=$Row_url->data->display->BoughtLimit;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Name']['Value']=$Row_url->data->display->ProviderName;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Homepage']['Value']=$Row_url->data->display->ProviderUrl;
			$tmpDescriptions[1]['Columns']['gsnactCom_Logo']['Value']=$Row_url->data->display->ImageUrlSet;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Name']['Value']=$Row_url->data->display->Contact;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Tele']['Value']=$Row_url->data->display->Telephone;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Mobile']['Value']=$Row_url->data->display->Mobile;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Email']['Value']=$Row_url->data->display->Email;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Fax']['Value']=$Row_url->data->display->Fax;
			$tmpDescriptions[1]['Columns']['gsnactPublisher_Software']['Value']=$Row_url->data->display->Software;
			//$tmpDescriptions[1]['Columns']['gsnactMap']['Value']=$Row_url->data->display->Map;
			$tmpDescriptions[1]['Columns']['gsnactMapX']['Value']=$Row_url->data->display->MapX;
			$tmpDescriptions[1]['Columns']['gsnactMapY']['Value']=$Row_url->data->display->MapY;
			$tmpDescriptions[1]['Columns']['gsnactMapIntroduct']['Value']=$Row_url->data->display->MapIntroduct;
			$tmpDescriptions[1]['Columns']['gsnactCom_Introduct']['Value']=$Row_url->data->display->Description;

			$tmpDescriptions[0]['Columns']['gsnatChecked']['Value']=2;
			$tmpDescriptions[0]['Columns']['gsnatUnitid']['Value']=$tmpData_Unit[0]['gsnutID'];
			$tmpDescriptions[0]['Columns']['gsnatCreateTime']['Value']=date($this->sysTimeFormat);

			//#ADD or UPDATE
			$tmpDescriptions[0]['TableDescription']['SearchColumn']='gsnatNumCode,gsnatID';
			$tmpDescriptions[1]['TableDescription']['SearchColumn']='gsnactIndexID';
			if (count($tmpData0)==0) {
				$tmpINT=$this->add($tmpDescriptions);
			}else if (count($tmpData0)==1){
				$tmpINT=$this->modify($tmpDescriptions);
			}else {
				$this->sysLastError='团购信息不正确，请与客服人员联系。';
				$this->TransRollback();
				return $this->sysErrorFuncID.'001';
			}
			if($tmpINT!=0){
				$this->sysLastError='团购信息更新失败，请稍后再试';
				$this->TransRollback();
				return $tmpINT;
			}
			
			$Coun0++;
		}
		//-- ------ #Update lasttime ------ --
		$tmpSQL=' UPDATE {Nets.TableHead}gsnavigationunitcont AS A
			SET A.gsnuctURL_Lasttime=\'{Nets.Lasttime}\'
			WHERE 1=1 AND A.gsnuctIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Lasttime}',date($this->sysTimeFormat),$tmpSTR);
		$tmpSTR=str_replace('{Nets.ID}',$pDbDescriptions[0]['Columns']['gsnutID']['Value'],$tmpSTR);
		$tmpINT=$this->Execute($tmpSTR);
		if($tmpINT!=0){
			$this->sysLastError='对不起，更新团购供应商时出错，请与客服人员联系';
			$this->TransRollback();
			return $tmpINT;
		}
		
		$this->TransCommit();
		return 0;
	}
	
	
	
}
?>