|  | @@ -7,22 +7,22 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	function __construct() {
 | 
	
		
			
				|  |  |  		
 | 
	
		
			
				|  |  | -		Doo::loadCore ( 'uri/DooUriRouter' );
 | 
	
		
			
				|  |  | -		$router = new DooUriRouter ();
 | 
	
		
			
				|  |  | -		$routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
 | 
	
		
			
				|  |  | -		 
 | 
	
		
			
				|  |  | -		if($routeRs['1']!="loginHttp"){
 | 
	
		
			
				|  |  | -			if(isset($_COOKIE["staff"])){
 | 
	
		
			
				|  |  | -				if(empty($_COOKIE["staff"])){
 | 
	
		
			
				|  |  | -					setcookie("staff", '', time()+36000,"/");
 | 
	
		
			
				|  |  | -					echo json_encode(array('status'=>3,'msg'=>'请登录'));die;
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			}else{
 | 
	
		
			
				|  |  | -				setcookie("staff", '', time()+36000,"/");
 | 
	
		
			
				|  |  | -				echo json_encode(array('status'=>3,'msg'=>'请登录'));die;
 | 
	
		
			
				|  |  | -			}
 | 
	
		
			
				|  |  | -			
 | 
	
		
			
				|  |  | -		}
 | 
	
		
			
				|  |  | +//		Doo::loadCore ( 'uri/DooUriRouter' );
 | 
	
		
			
				|  |  | +//		$router = new DooUriRouter ();
 | 
	
		
			
				|  |  | +//		$routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
 | 
	
		
			
				|  |  | +//		 
 | 
	
		
			
				|  |  | +//		if($routeRs['1']!="loginHttp"){
 | 
	
		
			
				|  |  | +//			if(isset($_COOKIE["staff"])){
 | 
	
		
			
				|  |  | +//				if(empty($_COOKIE["staff"])){
 | 
	
		
			
				|  |  | +//					setcookie("staff", '', time()+36000,"/");
 | 
	
		
			
				|  |  | +//					echo json_encode(array('status'=>3,'msg'=>'请登录'));die;
 | 
	
		
			
				|  |  | +//				}
 | 
	
		
			
				|  |  | +//			}else{
 | 
	
		
			
				|  |  | +//				setcookie("staff", '', time()+36000,"/");
 | 
	
		
			
				|  |  | +//				echo json_encode(array('status'=>3,'msg'=>'请登录'));die;
 | 
	
		
			
				|  |  | +//			}
 | 
	
		
			
				|  |  | +//			
 | 
	
		
			
				|  |  | +//		}
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	function loginHttp(){
 | 
	
	
		
			
				|  | @@ -179,6 +179,10 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  			$tagClient=new tag_client();
 | 
	
		
			
				|  |  |  			$staff = new staff ();
 | 
	
		
			
				|  |  |  			$client_staff = new client_staff ();
 | 
	
		
			
				|  |  | +			Doo::loadModel('tagCompany');
 | 
	
		
			
				|  |  | +			$tagCompany = new tagCompany ();
 | 
	
		
			
				|  |  | +			Doo::loadModel('tagCompanyNexus');
 | 
	
		
			
				|  |  | +			$tagCompanyNexus = new tagCompanyNexus ();
 | 
	
		
			
				|  |  |  			
 | 
	
		
			
				|  |  |  			$clientList=$client->getOne(array('where'=>'cid='.$cid,'asArray'=>true));
 | 
	
		
			
				|  |  |  			$companyList=$company->getOne(array('where'=>'cid='.$clientList['companyid'],'asArray'=>true));
 | 
	
	
		
			
				|  | @@ -191,6 +195,26 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  			$ClientTagList=$tagClient->getTagClientBySid( $_COOKIE["staff"]);
 | 
	
		
			
				|  |  |  			$toollist=$cTooltip->find(array('where'=>'cateid='.$staffDetail["cid"],'asArray'=>true));
 | 
	
		
			
				|  |  |  			
 | 
	
		
			
				|  |  | +			$companyTagL=$tagCompany->find(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
 | 
	
		
			
				|  |  | +			$CompanyTagList=$tagCompanyNexus->getTagClientBySid( $_COOKIE["staff"]);
 | 
	
		
			
				|  |  | +			foreach ($CompanyTagList as $key=>$value){
 | 
	
		
			
				|  |  | +				$CompanyTagList[$key]['taginfo']= $tagCompany->getTagByTidL($value['tag']);
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  | +				if(!empty($companyList['cid'])){
 | 
	
		
			
				|  |  | +					$companyList['taginfo']= array();
 | 
	
		
			
				|  |  | +					$companyList['tag']="";
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +					foreach ($CompanyTagList as $k=>$v){
 | 
	
		
			
				|  |  | +						if($companyList['cid']==$v['company']){
 | 
	
		
			
				|  |  | +							$companyList['taginfo']= $v['taginfo'];
 | 
	
		
			
				|  |  | +							$companyList['tag']=$v['tag'];
 | 
	
		
			
				|  |  | +						}
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  |  			foreach ($ClientTagList as $key=>$value){
 | 
	
		
			
				|  |  |  				$ClientTagList[$key]['taginfo']= $tagObj->getTagByTidL($value['tag']);
 | 
	
		
			
				|  |  |  			}
 | 
	
	
		
			
				|  | @@ -240,7 +264,7 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  			
 | 
	
		
			
				|  |  |  			$companyList['clientCount']=$clientCount;
 | 
	
		
			
				|  |  | -			echo json_encode(array('status'=>1,'clientList'=>$clientList,'colleague'=>$colleague,'companyList'=>$companyList,'serviceLogList'=>$serviceLogList,'longleList'=>$longleList,'msg'=>''));die;
 | 
	
		
			
				|  |  | +			echo json_encode(array('status'=>1,'clientList'=>$clientList,'colleague'=>$colleague,'companyList'=>$companyList,'companyTag'=>$companyTagL,'serviceLogList'=>$serviceLogList,'longleList'=>$longleList,'msg'=>''));die;
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		echo json_encode(array('status'=>2,'clientList'=>array(),'companyList'=>array(),'serviceLogList'=>array(),'msg'=>"请输入正确的请求路径"));
 | 
	
		
			
				|  |  |  	}
 | 
	
	
		
			
				|  | @@ -580,6 +604,11 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  		$m=$this->get_args('m')?$this->get_args('m'):"";
 | 
	
		
			
				|  |  |  		$d=$this->get_args('d')?$this->get_args('d'):"";
 | 
	
		
			
				|  |  |  		$y=$this->get_args('y')?$this->get_args('y'):date("Y");
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		$Remind=isset($_POST['Remind'])?$_POST['Remind']:0;
 | 
	
		
			
				|  |  | +		$time=isset($_POST['time'])?$_POST['time']:0;
 | 
	
		
			
				|  |  | +		$remark=isset($_POST['remark'])?$_POST['remark']:"";
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  |  		//echo $mark;die;
 | 
	
		
			
				|  |  |  		if(!empty($status)&&!empty($clientid)){
 | 
	
		
			
				|  |  |  			Doo::loadModel ( 'service_log' );
 | 
	
	
		
			
				|  | @@ -640,9 +669,33 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  			$action_log->nature=$nature[0];
 | 
	
		
			
				|  |  |  			
 | 
	
		
			
				|  |  |  			$action_log->class=$action_log->iconContacts;
 | 
	
		
			
				|  |  | -			
 | 
	
		
			
				|  |  |  			$action_log->insert();
 | 
	
		
			
				|  |  |  			
 | 
	
		
			
				|  |  | +			if (!empty($Remind)){
 | 
	
		
			
				|  |  | +				Doo::loadModel('remind');
 | 
	
		
			
				|  |  | +				$remindObj=new remind();
 | 
	
		
			
				|  |  | +				
 | 
	
		
			
				|  |  | +				$datetime1 = new DateTime(date('Y-m-d'));  
 | 
	
		
			
				|  |  | +				$datetime2 = new DateTime($time);  
 | 
	
		
			
				|  |  | +				$interval = $datetime1->diff($datetime2);  
 | 
	
		
			
				|  |  | +				
 | 
	
		
			
				|  |  | +				$remindObj->day=$interval->format('%a');
 | 
	
		
			
				|  |  | +				$remindObj->remark=$remark;
 | 
	
		
			
				|  |  | +				$remindObj->time=date("Y-m-d");
 | 
	
		
			
				|  |  | +				$remindObj->clientName=$clientInfo['clientname'];
 | 
	
		
			
				|  |  | +				$remindObj->clientID=$clientid;
 | 
	
		
			
				|  |  | +				$remindObj->companyName=$clientInfo['companyname'];
 | 
	
		
			
				|  |  | +				$remindObj->companyID=$companyInfo['cid'];
 | 
	
		
			
				|  |  | +				$remindObj->staffID=$_COOKIE["staff"];
 | 
	
		
			
				|  |  | +				if ($status==1)
 | 
	
		
			
				|  |  | +					$remindObj->class="iconService";
 | 
	
		
			
				|  |  | +				if ($status==2)
 | 
	
		
			
				|  |  | +					$remindObj->class="iconPhone";
 | 
	
		
			
				|  |  | +				if ($status==3)
 | 
	
		
			
				|  |  | +					$remindObj->class="iconOther";
 | 
	
		
			
				|  |  | +				$remindObj->insert();
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  |  			echo json_encode(array('status'=>1,'msg'=>''));die;
 | 
	
		
			
				|  |  |  		}else
 | 
	
		
			
				|  |  |  			echo json_encode(array('status'=>2,'msg'=>''));die;
 | 
	
	
		
			
				|  | @@ -713,6 +766,25 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  			
 | 
	
		
			
				|  |  |  		$company->update();
 | 
	
		
			
				|  |  |  		$client->update(array('where'=>' companyid ='.$cid));
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  | +		//标签
 | 
	
		
			
				|  |  | +		$tid = $this->get_args ( 'tagALD' );
 | 
	
		
			
				|  |  | +		Doo::loadModel('tagCompanyNexus');
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		$strtid=$tid;
 | 
	
		
			
				|  |  | +		$tagClient=new tagCompanyNexus();
 | 
	
		
			
				|  |  | +		$tagClientInfo=$tagClient->getTagClientBySCid($cid,$_COOKIE["staff"]);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +		$tagClient->tag=$strtid;
 | 
	
		
			
				|  |  | +		if(!empty($tagClientInfo)){
 | 
	
		
			
				|  |  | +			$tagClient->tcid=$tagClientInfo['tcid'];
 | 
	
		
			
				|  |  | +			$tagClient->update();
 | 
	
		
			
				|  |  | +		}else{
 | 
	
		
			
				|  |  | +			$tagClient->sid=$_COOKIE["staff"];
 | 
	
		
			
				|  |  | +			$tagClient->company=$cid;
 | 
	
		
			
				|  |  | +			$tagClient->insert();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		
 | 
	
		
			
				|  |  |  		echo json_encode(array('status'=>1,'msg'=>''));die;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  	
 | 
	
	
		
			
				|  | @@ -1445,6 +1517,43 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  		echo json_encode(array('status'=>1,'msg'=>''));die;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  | +	function getRemindHttp(){
 | 
	
		
			
				|  |  | +		Doo::loadModel('remind');
 | 
	
		
			
				|  |  | +		$remind=new remind();
 | 
	
		
			
				|  |  | +		//Doo::loadModel ( 'client' );
 | 
	
		
			
				|  |  | +		//$client = new client();
 | 
	
		
			
				|  |  | +		// and date_add(time, INTERVAL day DAY) <= CURDATE()
 | 
	
		
			
				|  |  | +		$remindList=$remind->find(array('where' => "staffID = '".$_COOKIE["staff"]."' and status=0 ",'asc'=>'date_add(time, INTERVAL day DAY)','asArray' => TRUE));
 | 
	
		
			
				|  |  | +		$rc=0;
 | 
	
		
			
				|  |  | +		foreach ($remindList as $key=>$value){
 | 
	
		
			
				|  |  | +			$a=strtotime($value['time']." +".$value['day']." days");
 | 
	
		
			
				|  |  | +			$b=strtotime(date('y-m-d'));
 | 
	
		
			
				|  |  | +			if ($a<=$b){
 | 
	
		
			
				|  |  | +				$rc++;
 | 
	
		
			
				|  |  | +				$remindList[$key]['isRemind']=1;
 | 
	
		
			
				|  |  | +			}else 
 | 
	
		
			
				|  |  | +				$remindList[$key]['isRemind']=0;
 | 
	
		
			
				|  |  | +			//$remindList[$key]['clientInfo']=$client->getOne(array('where' => "cid = '".$value["clientID"]."'",'asArray' => TRUE));
 | 
	
		
			
				|  |  | +			$remindList[$key]['Ctime']=date('m-d',strtotime($value['time']));
 | 
	
		
			
				|  |  | +			$remindList[$key]['Etime']=date('m-d',strtotime($value['time']." +".$value['day']." days"));
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		echo json_encode(array('status'=>1,'remindList'=>$remindList,'remindCount'=>$rc,'msg'=>''));die;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  | +	function remindCLHttp(){
 | 
	
		
			
				|  |  | +		$rid=$this->get_args('rid')&&is_numeric($this->get_args('rid'))?$this->get_args('rid'):0;
 | 
	
		
			
				|  |  | +		if (!empty($rid)){
 | 
	
		
			
				|  |  | +			Doo::loadModel('remind');
 | 
	
		
			
				|  |  | +			$remind=new remind();
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  | +			$remind->status=1;
 | 
	
		
			
				|  |  | +			$remind->update(array('where' => "staffID = '".$_COOKIE["staff"]."' and rid=".$rid,'asArray' => TRUE));
 | 
	
		
			
				|  |  | +			
 | 
	
		
			
				|  |  | +			echo json_encode(array('status'=>1,'msg'=>''));die;
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		echo json_encode(array('status'=>2,'msg'=>''));die;
 | 
	
		
			
				|  |  | +	}
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  |  	/**
 | 
	
		
			
				|  |  |  	 * 获取get或者POST值
 | 
	
		
			
				|  |  |  	 * @param string $name 属性名称
 | 
	
	
		
			
				|  | @@ -1508,6 +1617,9 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  		return $result ['count'];
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  | +	/*
 | 
	
		
			
				|  |  | +	 * 生成WSDL文件
 | 
	
		
			
				|  |  | +	 */
 | 
	
		
			
				|  |  |  	function interfaceDetail(){
 | 
	
		
			
				|  |  |  		Doo::loadClass("MobileApi/Service");
 | 
	
		
			
				|  |  |  	}
 | 
	
	
		
			
				|  | @@ -1524,9 +1636,9 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |  				setcookie("staff", $userinfo[0]['sid'], time()+36000,"/");
 | 
	
		
			
				|  |  |  				return array('status'=>1,'msg'=>'登陆成功','userList'=>$userinfo);
 | 
	
		
			
				|  |  |  			}else
 | 
	
		
			
				|  |  | -				return array('status'=>2,'msg'=>'账号或密码不正确','userList'=>array());
 | 
	
		
			
				|  |  | +				return array('status'=>2,'msg'=>'账号或密码不正确2','userList'=>array());
 | 
	
		
			
				|  |  |  		}else
 | 
	
		
			
				|  |  | -			return array('status'=>2,'msg'=>'账号或密码不正确','userList'=>array());
 | 
	
		
			
				|  |  | +			return array('status'=>2,'msg'=>'账号或密码不正确3','userList'=>array());
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  |  	function register($username, $gameid, $fromurl, $advertiser, $adfrom, $pagetype, $pagename, $tgid, $ip, $registertime) {
 | 
	
	
		
			
				|  | @@ -1537,7 +1649,7 @@ class MobileController extends DooController {
 | 
	
		
			
				|  |  |              'tg_adFrom'=>$advertiser, 
 | 
	
		
			
				|  |  |              'tg_pageParam' => $adfrom, 
 | 
	
		
			
				|  |  |              'tg_adType' => $pagetype, 
 | 
	
		
			
				|  |  | -            //'tg_pageName' => $pagename, 
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              'tg_adsID' => $tgid, 
 | 
	
		
			
				|  |  |              'tg_ip' => $tgid, 
 | 
	
		
			
				|  |  |              'tg_registerTime' => $registertime 
 |