|
@@ -35,6 +35,9 @@ class MobileController extends DooController {
|
|
|
Doo::loadModel('tag');
|
|
|
$tag=new tag();
|
|
|
$staff = new staff ();
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+
|
|
|
|
|
|
if(!empty($pw)){
|
|
|
if(isset($_COOKIE['staff']))//$this->authcode(,'DECODE',$this->key)
|
|
@@ -45,7 +48,7 @@ class MobileController extends DooController {
|
|
|
//get user tag
|
|
|
$tagList=$tag->find(array('where'=>'sid='.$userinfo[0]['sid'],'asArray'=>true));
|
|
|
$userinfo[0]['passwork']=base64_encode($pw2);
|
|
|
- setcookie("staff", $userinfo[0]['sid'], time()+36000,"/");
|
|
|
+ setcookie("staff", $XDeode->encode ($userinfo[0]['sid']), time()+36000,"/");
|
|
|
$a=filemtime(DOO::conf()->SITE_PATH.$userinfo[0]['avatar']."_2.jpg");
|
|
|
$userinfo[0]['avatarUpdateTime']=$a;
|
|
|
//if ($t){
|
|
@@ -95,14 +98,18 @@ class MobileController extends DooController {
|
|
|
$tagClient=new tag_client();
|
|
|
$staff = new staff ();
|
|
|
|
|
|
- $staffDetail=$staff->getOne(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
+ $staffDetail=$staff->getOne(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
|
|
|
if ($page!=1)
|
|
|
$page=$page*$size-1;
|
|
|
else
|
|
|
$page--;
|
|
|
|
|
|
- $ClientTagList=$tagClient->getTagClientBySid( $_COOKIE["staff"]);
|
|
|
+ $ClientTagList=$tagClient->getTagClientBySid( $sid);
|
|
|
$toollist=$cTooltip->find(array('where'=>'cateid='.$staffDetail["cid"],'asArray'=>true));
|
|
|
$count=$client->count(array('limit'=>$page.','.$size,'where'=>" address like '%".$search."%' or clientname like '%".$search."%' or companyname like '%".$search."%' or qq like '%".$search."%' or telephone like '%".$search."%' or phone like '%".$search."%'",'asArray'=>true));
|
|
|
$list=$client->find(array('limit'=>$page.','.$size,'where'=>" address like '%".$search."%' or clientname like '%".$search."%' or companyname like '%".$search."%' or qq like '%".$search."%' or telephone like '%".$search."%' or phone like '%".$search."%'",'asArray'=>true));
|
|
@@ -144,13 +151,17 @@ class MobileController extends DooController {
|
|
|
$staff=new staff();
|
|
|
$district=new district();
|
|
|
|
|
|
- $staffDetail=$staff->getOne(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
+ $staffDetail=$staff->getOne(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
|
|
|
if($did==0){
|
|
|
if ($staffDetail['isadmin'])
|
|
|
$districtList=$district->get_lvByid(0,$did);
|
|
|
else
|
|
|
- $districtList=$district->get_lvByStaffid(1,$_COOKIE["staff"]);
|
|
|
+ $districtList=$district->get_lvByStaffid(1,$sid);
|
|
|
}else{
|
|
|
$districtList=$district->get_lvByid(0,$did);
|
|
|
}
|
|
@@ -184,6 +195,10 @@ class MobileController extends DooController {
|
|
|
Doo::loadModel('tagCompanyNexus');
|
|
|
$tagCompanyNexus = new tagCompanyNexus ();
|
|
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
$clientList=$client->getOne(array('where'=>'cid='.$cid,'asArray'=>true));
|
|
|
$companyList=$company->getOne(array('where'=>'cid='.$clientList['companyid'],'asArray'=>true));
|
|
|
$serviceLogList=$serviceLog->find(array('where'=>'clientid='.$cid,'desc'=>'date','asArray'=>true));
|
|
@@ -191,12 +206,12 @@ class MobileController extends DooController {
|
|
|
$longleList=$longle->find(array('where'=>'clientid='.$cid,'asArray'=>true));
|
|
|
$colleague=$client->find(array('where'=>'companyid='.$clientList['companyid'].' and cid!='.$cid,'asArray'=>true));
|
|
|
|
|
|
- $staffDetail=$staff->getOne(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
|
|
|
- $ClientTagList=$tagClient->getTagClientBySid( $_COOKIE["staff"]);
|
|
|
+ $staffDetail=$staff->getOne(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
+ $ClientTagList=$tagClient->getTagClientBySid( $sid);
|
|
|
$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"]);
|
|
|
+ $companyTagL=$tagCompany->find(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
+ $CompanyTagList=$tagCompanyNexus->getTagClientBySid( $sid);
|
|
|
foreach ($CompanyTagList as $key=>$value){
|
|
|
$CompanyTagList[$key]['taginfo']= $tagCompany->getTagByTidL($value['tag']);
|
|
|
}
|
|
@@ -289,7 +304,11 @@ class MobileController extends DooController {
|
|
|
$staff = new staff ();
|
|
|
$client_staff = new client_staff ();
|
|
|
|
|
|
- $staffDetail=$staff->getOne(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
+ $staffDetail=$staff->getOne(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
|
|
|
$condition="";
|
|
|
if(!empty($lv1))
|
|
@@ -312,7 +331,7 @@ class MobileController extends DooController {
|
|
|
$limit = " limit " . $page . " , " . $size . " ";
|
|
|
|
|
|
//获得标签
|
|
|
- $ClientTagList=$tagClient->getTagClientBySid( $_COOKIE["staff"]);
|
|
|
+ $ClientTagList=$tagClient->getTagClientBySid( $sid);
|
|
|
$toollist=$cTooltip->find(array('where'=>'cateid='.$staffDetail["cid"],'asArray'=>true));
|
|
|
$count = $this->getTableCount ( "CLD_client_staff", $condition ,$staffDetail["sid"],"",$teamTag,$staffDetail['cid']);
|
|
|
$clientList=$client_staff->getClientByStaff($condition,$limit,$staffDetail["sid"],$staffDetail["sid"],"",$teamTag,$staffDetail['cid']);
|
|
@@ -501,7 +520,11 @@ class MobileController extends DooController {
|
|
|
$client->updatetime=time();
|
|
|
$client->update();
|
|
|
|
|
|
- $staffDetail=$staff->getOne(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
+ $staffDetail=$staff->getOne(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
|
|
|
//标签
|
|
|
$tid = $this->get_args ( 'tagALD' );
|
|
@@ -510,7 +533,7 @@ class MobileController extends DooController {
|
|
|
$strtid=$tid;
|
|
|
|
|
|
$tagClient=new tag_client();
|
|
|
- $tagClientInfo=$tagClient->getTagClientBySCid($cid,$_COOKIE["staff"]);
|
|
|
+ $tagClientInfo=$tagClient->getTagClientBySCid($cid,$sid);
|
|
|
|
|
|
//$ar=explode(",", $strtid.','.$tagClientInfo['tag']);
|
|
|
//$re=array_filter(array_unique($ar));
|
|
@@ -522,7 +545,7 @@ class MobileController extends DooController {
|
|
|
$tagClient->update();
|
|
|
}else{
|
|
|
|
|
|
- $tagClient->sid=$_COOKIE["staff"];
|
|
|
+ $tagClient->sid=$sid;
|
|
|
$tagClient->client=$cid;
|
|
|
$tagClient->insert();
|
|
|
}
|
|
@@ -623,7 +646,11 @@ class MobileController extends DooController {
|
|
|
Doo::loadModel ( 'staff' );
|
|
|
$staff = new staff ();
|
|
|
|
|
|
- $staffDetail=$staff->getOne(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
+ $staffDetail=$staff->getOne(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
|
|
|
$service_log->status=$status;
|
|
|
$service_log->clientid=$clientid;
|
|
@@ -686,7 +713,7 @@ class MobileController extends DooController {
|
|
|
$remindObj->clientID=$clientid;
|
|
|
$remindObj->companyName=$clientInfo['companyname'];
|
|
|
$remindObj->companyID=$companyInfo['cid'];
|
|
|
- $remindObj->staffID=$_COOKIE["staff"];
|
|
|
+ $remindObj->staffID=$sid;
|
|
|
if ($status==1)
|
|
|
$remindObj->class="iconService";
|
|
|
if ($status==2)
|
|
@@ -728,6 +755,10 @@ class MobileController extends DooController {
|
|
|
$client=new client();
|
|
|
$company=new company();
|
|
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
$company->cid=$cid;
|
|
|
|
|
|
if(!empty($lv21)&&!empty($lv22)&&!empty($lv23)){
|
|
@@ -773,14 +804,14 @@ class MobileController extends DooController {
|
|
|
|
|
|
$strtid=$tid;
|
|
|
$tagClient=new tagCompanyNexus();
|
|
|
- $tagClientInfo=$tagClient->getTagClientBySCid($cid,$_COOKIE["staff"]);
|
|
|
+ $tagClientInfo=$tagClient->getTagClientBySCid($cid,$sid);
|
|
|
|
|
|
$tagClient->tag=$strtid;
|
|
|
if(!empty($tagClientInfo)){
|
|
|
$tagClient->tcid=$tagClientInfo['tcid'];
|
|
|
$tagClient->update();
|
|
|
}else{
|
|
|
- $tagClient->sid=$_COOKIE["staff"];
|
|
|
+ $tagClient->sid=$sid;
|
|
|
$tagClient->company=$cid;
|
|
|
$tagClient->insert();
|
|
|
}
|
|
@@ -945,6 +976,10 @@ class MobileController extends DooController {
|
|
|
Doo::loadModel ( 'staff' );
|
|
|
$staff = new staff ();
|
|
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
$status=$this->get_args('longleStatus')?$this->get_args('longleStatus'):0;
|
|
|
$lid=$this->get_args('klid')?$this->get_args('klid'):0;
|
|
|
|
|
@@ -953,7 +988,7 @@ class MobileController extends DooController {
|
|
|
}
|
|
|
|
|
|
$linfo=$longle->getLongleByLid($lid);
|
|
|
- $this->staff=$staff->find(array('where'=>'sid='.$_COOKIE["staff"],'asArray'=>true));
|
|
|
+ $this->staff=$staff->find(array('where'=>'sid='.$sid,'asArray'=>true));
|
|
|
|
|
|
if($status==0){
|
|
|
echo json_encode(array('status'=>2,'msg'=>''));die;
|
|
@@ -1428,7 +1463,11 @@ class MobileController extends DooController {
|
|
|
Doo::loadModel ( 'staffDynamic' );
|
|
|
$staffDynamic=new staffDynamic();
|
|
|
|
|
|
- $this->staff=$staff->find(array ('where' => "sid='".$_COOKIE["staff"]."'", 'asArray' => TRUE ));
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
+ $this->staff=$staff->find(array ('where' => "sid='".$sid."'", 'asArray' => TRUE ));
|
|
|
|
|
|
$staff->sid=$this->staff[0]['sid'];
|
|
|
|
|
@@ -1520,10 +1559,15 @@ class MobileController extends DooController {
|
|
|
function getRemindHttp(){
|
|
|
Doo::loadModel('remind');
|
|
|
$remind=new remind();
|
|
|
+
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
//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));
|
|
|
+ $remindList=$remind->find(array('where' => "staffID = '".$sid."' 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");
|
|
@@ -1546,8 +1590,12 @@ class MobileController extends DooController {
|
|
|
Doo::loadModel('remind');
|
|
|
$remind=new remind();
|
|
|
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
$remind->status=1;
|
|
|
- $remind->update(array('where' => "staffID = '".$_COOKIE["staff"]."' and rid=".$rid,'asArray' => TRUE));
|
|
|
+ $remind->update(array('where' => "staffID = '".$sid."' and rid=".$rid,'asArray' => TRUE));
|
|
|
|
|
|
echo json_encode(array('status'=>1,'msg'=>''));die;
|
|
|
}
|