فهرست منبع

Merge branch 'master' of http://192.168.1.12:3000/caipin/cld

caipin 8 سال پیش
والد
کامیت
dbd8de7c24

+ 190 - 184
global/css/global.css

@@ -104,7 +104,7 @@ a.disenable{color:#ccc}
 .fL {float:left}
 .fR {float:right}
 :link, *:visited, *:hover, *:active, *:focus {
-  -moz-transition: color 0.2s linear 0s, background-color 0.2s linear 0s, border-color 0.2s linear 0s;
+    -moz-transition: color 0.2s linear 0s, background-color 0.2s linear 0s, border-color 0.2s linear 0s;
   -webkit-transition: color 0.2s linear 0s, background-color 0.2s linear 0s, border-color 0.2s linear 0s;
   transition: color 0.2s linear 0s, background-color 0.2s linear 0s, border-color 0.2s linear 0s;
   -o-transition: color 0.2s linear 0s, background-color 0.2s linear 0s, border-color 0.2s linear 0s;
@@ -127,9 +127,9 @@ a.disenable{color:#ccc}
   font-family: 'ZHcldSystem';
   src:url('fonts/ZHcldSystem.eot');
   src:url('fonts/ZHcldSystem.eot?#iefix') format('embedded-opentype'),
-  url('fonts/ZHcldSystem.ttf') format('truetype'),
-  url('fonts/ZHcldSystem.woff') format('woff'),
-  url('fonts/ZHcldSystem.svg#ZHcldSystem') format('svg');
+    url('fonts/ZHcldSystem.ttf') format('truetype'),
+    url('fonts/ZHcldSystem.woff') format('woff'),
+    url('fonts/ZHcldSystem.svg#ZHcldSystem') format('svg');
   font-weight: normal;
   font-style: normal;
 }
@@ -663,8 +663,8 @@ button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-
 }
 .alert-success {
   color: #468847;
-  background-color: #dff0d8;
-  border-color: #d6e9c6;
+background-color: #dff0d8;
+border-color: #d6e9c6;
 }
 .alert-info {
   color: #3a87ad;
@@ -686,96 +686,96 @@ button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-
   margin:0;
 }
 .infoFlowList{
-  border-left: 1px solid #BEBEBE;
-  margin-left: 25px;
-  padding-bottom: 33px;
-  padding-left:27px;
-  position: relative;
-  margin-right:5px
+    border-left: 1px solid #BEBEBE;
+    margin-left: 25px;
+    padding-bottom: 33px;
+    padding-left:27px;
+    position: relative;
+    margin-right:5px
 }
 .dateTitle {
-  left: -21px;
-  overflow: visible;
-  position: absolute;
-  top: 0;
-  width: 42px;
+    left: -21px;
+    overflow: visible;
+    position: absolute;
+    top: 0;
+    width: 42px;
 }
 
 .dateTitle .month {
-  background-color: #999;
-  color: #FFFFFF;
-  float: left;
-  height: 28px;
-  line-height: 1;
-  padding-top: 8px;
-  text-align: center;
-  width: 42px;
-  overflow: hidden;
+    background-color: #999;
+    color: #FFFFFF;
+    float: left;
+    height: 28px;
+    line-height: 1;
+    padding-top: 8px;
+    text-align: center;
+    width: 42px;
+    overflow: hidden;
 }
 .dateTitle .month .num {
-  font-family:"Tahoma";
-  font-size: 18px;
-  font-weight: normal;
-  letter-spacing:-1px;
+    font-family:"Tahoma";
+    font-size: 18px;
+    font-weight: normal;
+    letter-spacing:-1px;
 }
 .dateTitle .month .text {
-  padding-left: 2px;
-  font-family:"Tahoma";
-  font-size:14px
+    padding-left: 2px;
+    font-family:"Tahoma";
+    font-size:14px
 }
 .dateTitle .year {
-  -moz-border-bottom-colors: none;
-  -moz-border-left-colors: none;
-  -moz-border-right-colors: none;
-  -moz-border-top-colors: none;
-  background-color: #FFFFFF;
-  background-image: none;
-  border-color: -moz-use-text-color #BEBEBE #BEBEBE;
-  border-image: none;
-  border-style: none solid solid;
-  border-width: 0 1px 1px;
-  float: left;
-  height: 18px;
-  line-height: 16px;
-  overflow: visible;
-  padding: 0;
-  position: relative;
-  text-align: center;
-  width:40px
+    -moz-border-bottom-colors: none;
+    -moz-border-left-colors: none;
+    -moz-border-right-colors: none;
+    -moz-border-top-colors: none;
+    background-color: #FFFFFF;
+    background-image: none;
+    border-color: -moz-use-text-color #BEBEBE #BEBEBE;
+    border-image: none;
+    border-style: none solid solid;
+    border-width: 0 1px 1px;
+    float: left;
+    height: 18px;
+    line-height: 16px;
+    overflow: visible;
+    padding: 0;
+    position: relative;
+    text-align: center;
+    width:40px
 }
 .dateTitle .year:before,.dateTitle .year:after {
-  border-bottom-colors: none;
-  border-left-colors: none;
-  -moz-border-right-colors: none;
-  -moz-border-top-colors: none;
-  border-color: #222 transparent transparent;
-  border-image: none;
-  border-right: 4px solid transparent;
-  border-style: solid;
-  border-width: 4px;
-  bottom: -8px;
-  content: "";
-  display: block;
-  height: 0;
-  left: 15px;
-  position: absolute;
-  width: 0;
+    border-bottom-colors: none;
+    border-left-colors: none;
+    -moz-border-right-colors: none;
+    -moz-border-top-colors: none;
+    border-color: #222 transparent transparent;
+    border-image: none;
+    border-right: 4px solid transparent;
+    border-style: solid;
+    border-width: 4px;
+    bottom: -8px;
+    content: "";
+    display: block;
+    height: 0;
+    left: 15px;
+    position: absolute;
+    width: 0;
 }
 .dateTitle .year:after {
-  border-top: 4px solid #FFFFFF;
-  bottom: -7px;
-  z-index: 2;
+    border-top: 4px solid #FFFFFF;
+    bottom: -7px;
+    z-index: 2;
 }
 
 .infoFlowList .flowList {
-  background-color:#fff;
-  float: none;
-  padding: 0
+    background-color:#fff;
+    float: none;
+    padding: 0
 }
 .flowList li.item {
-  overflow: hidden;
-  padding: 8px 30px 8px 35px;
-  border-bottom:1px solid #EBEBEB
+    overflow: hidden;
+    padding: 8px 30px 8px 35px;
+    border-bottom:1px solid #EBEBEB
 }
 .flowList li.item:last-child{
   border-bottom:none
@@ -787,19 +787,19 @@ button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-
   overflow: hidden;
 }
 .mainMenu{
-  background:#191818 url(slidebg.png) repeat;
-  bottom: 0;
-  left:50px;
-  margin-left: -50px;
-  position: fixed;
-  top: 0;
-  width:50px;
-  z-index: 1000;
-  display: inline-block;
-  letter-spacing: normal;
-  text-rendering: auto;
-  vertical-align: top;
-  word-spacing: normal
+    background:#191818 url(slidebg.png) repeat;
+    bottom: 0;
+    left:50px;
+    margin-left: -50px;
+    position: fixed;
+    top: 0;
+    width:50px;
+    z-index: 1000;
+    display: inline-block;
+    letter-spacing: normal;
+    text-rendering: auto;
+    vertical-align: top;
+    word-spacing: normal
 }
 .mainMenu .menuItem{
   display:block
@@ -884,21 +884,21 @@ button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-
   width:100%;
 }
 .header {
-  color: #333333;
-  padding:6px 0 6px 12px;
-  background-color:#fff;
-  margin:5px 5px 0 5px;
+    color: #333333;
+    padding:6px 0 6px 12px;
+    background-color:#fff;
+    margin:5px 5px 0 5px;
 }
 .header h1 {
-  font-size: 36px;
-  font-weight: 300;
-  margin:5px 0
+    font-size: 36px;
+    font-weight: 300;
+    margin:5px 0
 }
 .header h1.companyName{
   font-size:18px
 }
 .header h2 {
-  margin: 0
+    margin: 0
 }
 .header h2.cate a{
   padding:0 5px;
@@ -1136,6 +1136,12 @@ button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-
   left:1px;
   top:1px;
 }
+.centerRecord .mostList li.select{
+  padding:0
+}
+.centerRecord .mostList li.select select{
+  margin:10px 0 0 20px
+}
 .infoCenter .dateList {
   overflow: hidden;
   overflow-y:auto;
@@ -1441,9 +1447,9 @@ button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-
   margin:6px 5px
 }
 .contactPanel h1{
-  font-size: 36px;
-  font-weight: 300;
-  font-size:18px
+    font-size: 36px;
+    font-weight: 300;
+    font-size:18px
 }
 .contactPanel h1 a.clientName{
   font-size:18px;
@@ -1642,15 +1648,15 @@ a.new-ribbon:before{
   margin:0 1px 0 0;
 }
 .contactList .contactsTag:hover{
-  -webkit-animation:pulse .2s .1s ease both;
-  -moz-animation:pulse .2s .1s ease both;}
+-webkit-animation:pulse .2s .1s ease both;
+-moz-animation:pulse .2s .1s ease both;}
 @-webkit-keyframes pulse{
-  0%{-webkit-transform:scale(1)}
-  100%{-webkit-transform:scale(1.5)}
+0%{-webkit-transform:scale(1)}
+100%{-webkit-transform:scale(1.5)}
 }
 @-moz-keyframes pulse{
-  0%{-moz-transform:scale(1)}
-  100%{-moz-transform:scale(1.5)}
+0%{-moz-transform:scale(1)}
+100%{-moz-transform:scale(1.5)}
 }
 .contactTable {
   width:100%;
@@ -1665,22 +1671,22 @@ a.new-ribbon:before{
   background:#f7f7f7;
 }
 .contactTable td{
-  -moz-box-sizing: border-box;
-  box-sizing: border-box;
-  font-size: 12px;
-  font-weight: 400;
-  line-height: 16px;
-  padding:10px 5px;
-  position: relative;
+    -moz-box-sizing: border-box;
+    box-sizing: border-box;
+    font-size: 12px;
+    font-weight: 400;
+    line-height: 16px;
+    padding:10px 5px;
+    position: relative;
 }
 .contactTable td span.lim,.contactCate .contactTableHead td span.lim{
   display:block;
-  height: 18px;
-  line-height: 18px;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
-  width:inherit
+    height: 18px;
+    line-height: 18px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    width:inherit
 }
 .contactTable b.name {
   font-size:16px
@@ -1720,15 +1726,15 @@ a.new-ribbon:before{
   color:#f90000;
 }
 .contactTable i.contactsMark:hover{
-  -webkit-animation:pulse .2s .1s ease both;
-  -moz-animation:pulse .2s .1s ease both;}
+-webkit-animation:pulse .2s .1s ease both;
+-moz-animation:pulse .2s .1s ease both;}
 @-webkit-keyframes pulse{
-  0%{-webkit-transform:scale(1)}
-  100%{-webkit-transform:scale(1.5)}
+0%{-webkit-transform:scale(1)}
+100%{-webkit-transform:scale(1.5)}
 }
 @-moz-keyframes pulse{
-  0%{-moz-transform:scale(1)}
-  100%{-moz-transform:scale(1.5)}
+0%{-moz-transform:scale(1)}
+100%{-moz-transform:scale(1.5)}
 }
 .changePage{
   line-height: 30px;
@@ -1852,14 +1858,14 @@ a.new-ribbon:before{
   border-top:1px solid #222222
 }
 .subMenu li.news:after {
-  background: none repeat scroll 0 0 #f90000;
-  border-radius: 10px 0 10px 10px;
-  content: "";
-  height: 10px;
-  position: absolute;
-  right: 10px;
-  top: 10px;
-  width: 10px;
+    background: none repeat scroll 0 0 #f90000;
+    border-radius: 10px 0 10px 10px;
+    content: "";
+    height: 10px;
+    position: absolute;
+    right: 10px;
+    top: 10px;
+    width: 10px;
 }
 .adminContent{
   margin:0 0 0 160px;
@@ -2140,11 +2146,11 @@ table .taC{
   color:#373737
 }
 .seCensor .btnList {
-  bottom: 0;
-  position: absolute;
-  right: 0;
-  width:100%;
-  height: 39px
+    bottom: 0;
+    position: absolute;
+    right: 0;
+    width:100%;
+    height: 39px
 }
 .seCensor .btnList a{
   margin:0;
@@ -2340,7 +2346,7 @@ table .taC{
   margin:0;
 }
 .staffList{
-  overflow-y: auto;
+ overflow-y: auto;
 }
 .staffItem {
   float:left;
@@ -2507,7 +2513,7 @@ table .taC{
   transition: all 1.5s ease-in-out;
 }
 .down .qrcode:hover .saoma{
-  left:240px;
+ left:240px;
   opacity: 1;
 }
 .appDown .downButton{
@@ -2531,23 +2537,23 @@ table .taC{
 }
 /**/
 .inputErrow{
-  -webkit-animation:shake 1s .2s ease both;
-  -moz-animation:shake 1s .2s ease both;
-  animation:shake 1s .2s ease both;}
+-webkit-animation:shake 1s .2s ease both;
+-moz-animation:shake 1s .2s ease both;
+animation:shake 1s .2s ease both;}
 @-webkit-keyframes shake{
-  0%,100%{-webkit-transform:translateX(0);}
-  10%,30%,50%,70%, 90%{-webkit-transform:translateX(-10px);}
-  20%,40%,60%,80%{-webkit-transform:translateX(10px);}
+0%,100%{-webkit-transform:translateX(0);}
+10%,30%,50%,70%, 90%{-webkit-transform:translateX(-10px);}
+20%,40%,60%,80%{-webkit-transform:translateX(10px);}
 }
 @-moz-keyframes shake{
-  0%,100%{-moz-transform:translateX(0);}
-  10%,30%,50%,70%, 90%{-moz-transform:translateX(-10px);}
-  20%,40%,60%,80%{-moz-transform:translateX(10px);}
+0%,100%{-moz-transform:translateX(0);}
+10%,30%,50%,70%, 90%{-moz-transform:translateX(-10px);}
+20%,40%,60%,80%{-moz-transform:translateX(10px);}
 }
 @keyframes shake{
-  0%,100%{transform:translateX(0);}
-  10%,30%,50%,70%, 90%{transform:translateX(-10px);}
-  20%,40%,60%,80%{transform:translateX(10px);}
+0%,100%{transform:translateX(0);}
+10%,30%,50%,70%, 90%{transform:translateX(-10px);}
+20%,40%,60%,80%{transform:translateX(10px);}
 }
 .indexSportList li {
   display:inline-block;
@@ -2669,23 +2675,23 @@ table .taC{
   color:#f90000;
 }
 .remind .animation{
-  -webkit-animation:swing 2s .3s infinite ease both;
-  -moz-animation:swing 2s .3s infinite ease both;}
+-webkit-animation:swing 2s .3s infinite ease both;
+-moz-animation:swing 2s .3s infinite ease both;}
 @-webkit-keyframes swing{
-  20%,40%,60%,80%,100%{-webkit-transform-origin:top center}
-  20%{-webkit-transform:rotate(15deg)}
-  40%{-webkit-transform:rotate(-10deg)}
-  60%{-webkit-transform:rotate(5deg)}
-  80%{-webkit-transform:rotate(-5deg)}
-  100%{-webkit-transform:rotate(0deg)}
+20%,40%,60%,80%,100%{-webkit-transform-origin:top center}
+20%{-webkit-transform:rotate(15deg)}
+40%{-webkit-transform:rotate(-10deg)}
+60%{-webkit-transform:rotate(5deg)}
+80%{-webkit-transform:rotate(-5deg)}
+100%{-webkit-transform:rotate(0deg)}
 }
 @-moz-keyframes swing{
-  20%,40%,60%,80%,100%{-moz-transform-origin:top center}
-  20%{-moz-transform:rotate(15deg)}
-  40%{-moz-transform:rotate(-10deg)}
-  60%{-moz-transform:rotate(5deg)}
-  80%{-moz-transform:rotate(-5deg)}
-  100%{-moz-transform:rotate(0deg)}
+20%,40%,60%,80%,100%{-moz-transform-origin:top center}
+20%{-moz-transform:rotate(15deg)}
+40%{-moz-transform:rotate(-10deg)}
+60%{-moz-transform:rotate(5deg)}
+80%{-moz-transform:rotate(-5deg)}
+100%{-moz-transform:rotate(0deg)}
 }
 .datetimepicker .glyphicon-arrow-left:before{
   content: "<"
@@ -2717,7 +2723,7 @@ table .taC{
   margin: 0
 }
 .groupContent > form {
-  margin: 0px;
+    margin: 0px;
 }
 .groupCate legend{
   margin:0;
@@ -2846,10 +2852,10 @@ table .taC{
   z-index: 999
 }
 .demanHeader {
-  margin:20px 0;
-  background-color: #62AC4D ;
-  height: 215px;
-  overflow: hidden;
+ margin:20px 0;
+ background-color: #62AC4D ;
+ height: 215px;
+ overflow: hidden;
 
 }
 .demanHeader h1{
@@ -2979,12 +2985,12 @@ table .taC{
   color:#fff;
 }
 .demandTab .dTab {
-  background-color:#91d27f;
-  margin: 0px 5px 2px 0px;
-  padding: 0px 3px;
-  color: #666;
-  display: inline-block;
-  color: #fff
+    background-color:#91d27f;
+    margin: 0px 5px 2px 0px;
+    padding: 0px 3px;
+    color: #666;
+    display: inline-block;
+    color: #fff
 }
 .demandTab .dTab:hover{
   background-color: #62AC4D
@@ -3470,10 +3476,10 @@ legend .search{
   border-right: 1px solid #DDD
 }
 .sideSnav .snavLeve0 .num{
-  color: #FFF;
-  background: #999 none repeat scroll 0% 0%;
-  border-radius: 3px;
-  padding: 0px 5px;
+color: #FFF;
+background: #999 none repeat scroll 0% 0%;
+border-radius: 3px;
+padding: 0px 5px;
 }
 .sideMnav .navLeve1,.sideMnav .navLeve2{
   opacity: 0;
@@ -3493,7 +3499,7 @@ legend .search{
 }
 .searchItem {
   position: relative;
-}
+  }
 .searchItem .searchFrame{
   margin-right: 473px
 }
@@ -3624,8 +3630,8 @@ legend .search{
   border:1px solid transparent;
   border-radius: 4px 4px 0px 0px;
   margin-right: 2px;
-  position: relative;
-  display: block;
+      position: relative;
+    display: block;
 }
 .navTabs > li.active > a, .navTabs > li.active > a:focus, .navTabs > li.active > a:hover {
   color: #555;

+ 683 - 0
protected/class/client.php

@@ -0,0 +1,683 @@
+<?php
+
+class client {
+
+    private $ps_api_url, $ps_auth_key, $ps_vsersion;
+
+    /**
+     * 析构函数
+     * @param $ps_api_url 接口域名
+     * @param $ps_auth_key 加密密匙
+     */
+    public function __construct($ps_api_url = '127.0.0.1', $ps_auth_key = '', $ps_vsersion = '1') {
+        $this->ps_api_url = $ps_api_url;
+        $this->ps_auth_key = $ps_auth_key;
+        $this->ps_vsersion = $ps_vsersion;
+    }
+
+    /**
+     * 用户注册
+     * @param string $username 	用户名
+     * @param string $password 	密码
+     * @param string $email		email
+     * @param string $regip		注册ip
+     * @param string $random	密码随机数
+     * @return int {-1:用户名已经存在 ;-2:email已存在;-3:email格式错误;-4:用户名禁止注册;-5:邮箱禁止注册;int(uid):成功}
+     */
+    public function ps_member_register($username, $password, $email, $regip = '', $random = '') {
+        if (!$this->_is_email($email)) {
+            return -3;
+        }
+
+        return $this->_ps_send('register', array('username' => $username, 'password' => $password, 'email' => $email, 'regip' => $regip, 'random' => $random));
+    }
+
+    /**
+     * 用户移动端注册
+     * @param string $username 	用户名
+     * @param string $password 	密码
+     * @param string $mobile	mobile
+     * @param string $regip		注册ip
+     * @param string $random	密码随机数
+     * @return int {-1:用户名已经存在 ;-2:mobile已存在;-3:mobile格式错误;-4:用户名禁止注册;-5:手机禁止注册;int(uid):成功}
+     */
+    public function ps_member_mobile_register($username, $password, $mobile, $regip = '', $random = '') {
+        if (!$this->_is_mobile($mobile)) {
+            return -3;
+        }
+
+        return $this->_ps_send('mobileregister', array('username' => $username, 'password' => $password, 'mobile' => $mobile, 'regip' => $regip, 'random' => $random));
+    }
+
+    /**
+     * 用户登陆
+     * @param string $username 	用户名
+     * @param string $password 	密码
+     * @param int $isemail	email
+     * @return int {-2;密码错误;-1:用户名不存在;array(userinfo):用户信息}
+     */
+    public function zhsso_member_login($username, $password, $isemail = 0) {
+        if ($isemail) {
+            if (!$this->_is_email($username)) {
+                return -3;
+            }
+            $return = $this->_ps_send('login', array('email' => $username, 'password' => $password));
+        } else {
+            $return = $this->_ps_send('login', array('username' => $username, 'userpasswd' => $password));
+        }
+        return $return;
+    }
+
+    /**
+     * 同步登陆
+     * @param string $uid
+     * @return string javascript用户同步登陆js
+     */
+    public function ps_member_synlogin($uid) {
+        $uid = intval($uid);
+        return $this->_ps_send('synlogin', array('uid' => $uid));
+    }
+
+    /**
+     * 同步退出
+     * @param string $uid
+     * @return string javascript用户同步退出js
+     */
+    public function ps_member_synlogout() {
+        return $this->_ps_send('synlogout', array());
+    }
+
+    /**
+     * 编辑用户
+     * @param string $username		用户名
+     * @param string $email			email
+     * @param string $password		旧密码
+     * @param string $newpassword	新密码
+     * @param int $uid				phpsso用户uid
+     * @param string $random	 	密码随机数
+     * @return int {-1:用户不存在;-2:旧密码错误;-3:email已经存在 ;-4:email格式错误;1:成功;0:未作修改}
+     */
+    public function zhsso_member_edit($uid = '', $password = '', $newpassword = '', $useranswer = '') {
+///	if ($email && !$this->_is_email($email)) {
+//	    return -4;
+//	}
+        // TODO:增加判断输出返回值
+        return $this->_ps_send('edit', array('uid' => $uid, 'password' => $password, 'newpassword' => $newpassword, 'useranswer' => $useranswer));
+    }
+
+    public function setPayWay($uid, $idcards, $alipay, $tenpay) {
+        return $this->_ps_send('payway', array('uid' => $uid, 'idbank' => $idcards, 'alipay' => $alipay, 'tenpay' => $tenpay));
+    }
+
+    /**
+     * 删除用户头像
+     * @param int $uid				phpsso用户uid
+     * @return int {1:成功;0:失败}
+     */
+    public function ps_deleteavatar($uid) {
+        return $this->_ps_send('deleteavatar', array('uid' => $uid));
+    }
+
+    /**
+     * 获取用户信息
+     * @param $mix 用户id/用户名/email
+     * @param $type {1:用户id;2:用户名;3:email}
+     * @return $mix {-1:用户不存在;userinfo:用户信息}
+     */
+    public function ps_get_member_info($mix, $type = 1) {
+        if ($type == 1) {
+            $userinfo = $this->_ps_send('getuserinfo', array('uid' => $mix));
+        } elseif ($type == 2) {
+            $userinfo = $this->_ps_send('getuserinfo', array('username' => $mix));
+        } elseif ($type == 3) {
+            if (!$this->_is_email($mix)) {
+                return -4;
+            }
+            $userinfo = $this->_ps_send('getuserinfo', array('email' => $mix));
+        }
+        if ($userinfo) {
+            return $userinfo;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * 删除用户
+     * @param mix {1:用户id;2:用户名;3:email} 如果是用户id可以为数组
+     * @return int {-1:用户不存在;1:删除成功}
+     */
+    public function ps_delete_member($mix, $type = 1) {
+        if ($type == 1) {
+            $res = $this->_ps_send('delete', array('uid' => $mix));
+        } elseif ($type == 2) {
+            $res = $this->_ps_send('delete', array('username' => $mix));
+        } elseif ($type == 3) {
+            if (!$this->_is_email($mix)) {
+                return -4;
+            }
+            $res = $this->_ps_send('delete', array('email' => $mix));
+        }
+        return $res;
+    }
+
+    /**
+     * 检查用户是否可以注册
+     * @param string $username
+     * @return int {-4:用户名禁止注册;-1:用户名已经存在 ;1:成功}
+     */
+    public function ps_checkname($username) {
+        return $this->_ps_send('checkname', array('username' => $username));
+    }
+
+    /**
+     * 检查邮箱是否可以注册
+     * @param string $email
+     * @return int {-1:email已经存在 ;-5:邮箱禁止注册;1:成功}
+     */
+    public function ps_checkemail($email) {
+        return $this->_ps_send('checkemail', array('email' => $email));
+    }
+
+    /**
+     * 获取用户信息通过COOKIE UID
+     */
+    public function zhsso_getuserinfo() {
+        $uid = $this->authcode($_COOKIE[Doo::conf()->COOKIEPRE_WK . '_userid']);
+        return $this->_ps_send('getuserinfo', array('uid' => $uid));
+    }
+
+    /**
+     * 获取应用列表信息
+     */
+    public function zhsso_getUserbyName($uname) {
+        return $this->_ps_send('getuserinfo', array('username' => $uname));
+    }
+
+    /**
+     * 获取积分兑换比例列表
+     */
+    public function ps_getcreditlist() {
+        return $this->_ps_send('getcredit', array());
+    }
+
+    /**
+     * 兑换积分
+     * 用于何其他应用之间积分兑换
+     * @param int $uid			phpssouid
+     * @param int $from			本系统积分类型id
+     * @param int $toappid 		目标系统应用appid
+     * @param int $to			目标系统积分类型id
+     * @param int $credit		本系统扣除积分数
+     * @return bool 			{1:成功;0:失败}
+     */
+    public function ps_changecredit($uid, $from, $toappid, $to, $credit) {
+        return $this->_ps_send('changecredit', array('uid' => $uid, 'from' => $from, 'toappid' => $toappid, 'to' => $to, 'credit' => $credit));
+    }
+
+    /**
+     * 根据phpsso uid获取头像url
+     * @param int $uid 用户id
+     * @return array 四个尺寸用户头像数组
+     */
+    public function ps_getavatar($uid) {
+        $dir1 = ceil($uid / 10000);
+        $dir2 = ceil($uid % 10000 / 1000);
+        $url = $this->ps_api_url . 'data/avatar/' . $dir1 . '/' . $dir2 . '/' . $uid . '/';
+        $avatar = array('180' => $url . '180x180.jpg', '90' => $url . '90x90.jpg', '45' => $url . '45x45.jpg', '30' => $url . '30x30.jpg');
+        return $avatar;
+    }
+
+    /**
+     * 获取上传头像flash的html代码
+     * @param int $uid 用户id
+     */
+    public function ps_getavatar_upload_html($uid) {
+        $auth_data = $this->authcode($uid, 'ENCODE');
+//	echo $auth_data;
+//	list($a, $encodestr) = explode('=', $auth_data);
+        $upurl = base64_encode($this->ps_api_url . 'api/uploadavatar/' . rawurlencode($auth_data));
+//	$upurl = base64_encode($this->ps_api_url . '/index.php?m=phpsso&c=index&a=uploadavatar&auth_data=' . $auth_data);
+        $str = <<<EOF
+				<div id="phpsso_uploadavatar_flash"></div>
+				<script language="javascript" type="text/javascript" src="{$this->ps_api_url}global/js/swfobject.js"></script>
+				<script type="text/javascript">
+					var flashvars = {
+						'upurl':"{$upurl}&callback=return_avatar&"
+					};
+					var params = {
+						'align':'middle',
+						'play':'true',
+						'loop':'false',
+						'scale':'showall',
+						'wmode':'window',
+						'devicefont':'true',
+						'id':'Main',
+						'bgcolor':'#ffffff',
+						'name':'Main',
+						'allowscriptaccess':'always'
+					};
+					var attributes = {
+
+					};
+					swfobject.embedSWF("{$this->ps_api_url}global/swf/main.swf", "phpsso_uploadavatar_flash", "490", "434", "9.0.0","{$this->ps_api_url}global/swf/expressInstall.swf", flashvars, params, attributes);
+
+					function return_avatar(data) {
+						if(data == 1) {
+							window.location.reload();
+						}
+					}
+				</script>
+EOF;
+        return $str;
+    }
+
+    /**
+     * 字符串加密、解密函数
+     *
+     *
+     * @param	string	$txt		字符串
+     * @param	string	$operation	ENCODE为加密,DECODE为解密,可选参数,默认为ENCODE,
+     * @param	string	$key		密钥:数字、字母、下划线
+     * @param	string	$expiry		过期时间
+     * @return	string
+     */
+    function sys_auth($string, $operation = 'ENCODE', $key = '', $expiry = 0) {
+        $key_length = 4;
+        $key = md5($key != '' ? $key : $this->ps_auth_key);
+        $fixedkey = hash('md5', $key);
+        $egiskeys = md5(substr($fixedkey, 16, 16));
+        $runtokey = $key_length ? ($operation == 'ENCODE' ? substr(hash('md5', microtime(true)), -$key_length) : substr($string, 0, $key_length)) : '';
+        $keys = hash('md5', substr($runtokey, 0, 16) . substr($fixedkey, 0, 16) . substr($runtokey, 16) . substr($fixedkey, 16));
+        $string = $operation == 'ENCODE' ? sprintf('%010d', $expiry ? $expiry + time() : 0) . substr(md5($string . $egiskeys), 0, 16) . $string : base64_decode(substr($string, $key_length));
+
+        $i = 0;
+        $result = '';
+        $string_length = strlen($string);
+        for ($i = 0; $i < $string_length; $i++) {
+            $result .= chr(ord($string{$i}) ^ ord($keys{$i % 32}));
+        }
+        if ($operation == 'ENCODE') {
+            return $runtokey . str_replace('=', '', base64_encode($result));
+        } else {
+            if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $egiskeys), 0, 16)) {
+                return substr($result, 26);
+            } else {
+                return '';
+            }
+        }
+    }
+
+    /**
+     * 将数组转换为字符串
+     *
+     * @param	array	$data		数组
+     * @param	bool	$isformdata	如果为0,则不使用new_stripslashes处理,可选参数,默认为1
+     * @return	string	返回字符串,如果,data为空,则返回空
+     */
+    public function array2string($data, $isformdata = 1) {
+        if ($data == '')
+            return '';
+        if ($isformdata)
+            $data = new_stripslashes($data);
+        return var_export($data, TRUE);
+    }
+
+    public function auth_data($data) {
+        $s = $sep = '';
+//	foreach ($data as $k => $v) {
+//	    if (is_array($v)) {
+//		$s2 = $sep2 = '';
+//		foreach ($v as $k2 => $v2) {
+//		    $s2 .= "$sep2{$k}[$k2]=" . $this->_ps_stripslashes($v2);
+//		    $sep2 = '&';
+//		}
+//		$s .= $sep . $s2;
+//	    } else {
+//		$s .= "$sep$k=" . $this->_ps_stripslashes($v);
+//	    }
+//	    $sep = '&';
+//	}
+        $s = http_build_query($data);
+        $auth_s = 'data=' . urlencode($this->authcode($s, 'ENCODE'));
+        return $auth_s;
+    }
+
+    /**
+     * 发送数据
+     * @param $action 操作
+     * @param $data 数据
+     */
+    private function _ps_send($action, $data = null) {
+        return $this->_ps_post($this->ps_api_url . "api/" . $action, 500000, $this->auth_data($data));
+    }
+
+    /**
+     *  post数据
+     *  @param string $url		post的url
+     *  @param int $limit		返回的数据的长度
+     *  @param string $post		post数据,字符串形式username='dalarge'&password='123456'
+     *  @param string $cookie	模拟 cookie,字符串形式username='dalarge'&password='123456'
+     *  @param string $ip		ip地址
+     *  @param int $timeout		连接超时时间
+     *  @param bool $block		是否为阻塞模式
+     *  @return string			返回字符串
+     */
+    private function _ps_post($url, $limit = 0, $post = '', $cookie = '', $ip = '', $timeout = 15, $block = true) {
+        $return = '';
+        $matches = parse_url($url);
+        $host = $matches['host'];
+//	$path = $matches['path'] ? $matches['path'] . ($matches['query'] ? '?' . $matches['query'] : '') : '/';
+        $path = $matches['path'] ? $matches['path'] : '/';
+        $port = !empty($matches['port']) ? $matches['port'] : 80;
+        $siteurl = $this->_get_url();
+        if ($post) {
+            $out = "POST $path HTTP/1.1\r\n";
+            $out .= "Accept: */*\r\n";
+            $out .= "Referer: " . $siteurl . "\r\n";
+            $out .= "Accept-Language: zh-cn\r\n";
+            $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
+            $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n";
+            $out .= "Host: $host\r\n";
+            $out .= 'Content-Length: ' . strlen($post) . "\r\n";
+            $out .= "Connection: Close\r\n";
+            $out .= "Cache-Control: no-cache\r\n";
+            $out .= "Cookie: $cookie\r\n\r\n";
+            $out .= $post;
+        } else {
+            $out = "GET $path HTTP/1.1\r\n";
+            $out .= "Accept: */*\r\n";
+            $out .= "Referer: " . $siteurl . "\r\n";
+            $out .= "Accept-Language: zh-cn\r\n";
+            $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n";
+            $out .= "Host: $host\r\n";
+            $out .= "Connection: Close\r\n";
+            $out .= "Cookie: $cookie\r\n\r\n";
+        }
+        $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);
+        if (!$fp)
+            return '';
+
+        stream_set_blocking($fp, $block);
+        stream_set_timeout($fp, $timeout);
+        @fwrite($fp, $out);
+        $status = stream_get_meta_data($fp);
+
+        if ($status['timed_out'])
+            return '';
+        while (!feof($fp)) {
+            if (($header = @fgets($fp)) && ($header == "\r\n" || $header == "\n"))
+                break;
+        }
+
+        $stop = false;
+        while (!feof($fp) && !$stop) {
+            $data = fread($fp, ($limit == 0 || $limit > 8192 ? 8192 : $limit));
+            $return .= $data;
+            if ($limit) {
+                $limit -= strlen($data);
+                $stop = $limit <= 0;
+            }
+        }
+        @fclose($fp);
+
+        //部分虚拟主机返回数值有误,暂不确定原因,过滤返回数据格式
+        $return_arr = explode("\n", $return);
+        if (isset($return_arr[1])) {
+            $return = trim($return_arr[1]);
+        }
+        unset($return_arr);
+
+        return $return;
+    }
+
+    /**
+     * 过滤字符串
+     * @param $string
+     */
+    private function _ps_stripslashes($string) {
+        !defined('MAGIC_QUOTES_GPC') && define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
+        if (MAGIC_QUOTES_GPC) {
+            return stripslashes($string);
+        } else {
+            return $string;
+        }
+    }
+
+    /**
+     * 获取当前页面完整URL地址
+     */
+    private function _get_url() {
+        $sys_protocal = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
+        $php_self = $_SERVER['PHP_SELF'] ? $this->_safe_replace($_SERVER['PHP_SELF']) : $this->_safe_replace($_SERVER['SCRIPT_NAME']);
+        $path_info = isset($_SERVER['PATH_INFO']) ? $this->_safe_replace($_SERVER['PATH_INFO']) : '';
+        $relate_url = isset($_SERVER['REQUEST_URI']) ? $this->_safe_replace($_SERVER['REQUEST_URI']) : $php_self . (isset($_SERVER['QUERY_STRING']) ? '?' . $this->_safe_replace($_SERVER['QUERY_STRING']) : $path_info);
+        return $sys_protocal . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . $relate_url;
+    }
+
+    /**
+     * 安全过滤函数
+     *
+     * @param $string
+     * @return string
+     */
+    private function _safe_replace($string) {
+        $string = str_replace('%20', '', $string);
+        $string = str_replace('%27', '', $string);
+        $string = str_replace('%2527', '', $string);
+        $string = str_replace('*', '', $string);
+        $string = str_replace('"', '&quot;', $string);
+        $string = str_replace("'", '', $string);
+        $string = str_replace('"', '', $string);
+        $string = str_replace(';', '', $string);
+        $string = str_replace('<', '&lt;', $string);
+        $string = str_replace('>', '&gt;', $string);
+        $string = str_replace("{", '', $string);
+        $string = str_replace('}', '', $string);
+        $string = str_replace('\\', '', $string);
+        return $string;
+    }
+
+    /**
+     * 判断email格式是否正确
+     * @param $string email
+     */
+    private function _is_email($email) {
+        return strlen($email) > 6 && preg_match("/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/", $email);
+    }
+
+    /**
+     * 判断email格式是否正确
+     * @param $string email
+     */
+    public function getUserName() {
+        $username = self::get_cookie('_username');
+        if ($username) {
+            return $username;
+        } else {
+            return FALSE;
+        }
+    }
+
+    /**
+     * 判断email格式是否正确
+     * @param $string email
+     */
+    public function getAuth() {
+        $auth = self::get_cookie('auth');
+        if ($auth) {
+            return $auth;
+        } else {
+            return FALSE;
+        }
+    }
+
+    /**
+     * 判断email格式是否正确
+     * @param $string email
+     */
+    public function getUserID() {
+        $userid = self::get_cookie('_userid');
+        if ($userid) {
+            return $userid;
+        } else {
+            return FALSE;
+        }
+    }
+
+    public function get_cookie($var, $default = '') {
+        $varvar = Doo::conf()->COOKIEPRE_WK . $var;
+        return isset($_COOKIE[$varvar]) ? $this->authcode($_COOKIE[$varvar], 'DECODE') : $default;
+    }
+
+    /**
+     *
+     * 网络传输、cookie加密函数
+     * @param type $string
+     * @param type $operation
+     * @param type $key
+     * @param type $expiry
+     * @return string
+     */
+    function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {
+        $ckey_length = 4;
+        $key = md5($key != '' ? $key : Doo::conf()->AUTHKEY);
+        $keya = md5(substr($key, 0, 16));
+        $keyb = md5(substr($key, 16, 16));
+        $keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length) : substr(md5(microtime()), -$ckey_length)) : '';
+
+        $cryptkey = $keya . md5($keya . $keyc);
+        $key_length = strlen($cryptkey);
+
+        $string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0) . substr(md5($string . $keyb), 0, 16) . $string;
+        $string_length = strlen($string);
+
+        $result = '';
+        $box = range(0, 255);
+
+        $rndkey = array();
+        for ($i = 0; $i <= 255; $i++) {
+            $rndkey[$i] = ord($cryptkey[$i % $key_length]);
+        }
+
+        for ($j = $i = 0; $i < 256; $i++) {
+            $j = ($j + $box[$i] + $rndkey[$i]) % 256;
+            $tmp = $box[$i];
+            $box[$i] = $box[$j];
+            $box[$j] = $tmp;
+        }
+
+        for ($a = $j = $i = 0; $i < $string_length; $i++) {
+            $a = ($a + 1) % 256;
+            $j = ($j + $box[$a]) % 256;
+            $tmp = $box[$a];
+            $box[$a] = $box[$j];
+            $box[$j] = $tmp;
+            $result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));
+        }
+
+        if ($operation == 'DECODE') {
+            if ((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26) . $keyb), 0, 16)) {
+                return substr($result, 26);
+            } else {
+                return '';
+            }
+        } else {
+            return $keyc . str_replace('=', '', base64_encode($result));
+        }
+    }
+
+    public function logoutz() {
+//	header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
+        setcookie(Doo::conf()->COOKIEPRE_WK . 'auth', '', 0, '/', Doo::conf()->APP_URL, 0);
+        setcookie(Doo::conf()->COOKIEPRE_WK . '_username', '', 0, '/', Doo::conf()->APP_URL, 0);
+        setcookie(Doo::conf()->COOKIEPRE_WK . '_userid', '', 0, '/', Doo::conf()->APP_URL, 0);
+    }
+
+    /**
+     * 用户登陆
+     * @param string $username 	用户名
+     * @param string $password 	密码
+     * @param int $isemail	email
+     * @return int {-2;密码错误;-1:用户名不存在;array(userinfo):用户信息}
+     */
+    public function ps_member_login($username, $password, $isemail = 0) {
+        if ($isemail) {
+            if (!$this->_is_email($username)) {
+                return -3;
+            }
+            $return = $this->_ps_send('login', array('email' => $username, 'password' => $password));
+        } else {
+            $return = $this->_ps_send('login', array('username' => $username, 'password' => $password));
+        }
+        return $return;
+    }
+
+//    public function wksetcookit($username, $password, $isemail = 0) {
+//        setcookie(Doo::conf()->COOKIEPRE_WK . 'auth', $client->authcode($ObjUserInfo[0]->id . "\t" . $this->clientIP(), 'ENCODE'), 0, '/', '192.168.1.140', 0);
+//        setcookie(Doo::conf()->COOKIEPRE_WK . '_userid', $client->authcode($ObjUserInfo[0]->id, 'ENCODE'), 0, '/', '192.168.1.140', 0);
+//        setcookie(Doo::conf()->COOKIEPRE_WK . '_username', $client->authcode($ObjUserInfo[0]->username, 'ENCODE'), 0, '/', '192.168.1.140', 0);
+//    }
+
+    /**
+     * 用户登陆
+     * @param string $username 	用户名
+     * @param string $password 	密码
+     * @param int $isemail	email
+     * @return int {-2;密码错误;-1:用户名不存在;array(userinfo):用户信息}
+     */
+    public function zhsso_member_bank($userid) {
+        if (empty($userid))
+            return false;
+        return $this->_ps_send('getBank', array('uid' => $userid));
+    }
+
+    /**
+     * 金额增加
+     * @param string $userid 	用户唯一标示符
+     * @param string $m 	操作金额
+     * @param int $appid	应用程序ID,标示操作来源{wenku,ask}
+     * @return int {0;金额增加失败;1:金额增加成功;}
+     */
+    public function zhsso_member_madd($userid, $m, $appid) {
+        if (empty($userid) || empty($m) || empty($appid))
+            return false;
+        return $this->_ps_send('madd', array('uid' => $userid, 'bank' => $m, 'appid' => $appid));
+    }
+
+    /**
+     * 金额减少
+     * @param string $userid 	用户唯一标示符
+     * @param string $m 	操作金额
+     * @param int $appid	应用程序ID,标示操作来源{wenku,ask}
+     * @return int {-1;金额不够减;0;金额减少失败;1:金额减少成功;}
+     */
+    public function zhsso_member_msub($userid, $m, $appid) {
+        if (empty($userid) || empty($m) || empty($appid))
+            return false;
+        return $this->_ps_send('msub', array('uid' => $userid, 'bank' => $m, 'appid' => $appid));
+    }
+
+
+    /**
+     * 发送微信公众号信息
+     * @param string $user 	  联系人  必填
+     * @param string $msg		内容  必填
+     * @param string $type      类型   可选,默认是图文
+     * @param string $title  图文标题   不选定text时必填
+     * @param string $url  图文链接   不选定text时必填
+     * @return int {-1:联系人(微信id)为空 ;-2:内容为空;-3:不选定text时标题为空;-4:不选定text时链接为空;-5:发送失败;1:发送成功}
+     */
+    public function SendMsg($user,$msg,$type='',$title='',$url=''){
+        if (empty($user) || empty($msg))
+            return false;
+        if($type != 'text'){
+            if (empty($title) || empty($url))
+                return false;
+        }
+        return $this->_ps_send('sendmsg', array('user' => $user, 'msg' => $msg, 'type' => $type, 'title' => $title, 'url' => $url));
+    }
+
+}
+
+?>

+ 2 - 2
protected/config/routes.conf.php

@@ -91,8 +91,8 @@ $route['*']['/keyonline'] = array('MainController', 'keyonline');
 $route['*']['/searchlongle'] = array('MainController', 'keyonline');
 
 $route['*']['/keyonline/:lid'] = array('MainController', 'keyonline');
-$route['*']['/keyonline/:year/:cid/:status'] = array('MainController', 'keyonline');
-$route['*']['/keyonline/:year/:cid/:status/:lid'] = array('MainController', 'keyonline');
+$route['*']['/keyonline/:year/:cid/:staff/:status'] = array('MainController', 'keyonline');
+$route['*']['/keyonline/:year/:cid/:staff/:status/:lid'] = array('MainController', 'keyonline');
 
 $route['*']['/ajaxGetLongle'] = array('MainController', 'ajaxGetLongle');
 

+ 69 - 25
protected/controller/MainController.php

@@ -169,43 +169,60 @@ class MainController extends DooController {
 		return "/";
 	}
 
-	function index2(){
+	function index2()
+	{
 		//include Doo::conf()->BASE_PATH.'diagnostic/debug.php';
-		$cid=$this->get_args('cid')?$this->get_args('cid'):0;
-		$sid=$this->get_args('sid')?$this->get_args('sid'):0;
-		$page=$this->get_args('page')?$this->get_args('page'):1;
+		$cid = $this->get_args('cid') ? $this->get_args('cid') : 0;
+		$sid = $this->get_args('sid') ? $this->get_args('sid') : 0;
+		$page = $this->get_args('page') ? $this->get_args('page') : 1;
 
 		Doo::loadModel('action_log');
-		$action_log=new action_log();
-		Doo::loadModel ( 'staff' );
+		$action_log = new action_log();
+		Doo::loadModel('staff');
 		$staff = new staff ();
 		Doo::loadModel('client_staff');
-		$client_staff=new client_staff();
+		$client_staff = new client_staff();
 		Doo::loadModel('longle');
-		$longle=new longle();
+		$longle = new longle();
 		Doo::loadModel('L_category');
 		$lcategory = new L_category ();
 
-		$limit=50;$p=$page;
-		if ($page!=1)
-			$page=$page*$limit-1;
+		$limit = 50;
+		$p = $page;
+		if ($page != 1)
+			$page = $page * $limit - 1;
 		else
 			$page--;
 
 
-		$condition="";
-		if (!empty($cid)&&$cid!=12){
-			$condition=" and cid=".$cid." and sid=".$sid;
-		}
+		$condition = "";
+//		if (!empty($cid) && $cid != 12) {
+//			$condition = " and cid=" . $cid . " and sid=" . $sid;
+//		}
 
-		$staffCondition="";
-		if($this->staff[0]['cid']!=12){
-			$staffCondition=" and cid=".$this->staff[0]['cid'];
-			if(!empty($sid))
-				$condition=" and cid=".$this->staff[0]['cid']." and sid=".$sid;
+		$staffCondition = "";
+		$categorylist2 = array();
+		if ($this->staff[0]['cid'] != 12) {
+			$staffCondition = " and cid=" . $this->staff[0]['cid'];
+			array_push($categorylist2, array('cid' => $this->staff[0]['cid'], 'title' => $this->staff[0]['category']));
+			if (!empty($sid))
+				$condition = " and cid=" . $this->staff[0]['cid'] . " and sid=" . $sid;
 			else
-				$condition=" and cid=".$this->staff[0]['cid'];
+				$condition = " and cid=" . $this->staff[0]['cid'];
+		} else {
+			$sql = 'SELECT `CLD_L_category`.cid,`CLD_L_category`.title,count(`CLD_staff`.sid) as count FROM `CLD_L_category` left join `CLD_staff` on `CLD_L_category`.cid=`CLD_staff`.cid group by `CLD_staff`.cid HAVING count(`CLD_staff`.sid)>0 order by count(`CLD_staff`.sid) desc';
+			$query = Doo::db()->query($sql);
+			$result = $query->fetchAll();
+			$categorylist2 = $result;
+		}
+		if (!empty($cid)){
+			$staffCondition = " and cid=" . $cid;
+			if (!empty($sid))
+				$condition = " and cid=" . $cid . " and sid=" . $sid;
+			else
+				$condition = " and cid=" . $cid;
 		}
+
 		/*
 		$itemCategoryList=$action_log->find(array('select'=>'updatetime,COUNT(*)',
 		'where'=>" Year(updatetime)=2014",'groupby'=>'Month(updatetime)','asArray'=>true));
@@ -280,6 +297,7 @@ class MainController extends DooController {
 		$data['log']=$log;
 		$data['page']=$p;
 		$data['staffList']=$staffList;
+		$data['categorylist2']=$categorylist2;
 		$data['cid']=$cid;
 		$data['sid']=$sid;
 		$data['memu']="index";
@@ -383,8 +401,18 @@ class MainController extends DooController {
 		$lcategory = new L_category ();
 
 		$staffCondition="";
-		if($this->staff[0]['cid']!=12)
+		$categorylist2=array();
+		if($this->staff[0]['cid']!=12){
 			$staffCondition=" and cid=".$this->staff[0]['cid'];
+			array_push($categorylist2,array('cid'=>$this->staff[0]['cid'],'title'=>$this->staff[0]['category']));
+		}else{
+			$sql = 'SELECT `CLD_L_category`.cid,`CLD_L_category`.title,count(`CLD_staff`.sid) as count FROM `CLD_L_category` left join `CLD_staff` on `CLD_L_category`.cid=`CLD_staff`.cid group by `CLD_staff`.cid HAVING count(`CLD_staff`.sid)>0 order by count(`CLD_staff`.sid) desc';
+			$query = Doo::db ()->query ( $sql );
+			$result = $query->fetchAll ();
+			$categorylist2 = $result;
+		}
+		if(!empty($cid))
+			$staffCondition=" and cid=".$cid;
 //Doo::db()->beginTransaction();
 		$staffList=$staff->find(array('where'=>' username !="admin"'.$staffCondition,'asArray'=>true));
 
@@ -544,6 +572,7 @@ class MainController extends DooController {
 		$data['statisticsDay']=json_encode($statisticsDay);
 		$data['statisticsClient']=json_encode($statisticsClient);
 		$data['statisticsLongle']=json_encode($statisticsLongle);
+		$data['categorylist2']=$categorylist2;
 
 		$data['Ssum']=round(($Ssum/$Rsum)*100).'%';
 		$data['Rsum']=$Rsum;
@@ -582,8 +611,18 @@ class MainController extends DooController {
 		$district = new district ();
 
 		$staffCondition="";
-		if($this->staff[0]['cid']!=12)
+		$categorylist2=array();
+		if($this->staff[0]['cid']!=12){
 			$staffCondition=" and cid=".$this->staff[0]['cid'];
+			array_push($categorylist2,array('cid'=>$this->staff[0]['cid'],'title'=>$this->staff[0]['category']));
+		}else{
+			$sql = 'SELECT `CLD_L_category`.cid,`CLD_L_category`.title,count(`CLD_staff`.sid) as count FROM `CLD_L_category` left join `CLD_staff` on `CLD_L_category`.cid=`CLD_staff`.cid group by `CLD_staff`.cid HAVING count(`CLD_staff`.sid)>0 order by count(`CLD_staff`.sid) desc';
+			$query = Doo::db ()->query ( $sql );
+			$result = $query->fetchAll ();
+			$categorylist2 = $result;
+		}
+		if(!empty($cid))
+			$staffCondition=" and cid=".$cid;
 
 		$staffList=$staff->find(array('where'=>' username!="admin"'.$staffCondition,'asArray'=>true));
 
@@ -787,6 +826,7 @@ class MainController extends DooController {
 		$data['statisticsClient']=json_encode($statisticsClient);
 		$data['statisticsLongle']=json_encode($statisticsLongle);
 		$data['statisticsGet']=json_encode($statisticsGet);
+		$data['categorylist2']=$categorylist2;
 
 		$data['Ssum']=round(($Ssum/$Rsum)*100).'%';
 		$data['Rsum']=$Rsum;
@@ -2238,6 +2278,9 @@ class MainController extends DooController {
 		$cid=$this->get_args('cid')?$this->get_args('cid'):"";	
 		if (empty($cid))
 			$cid=isset($this->params['cid'])?$this->params['cid']:$this->staff[0]['cid'];
+		$staff=$this->get_args('staff')?$this->get_args('staff'):"";
+		if (empty($staff))
+			$staff=isset($this->params['staff'])?$this->params['staff']:"";
 		$status=$this->get_args('status')?$this->get_args('status'):"";	
 		if (empty($status))
 			$status=isset($this->params['status'])?$this->params['status']:0;
@@ -2248,7 +2291,7 @@ class MainController extends DooController {
 		Doo::loadModel ( 'longle' );
 		$longle = new longle ();
 
-		$data['longleArray']=$longle->getLongleByStatus($year,$cid,$status,$search,$productW);
+		$data['longleArray']=$longle->getLongleByStatus($year,$cid,$staff,$status,$search,$productW);
 
 		//获取接收锁信息
 		//$longle->getLongleByRe($this->staff[0]['cid'],1);
@@ -2261,6 +2304,7 @@ class MainController extends DooController {
 		$data['reLongle']=$longle->count(array('where'=>$othstr.'  and status=1'));
 		$data['cid']=$cid;
 		$data['year']=$year;
+		$data['staff']=$staff;
 		$data['status']=$status;
 		$data['productName']=$productW;
 		
@@ -2277,6 +2321,7 @@ class MainController extends DooController {
 		
 		$data['staffu']=$staff->getUserById($_COOKIE["staff"]);
 		$data['category']=$L_category->getCategory();
+		$data['staffList']=$staff->getStaffByCid($cid);
 
 		if($cid==1)
 			$data['cid']=$data['category'][0]['cid'];
@@ -6159,7 +6204,6 @@ function excelTime($date, $time = false)
 		return $result ['count'];
 	}
 
-
 }
 
 ?>

+ 55 - 3
protected/controller/ReceiptController.php

@@ -3376,6 +3376,10 @@ $verifyDetail=$verify->find(array('where'=>' (staff not like "%\"'.$this->staff[
 				$receipt->verifyBreakup=$verifyString;
 				$receiptDetailObj->status=3;
 				$receiptDetailObj->update(array('where'=>'rid='.$rid));
+
+				//微信企业号通知
+				$this->setWXMsg($rid,3);
+
 			}elseif(count($verifyStaff)==count($verifyDetail)){//要修改 角色的数量
 				$receipt->status=6;
 				
@@ -3389,6 +3393,9 @@ $verifyDetail=$verify->find(array('where'=>' (staff not like "%\"'.$this->staff[
 				$loanReceipt->pastDate=date("Y-m-d");
 				
 				$loanReceipt->update(array('where'=>' rid = '.$receiptDetail['loanRid']));
+
+				//微信企业号通知
+				$this->setWXMsg($rid,1);
 				
 			}
 			
@@ -6546,7 +6553,9 @@ $receiptList[$key]['verifyList']=$verifyList;
 				$receiptLog->status=3;
 				$receiptLog->rid=$rid;
 				$receiptLog->insert();
-				
+
+				//微信企业号通知
+				$this->setWXMsg($rid,3);
 				
 			}elseif(count($verifyStaff)==count($verifyDetail)){//要修改 角色的数量
 				$receipt->status=1;$reviseSum=0;
@@ -6664,6 +6673,9 @@ $receiptList[$key]['verifyList']=$verifyList;
 				}
 			}
 				$receipt->pastDate=date("Y-m-d");
+
+				//微信企业号通知
+				$this->setWXMsg($rid,1);
 			}
 			
 			$receipt->update(array('where'=>' rid = '.$rid));
@@ -6724,6 +6736,10 @@ $receiptList[$key]['verifyList']=$verifyList;
 			
 			$receipt->status=4;
 			$receipt->update(array('where'=>'rid='.$rid));
+
+			//微信企业号通知
+			$this->setWXMsg($rid,2);
+
 		}
 		
 		//echo "ddd";
@@ -6784,8 +6800,10 @@ $receiptList[$key]['verifyList']=$verifyList;
 			
 			$receipt->status=4;
 			$receipt->update(array('where'=>'rid='.$rid));
-			
-			
+
+			//微信企业号通知
+			$this->setWXMsg($rid,2);
+
 			echo json_encode ( array (
 					'status' => 1
 			) );die;
@@ -9024,6 +9042,39 @@ $receiptList[$key]['verifyList']=$verifyList;
 		}
 		}
 	}
+
+
+	function setWXMsg($rid,$type){
+
+		Doo::loadModel("receipt");
+		$receipt=new receipt();
+		$receiptDetail = $receipt->getOne(array('where'=>'rid='.$rid,'asArray'=>true));
+		if(!empty($receiptDetail)){
+			Doo::loadModel('staff');
+			$staff = new staff();
+			$staffmsg = $staff->getStaffBySid($receiptDetail['staff']);
+			if(!empty($staffmsg['wxid'])){
+				require_once (SITE_PATH . '/protected/class/client.php');
+				$client = new client ('http://m.cld.smartcost.com.cn/');
+				$user = $staffmsg['wxid'];
+				$receiptName = '';
+				$msg = '';
+				switch($receiptDetail['Rtype']){
+					case 0:$receiptName = '报销';break;
+					case 1:$receiptName = '借款';break;
+					case 2:$receiptName = '对公汇款';break;
+				}
+				switch($type){
+					case 1:$msg = '太好了,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已同意支付。';break;
+					case 2:$msg = '注意,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已被撤回,请及时处理。';break;
+					case 3:$msg = '很遗憾,您的'.$receiptName.' '.$receiptDetail['receiptOrder'].',¥'.$receiptDetail['sum'].',已被终止。';break;
+				}
+
+				$result = $client->SendMsg($user,$msg,'text');
+			}
+
+		}
+	}
 	
 // Email发送函数
     function SMail($toemail, $subject, $contents) {
@@ -9258,4 +9309,5 @@ function get_previous($on_page = 1) {
 	return $on_page != 0 ? $on_page - 1 : $on_page;
 }
 }
+
 ?>

+ 8 - 5
protected/model/longle.php

@@ -27,14 +27,14 @@ class longle extends DooModel {
 	public $_primarykey = 'lid';
 	public $_fields = array ('lid', 'year', 'cid','category','product_id', 'status','statuslog','statusT', 'key_num','SerialNumber','product','alloted_time', 'make_day','version', 'responsible','client','clientid' );
 	
-	public function getLongleByStatus($year=0,$cid=0,$status=0,$search="",$productW=""){
+	public function getLongleByStatus($year=0,$cid=0,$staff=0,$status=0,$search="",$productW=""){
 		
 		if(empty($search)){
 			$str="( status=".$status." or statuslog like '%".$status."%' )";
 			$str2=" and make_day like '%".$year."%'";
 			$str3=" and cid =".$cid."";
 			$str4=" and product like '%".$productW."%'";
-			
+			$str5=' and responsible="'.$staff.'"';
 			if(empty($productW))
 				$str4="";
 				
@@ -43,14 +43,17 @@ class longle extends DooModel {
 				
 			if($year==0)
 				$str2="";
-				
+
+			if(empty($staff))
+				$str5="";
+
 			if($status==0)
 				$str=" 1 ";
 				
 				//echo $str.$str2.$str3.$str4;
 				
-			'select * form CLD_longle as a left join CLD_client as b on (a.clientid =b.cid) where ( status=3 or statuslog like "%3%" ) and make_day like "%2015%" and cid =10';	
-			return $this->find ( array ('where' => $str.$str2.$str3.$str4, 'asArray' => TRUE ) );
+//			'select * form CLD_longle as a left join CLD_client as b on (a.clientid =b.cid) where ( status=3 or statuslog like "%3%" ) and make_day like "%2015%" and cid =10';
+			return $this->find ( array ('where' => $str.$str2.$str3.$str4.$str5, 'asArray' => TRUE ) );
 		}else{
 			return $this->find ( array ('where' => " key_num like '%".$search."%'", 'asArray' => TRUE ) );
 		}

+ 13 - 4
protected/view/index2.html

@@ -41,9 +41,13 @@
 	  					<div class="mostTab"></div>
 	  					<div class="mostList autoHeightI1" data-placement="top" data-toggle="ctooltip" data-original-title="滚动条隐藏了,用鼠标滚轮下拉吧">
 	  						<ul class="item">
-	  							<li <!-- if empty({{sid}}) -->class="now" <!-- endif --> >
-	  								<h2><a href='/'>大家</a></h2>
-	  							</li>
+								<li class="select <!-- if empty({{sid}}) -->now<!-- endif -->">
+									<select id="cateselect">
+										<!-- loop categorylist2 -->
+										<option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
+										<!-- endloop -->
+									</select>
+								</li>
 	  							<!-- loop staffList -->
 	  							<li <!-- if {{staffList' value.sid}}=={{sid}} -->class="now" <!-- endif -->>
 	  								<a href="/index?cid={{staffList' value.cid}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
@@ -160,5 +164,10 @@
 
 
     <!--弹出内容-->    
-<script type="text/javascript">autoFlashHeight();</script>	
+<script type="text/javascript">autoFlashHeight();</script>
+<script>
+	$('#cateselect').change(function(){
+		window.location.href = "/index?cid="+$(this).val();
+	})
+</script>
 </body>

+ 13 - 4
protected/view/indexLongle.html

@@ -258,9 +258,13 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 	  					<div class="mostTab"></div>
 	  					<div class="mostList autoHeightI1" data-placement="top" data-toggle="ctooltip" data-original-title="滚动条隐藏了,用鼠标滚轮下拉吧">
 	  						<ul class="item">
-	  							<li <!-- if empty({{sid}}) -->class="now" <!-- endif --> >
-	  								<h2><a href='/longleStatistics'>大家</a></h2>
-	  							</li>
+                                <li class="select <!-- if empty({{sid}}) -->now<!-- endif -->">
+                                    <select id="cateselect">
+                                        <!-- loop categorylist2 -->
+                                        <option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
+                                        <!-- endloop -->
+                                    </select>
+                                </li>
 	  							<!-- loop staffList -->
 	  							<li <!-- if {{staffList' value.sid}}=={{sid}} -->class="now" <!-- endif -->>
 	  								<a href="/longleStatistics?cid={{staffList' value.cid}}&sid={{staffList' value.sid}}"><div class="avtra"><img src="{{staffList' value.avatar}}_2.jpg"></div>
@@ -324,5 +328,10 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 	</div>
 	
 	
-<script type="text/javascript">autoFlashHeight();</script>	
+<script type="text/javascript">autoFlashHeight();</script>
+<script>
+    $('#cateselect').change(function(){
+        window.location.href = "/longleStatistics?cid="+$(this).val();
+    })
+</script>
 </body>

+ 12 - 3
protected/view/indexStat.html

@@ -252,8 +252,12 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 	  					<div class="mostTab"></div>
 	  					<div class="mostList autoHeightI1" data-placement="top" data-toggle="ctooltip" data-original-title="滚动条隐藏了,用鼠标滚轮下拉吧">
 	  						<ul class="item">
-	  							<li <!-- if empty({{sid}}) -->class="now" <!-- endif --> >
-	  								<h2><a href='/logStatistics'>大家</a></h2>
+	  							<li class="select <!-- if empty({{sid}}) -->now<!-- endif -->">
+                                    <select id="cateselect">
+                                        <!-- loop categorylist2 -->
+                                        <option value="{{categorylist2' value.cid}}" <!-- if {{categorylist2' value.cid}} == {{cid}} -->selected<!-- endif -->>{{categorylist2' value.title}}</option>
+                                        <!-- endloop -->
+                                    </select>
 	  							</li>
 	  							<!-- loop staffList -->
 	  							<li <!-- if {{staffList' value.sid}}=={{sid}} -->class="now" <!-- endif -->>
@@ -294,5 +298,10 @@ myChart.on(ecConfig.EVENT.PIE_SELECTED, function (param){
 	</div>
 	
 	
-<script type="text/javascript">autoFlashHeight();</script>	
+<script type="text/javascript">autoFlashHeight();</script>
+<script>
+    $('#cateselect').change(function(){
+        window.location.href = "/logStatistics?cid="+$(this).val();
+    })
+</script>
 </body>

+ 6 - 0
protected/view/lock_look.html

@@ -42,6 +42,12 @@
 	  					<option <!-- if {{cid}}=={{category' value.cid}} --> selected <!-- endif --> value="{{category' value.cid}}">{{category' value.title}}</option>
 	  					<!-- endloop -->
 	  					</select>
+						<select name="staff" onchange="longleSub()">
+							<option value="">负责人</option>
+							<!-- loop staffList -->
+							<option <!-- if {{staff}}=={{staffList' value.username}} --> selected <!-- endif --> value="{{staffList' value.username}}">{{staffList' value.username}}</option>
+							<!-- endloop -->
+						</select>
 	  					<select name="status" onchange="longleSub()">
 	  					<option <!-- if {{status}}==0 --> selected <!-- endif --> value="0">不限</option>
 	  					<option <!-- if {{status}}==1 --> selected <!-- endif --> value="1">生成</option>