|
@@ -172,7 +172,18 @@ class MainController extends DooController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $data ['staff'] = ""; // $staff->getUser ();
|
|
|
+ // 检测员工状态
|
|
|
+ $data ['application'] = 0;
|
|
|
+ $detail = $staff->getStaffByName ( $uid );
|
|
|
+ if (! empty ( $detail )) {
|
|
|
+ if ($detail ['pendStatus'] == 1) {
|
|
|
+ $data ['application'] = 1;
|
|
|
+ } elseif ($detail ['pendStatus'] == 2) {
|
|
|
+ $data ['application'] = 2;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $data ['staff'] = $detail; // $staff->getUser ();
|
|
|
$data ['login'] = "";
|
|
|
if (! empty ( $passwork ))
|
|
|
$data ['login'] = "inputErrow";
|
|
@@ -1807,57 +1818,47 @@ class MainController extends DooController {
|
|
|
$category = $lcategory->getCategoryById ( $this->staff [0] ['cid'], $this->staff [0] ['othercid'] );
|
|
|
$cateStr = " cid =0 ";
|
|
|
|
|
|
-
|
|
|
-
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
|
|
|
|
- $didList=explode(',', $this->staff [0]['did']);
|
|
|
- $didList=array_filter($didList);
|
|
|
- $didListContont=array();
|
|
|
- if (!empty($didList)){
|
|
|
- foreach ($didList as $key=>$value){
|
|
|
- array_push($didListContont, $XDeode->decode ( $value )) ;
|
|
|
+ $didList = explode ( ',', $this->staff [0] ['did'] );
|
|
|
+ $didList = array_filter ( $didList );
|
|
|
+ $didListContont = array ();
|
|
|
+ if (! empty ( $didList )) {
|
|
|
+ foreach ( $didList as $key => $value ) {
|
|
|
+ array_push ( $didListContont, $XDeode->decode ( $value ) );
|
|
|
}
|
|
|
-
|
|
|
- $data ['district'] = $district->getDistrictInId(implode(',', $didListContont));//$district->get_lvByStaffid ( 1, $this->staff [0] ['sid'] );
|
|
|
- }else{
|
|
|
- $data ['district'] =array();
|
|
|
+
|
|
|
+ $data ['district'] = $district->getDistrictInId ( implode ( ',', $didListContont ) ); // $district->get_lvByStaffid ( 1, $this->staff [0] ['sid'] );
|
|
|
+ } else {
|
|
|
+ $data ['district'] = array ();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- $sqstr='';
|
|
|
- if (!empty($didListContont)){
|
|
|
+ $sqstr = '';
|
|
|
+ if (! empty ( $didListContont )) {
|
|
|
|
|
|
foreach ( $didListContont as $key => $value ) {
|
|
|
if ($key != 0) {
|
|
|
- $sqstr .= " or district like '" . $value . ",%'";
|
|
|
+ $sqstr .= " or district like '" . $value . ",%'";
|
|
|
}
|
|
|
}
|
|
|
- $cateStr = " ( district like '" . $didListContont [0] . ",%'" . $sqstr.')';
|
|
|
+ $cateStr = " ( district like '" . $didListContont [0] . ",%'" . $sqstr . ')';
|
|
|
}
|
|
|
|
|
|
+ // $list = array ();
|
|
|
+ // foreach ( $category as $key => $value ) {
|
|
|
+ // array_push ( $list, " district like '" . $value ['districtid'] . ",%' " );
|
|
|
+ // }
|
|
|
+ // if ($this->staff [0] ['isadmin'] != 1)
|
|
|
+ // $cateStr = implode ( " or ", $list );
|
|
|
+ // else
|
|
|
+ // $cateStr = " 1";
|
|
|
+ //
|
|
|
|
|
|
+ // if (! empty ( $nature ))
|
|
|
+ // $cateStr = " 1";
|
|
|
|
|
|
-
|
|
|
-// $list = array ();
|
|
|
-// foreach ( $category as $key => $value ) {
|
|
|
-// array_push ( $list, " district like '" . $value ['districtid'] . ",%' " );
|
|
|
-// }
|
|
|
-// if ($this->staff [0] ['isadmin'] != 1)
|
|
|
-// $cateStr = implode ( " or ", $list );
|
|
|
-// else
|
|
|
-// $cateStr = " 1";
|
|
|
-//
|
|
|
-
|
|
|
-// if (! empty ( $nature ))
|
|
|
-// $cateStr = " 1";
|
|
|
-
|
|
|
-$size = 300;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ $size = 300;
|
|
|
|
|
|
$data ['htmllv2'] = array ();
|
|
|
$data ['htmllv3'] = array ();
|
|
@@ -1933,18 +1934,11 @@ $size = 300;
|
|
|
|
|
|
$data ['company'] = $company->getCompanyByDistrict ( $this->staff [0] ['sid'], $cateStr, $this->staff [0] ['isadmin'], $page, $size, $tagSQL );
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-// if ($this->staff [0] ['isadmin'] != 1) {
|
|
|
-// $data ['district'] = $district->get_lvByStaffid ( 1, $this->staff [0] ['sid'] );
|
|
|
-// } else {
|
|
|
-// $data ['district'] = $data ['district2'];
|
|
|
-// }
|
|
|
+ // if ($this->staff [0] ['isadmin'] != 1) {
|
|
|
+ // $data ['district'] = $district->get_lvByStaffid ( 1, $this->staff [0] ['sid'] );
|
|
|
+ // } else {
|
|
|
+ // $data ['district'] = $data ['district2'];
|
|
|
+ // }
|
|
|
|
|
|
// 获得标签
|
|
|
$ClientTagList = $tagCompanyNexus->getTagClientBySid ( $this->staff [0] ['sid'] );
|
|
@@ -2077,7 +2071,6 @@ $size = 300;
|
|
|
$this->render ( "/contacts_company", $data );
|
|
|
}
|
|
|
function contacts() {
|
|
|
-
|
|
|
$data ['memu'] = "contacts";
|
|
|
|
|
|
$data ['staff'] = $this->staff;
|
|
@@ -2140,57 +2133,56 @@ $size = 300;
|
|
|
$linfo = $category->getCategoryById ( $this->staff [0] ['cid'], $this->staff ['0'] ['othercid'] );
|
|
|
$staffid = $condition = $a = "";
|
|
|
|
|
|
- //if ($this->staff [0] ['isadmin'] != 1) {
|
|
|
- // 加入办事处地区
|
|
|
+ // if ($this->staff [0] ['isadmin'] != 1) {
|
|
|
+ // 加入办事处地区
|
|
|
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
|
|
|
|
- $didList=explode(',', $this->staff [0]['did']);
|
|
|
- $didList=array_filter($didList);
|
|
|
- $didListContont=array();
|
|
|
- if (!empty($didList)){
|
|
|
- foreach ($didList as $key=>$value){
|
|
|
- array_push($didListContont, $XDeode->decode ( $value )) ;
|
|
|
+ $didList = explode ( ',', $this->staff [0] ['did'] );
|
|
|
+ $didList = array_filter ( $didList );
|
|
|
+ $didListContont = array ();
|
|
|
+ if (! empty ( $didList )) {
|
|
|
+ foreach ( $didList as $key => $value ) {
|
|
|
+ array_push ( $didListContont, $XDeode->decode ( $value ) );
|
|
|
}
|
|
|
|
|
|
- $data ['district'] = $district->getDistrictInId(implode(',', $didListContont));//$district->get_lvByStaffid ( 1, $this->staff [0] ['sid'] );
|
|
|
- }else{
|
|
|
- $data ['district'] =array();
|
|
|
+ $data ['district'] = $district->getDistrictInId ( implode ( ',', $didListContont ) ); // $district->get_lvByStaffid ( 1, $this->staff [0] ['sid'] );
|
|
|
+ } else {
|
|
|
+ $data ['district'] = array ();
|
|
|
}
|
|
|
|
|
|
- if (! empty ( $search ))
|
|
|
- $sch = " and ( address like '%" . $search . "%' or clientname like '%" . $search . "%' or companyname like '%" . $search . "%' or qq like '%" . $search . "%' or telephone like '%" . $search . "%' or phone like '%" . $search . "%')";
|
|
|
- else {
|
|
|
- $a ='';
|
|
|
- $sqstr='';
|
|
|
- if (!empty($didListContont)){
|
|
|
- $a ='';
|
|
|
- foreach ( $didListContont as $key => $value ) {
|
|
|
- if ($key != 0) {
|
|
|
- $sqstr .= " or b.district like '" . $value . ",%'";
|
|
|
- }
|
|
|
+ if (! empty ( $search ))
|
|
|
+ $sch = " and ( address like '%" . $search . "%' or clientname like '%" . $search . "%' or companyname like '%" . $search . "%' or qq like '%" . $search . "%' or telephone like '%" . $search . "%' or phone like '%" . $search . "%')";
|
|
|
+ else {
|
|
|
+ $a = '';
|
|
|
+ $sqstr = '';
|
|
|
+ if (! empty ( $didListContont )) {
|
|
|
+ $a = '';
|
|
|
+ foreach ( $didListContont as $key => $value ) {
|
|
|
+ if ($key != 0) {
|
|
|
+ $sqstr .= " or b.district like '" . $value . ",%'";
|
|
|
}
|
|
|
- $a = "and ( b.district like '" . $didListContont [0] . ",%'" . $sqstr.')';
|
|
|
}
|
|
|
-
|
|
|
- if (! empty ( $tooltip ))
|
|
|
- $sch = "";
|
|
|
- $staffid = $data ['staff'] [0] ['sid'];
|
|
|
-
|
|
|
+ $a = "and ( b.district like '" . $didListContont [0] . ",%'" . $sqstr . ')';
|
|
|
}
|
|
|
|
|
|
-// } else {
|
|
|
-// $data ['district'] = $data ['district2'];
|
|
|
-// if (! empty ( $search ))
|
|
|
-// $sch = " and ( address like '%" . $search . "%' or clientname like '%" . $search . "%' or companyname like '%" . $search . "%' or qq like '%" . $search . "%' or telephone like '%" . $search . "%' or phone like '%" . $search . "%')";
|
|
|
-// else {
|
|
|
-// $sch = " ";
|
|
|
-// $search = urldecode ( isset ( $this->params ['search'] ) ? $this->params ['search'] : "" );
|
|
|
-// if (! empty ( $search ))
|
|
|
-// $sch = " and ( address like '%" . $search . "%' or clientname like '%" . $search . "%' or companyname like '%" . $search . "%' or qq like '%" . $search . "%' or telephone like '%" . $search . "%' or phone like '%" . $search . "%')";
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if (! empty ( $tooltip ))
|
|
|
+ $sch = "";
|
|
|
+ $staffid = $data ['staff'] [0] ['sid'];
|
|
|
+ }
|
|
|
+
|
|
|
+ // } else {
|
|
|
+ // $data ['district'] = $data ['district2'];
|
|
|
+ // if (! empty ( $search ))
|
|
|
+ // $sch = " and ( address like '%" . $search . "%' or clientname like '%" . $search . "%' or companyname like '%" . $search . "%' or qq like '%" . $search . "%' or telephone like '%" . $search . "%' or phone like '%" . $search . "%')";
|
|
|
+ // else {
|
|
|
+ // $sch = " ";
|
|
|
+ // $search = urldecode ( isset ( $this->params ['search'] ) ? $this->params ['search'] : "" );
|
|
|
+ // if (! empty ( $search ))
|
|
|
+ // $sch = " and ( address like '%" . $search . "%' or clientname like '%" . $search . "%' or companyname like '%" . $search . "%' or qq like '%" . $search . "%' or telephone like '%" . $search . "%' or phone like '%" . $search . "%')";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
$data ['htmllv2'] = $data ['htmllv3'] = array ();
|
|
|
|
|
|
if ($districtLv == 1) {
|
|
@@ -2242,8 +2234,12 @@ $size = 300;
|
|
|
$condition .= $sch;
|
|
|
// if(!empty($tooltip))
|
|
|
// $condition.=" and tooltip like '%".$tooltip."%'";
|
|
|
- $pageinfo =array('lower'=>0,'total_page'=>0,'total_data'=>0);
|
|
|
- if (!empty($didListContont)||! empty ( $search ))
|
|
|
+ $pageinfo = array (
|
|
|
+ 'lower' => 0,
|
|
|
+ 'total_page' => 0,
|
|
|
+ 'total_data' => 0
|
|
|
+ );
|
|
|
+ if (! empty ( $didListContont ) || ! empty ( $search ))
|
|
|
$pageinfo = $this->get_page ( "CLD_client_staff", $condition, $page, $page_size, "", "", "", $staffid, $search, $tooltip, $this->staff [0] ['cid'], $tagSQL );
|
|
|
|
|
|
if ($sortV == "h") { // order by a.cid desc
|
|
@@ -2259,28 +2255,28 @@ $size = 300;
|
|
|
$limit = " limit " . $pageinfo ['lower'] . " , " . $page_size . " ";
|
|
|
}
|
|
|
// 检索是全局
|
|
|
- //echo $condition;
|
|
|
- $data ['clientInfo'] =array();
|
|
|
- if (!empty($didListContont)||! empty ( $search ))
|
|
|
+ // echo $condition;
|
|
|
+ $data ['clientInfo'] = array ();
|
|
|
+ if (! empty ( $didListContont ) || ! empty ( $search ))
|
|
|
$data ['clientInfo'] = $client_staff->getClientByStaff ( $condition, $limit, $staffid, $this->staff [0] ['sid'], $search, $tooltip, $this->staff [0] ['cid'], $tagSQL );
|
|
|
-
|
|
|
- // 获取其他办事处的客户
|
|
|
- // if(!empty($districtstr)){
|
|
|
- // $buclient=$client->getClientByDistrict($districtstr);
|
|
|
- //
|
|
|
- // foreach ($buclient as $key=>$vlaue){
|
|
|
- //
|
|
|
- // $falg=true;
|
|
|
- //
|
|
|
- // foreach ($data['clientInfo'] as $y=>$v){
|
|
|
- // if($vlaue['clientname']==$v['clientname']&&$vlaue['companyname']==$v['companyname'])
|
|
|
- // $falg=false;
|
|
|
- // }
|
|
|
- // if($falg)
|
|
|
- // array_push($data['clientInfo'], $vlaue);
|
|
|
- // }
|
|
|
- //
|
|
|
- // }
|
|
|
+
|
|
|
+ // 获取其他办事处的客户
|
|
|
+ // if(!empty($districtstr)){
|
|
|
+ // $buclient=$client->getClientByDistrict($districtstr);
|
|
|
+ //
|
|
|
+ // foreach ($buclient as $key=>$vlaue){
|
|
|
+ //
|
|
|
+ // $falg=true;
|
|
|
+ //
|
|
|
+ // foreach ($data['clientInfo'] as $y=>$v){
|
|
|
+ // if($vlaue['clientname']==$v['clientname']&&$vlaue['companyname']==$v['companyname'])
|
|
|
+ // $falg=false;
|
|
|
+ // }
|
|
|
+ // if($falg)
|
|
|
+ // array_push($data['clientInfo'], $vlaue);
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // }
|
|
|
|
|
|
$k = "";
|
|
|
for($i = 1; $i <= $pageinfo ['total_page']; $i ++) {
|
|
@@ -6883,7 +6879,6 @@ $size = 300;
|
|
|
'timeout' => 15 * 60
|
|
|
)
|
|
|
); // 超时时间(单位:s)
|
|
|
-
|
|
|
|
|
|
$context = stream_context_create ( $options );
|
|
|
$result = file_get_contents ( $url, false, $context );
|