|
|
@@ -1476,17 +1476,25 @@ class MainController extends DooController {
|
|
|
$clientname = trim ( $clientname );
|
|
|
|
|
|
$token = $this->get_args ( 'token' ) ? $this->get_args ( 'token' ) : "";
|
|
|
+ $tokenTime = $this->get_args ( 'tokenTime' ) ? $this->get_args ( 'tokenTime' ) : "";
|
|
|
|
|
|
if (empty ( $token )) {
|
|
|
die ( 'illegal request-token' );
|
|
|
} else {
|
|
|
session_start ();
|
|
|
- if ($_SESSION ['token_' . $this->staff [0] ['sidKey']] != $token) {
|
|
|
- header ( 'Content-Type:text/html;charset=utf-8' );
|
|
|
- die ( '请勿重复填写客户资料' );
|
|
|
- } else {
|
|
|
- $_SESSION ['token_' . $this->staff [0] ['sidKey']] = '';
|
|
|
- }
|
|
|
+ $sessionKey='token_' . $this->staff [0] ['sidKey'].'_'.$tokenTime;
|
|
|
+ header ( 'Content-Type:text/html;charset=utf-8' );
|
|
|
+ if (!isset($_SESSION [$sessionKey])||empty($_SESSION [$sessionKey])) {
|
|
|
+ die ( '请重新刷新发票申请页面' );
|
|
|
+ }elseif($_SESSION [$sessionKey]=='repeat'){
|
|
|
+ die ( '请勿重复申请发票' );
|
|
|
+ }else{
|
|
|
+ if ($_SESSION [$sessionKey] != $token){
|
|
|
+ die ( '请勿重复填写客户资料' );
|
|
|
+ } else {
|
|
|
+ $_SESSION [$sessionKey] = 'repeat';
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// $companyname = trim ( $companyname );
|
|
|
@@ -2768,7 +2776,9 @@ class MainController extends DooController {
|
|
|
}
|
|
|
|
|
|
$token = $this->set_token ();
|
|
|
- $_SESSION ['token_' . $this->staff [0] ['sidKey']] = $token;
|
|
|
+ $tokenTime=time().rand(5, 15);
|
|
|
+ $_SESSION ['token_' . $this->staff [0] ['sidKey'].'_'.$tokenTime] = $token;
|
|
|
+ $data['tokenTime']=$tokenTime;
|
|
|
$data ['token'] = $token;
|
|
|
|
|
|
$data ['remindCount'] = $rc;
|
|
|
@@ -3289,6 +3299,7 @@ class MainController extends DooController {
|
|
|
$data['lidKey']=$lidKey;
|
|
|
if (isset($longleDetail[0])){
|
|
|
$data['longleDetail']=$longleDetail[0];
|
|
|
+
|
|
|
}else{
|
|
|
$data['longleDetail']=array();
|
|
|
}
|
|
|
@@ -3341,22 +3352,94 @@ class MainController extends DooController {
|
|
|
Doo::loadModel ( 'longle' );
|
|
|
$longle = new longle ();
|
|
|
|
|
|
+ Doo::loadModel ( 'L_category' );
|
|
|
+ $L_category = new L_category ();
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+
|
|
|
+ $cidKey = $this->get_args ( 'cidKey' ) ? $this->get_args ( 'cidKey' ) : '';
|
|
|
+
|
|
|
+
|
|
|
$staffCondition = "";
|
|
|
- if ($this->staff [0] ['cid'] != 12)
|
|
|
+ if ($this->staff [0] ['cid'] != 12){
|
|
|
$staffCondition = " and cid=" . $this->staff [0] ['cid'];
|
|
|
+ $cid=$this->staff [0] ['cid'];
|
|
|
+ }else{
|
|
|
+ $cid=$this->staff [0] ['cid'];
|
|
|
+ if (!empty($cidKey)){
|
|
|
+ $cid = $XDeode->decode ( $cidKey );
|
|
|
+ if (! is_numeric ( $cid )){
|
|
|
+ $cid=$this->staff [0] ['cid'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $staffCondition = " and cid=" . $cid;
|
|
|
+ }
|
|
|
|
|
|
$staffList = $staff->find ( array (
|
|
|
- 'where' => "isadmin= 0 " . $staffCondition,
|
|
|
+ 'where' => "isadmin= 0 and nature !=4 " . $staffCondition,
|
|
|
'asArray' => TRUE
|
|
|
) );
|
|
|
- Doo::db ()->beginTransaction ();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //
|
|
|
+ $sql = "select COUNT(*) as count,responsible
|
|
|
+ from CLD_longle
|
|
|
+ where status!= 1 and make_day >='2019-12-01'
|
|
|
+ GROUP BY responsible";
|
|
|
+ $query = Doo::db ()->query ( $sql );
|
|
|
+ $resultSum = $query->fetchAll ();
|
|
|
+
|
|
|
+ $sql = "select COUNT(*) as count,responsible
|
|
|
+ from CLD_longle
|
|
|
+ where status!= 2 and status!= 1 and make_day >='2019-12-01'
|
|
|
+ GROUP BY responsible";
|
|
|
+ $query = Doo::db ()->query ( $sql );
|
|
|
+ $resultA = $query->fetchAll ();
|
|
|
+
|
|
|
+ foreach ( $staffList as $key => $value ) {
|
|
|
+ $sum=$a=0;
|
|
|
+ foreach ($resultSum as $k=>$v){
|
|
|
+ if($value ['username']==$v['responsible']){
|
|
|
+ $sum=$v['count'];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($resultA as $k=>$v){
|
|
|
+ if($value ['username']==$v['responsible']){
|
|
|
+ $a=$v['count'];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $b = $sum - $a;
|
|
|
+ $staffList [$key] ['sum'] = $sum;
|
|
|
+ $staffList [$key] ['a'] = $a;
|
|
|
+ $staffList [$key] ['b'] = $b;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /* Doo::db ()->beginTransaction ();
|
|
|
foreach ( $staffList as $key => $value ) { // not in(1,2)
|
|
|
$sum = $longle->count ( array (
|
|
|
- 'where' => "status!= 1 and responsible ='" . $value ['username'] . "'",
|
|
|
+ 'where' => "status!= 1 and responsible ='" . $value ['username'] . "' and make_day >='2019-12-01'",
|
|
|
'asArray' => TRUE
|
|
|
) );
|
|
|
$a = $longle->count ( array (
|
|
|
- 'where' => "status!= 2 and status!= 1 and responsible ='" . $value ['username'] . "'",
|
|
|
+ 'where' => "status!= 2 and status!= 1 and responsible ='" . $value ['username'] . "' and make_day >='2019-12-01'",
|
|
|
'asArray' => TRUE
|
|
|
) );
|
|
|
|
|
|
@@ -3365,9 +3448,13 @@ class MainController extends DooController {
|
|
|
$staffList [$key] ['a'] = $a;
|
|
|
$staffList [$key] ['b'] = $b;
|
|
|
}
|
|
|
- Doo::db ()->commit ();
|
|
|
+ Doo::db ()->commit (); */
|
|
|
+
|
|
|
+ $data ['cid'] = $cid;
|
|
|
|
|
|
+ $data ['category'] = $L_category->getCategory ();
|
|
|
$data ['staff'] = $this->staff;
|
|
|
+
|
|
|
$data ['staffList'] = $staffList;
|
|
|
$data ['memu'] = "keyStatistics";
|
|
|
$this->render ( "lock_count", $data );
|
|
|
@@ -3791,7 +3878,6 @@ class MainController extends DooController {
|
|
|
}
|
|
|
|
|
|
$ky = $longle->getLongleBykeynum ( $name );
|
|
|
-
|
|
|
$t = $longle_log->getLongleByLid ( $ky [0] ['lid'] );
|
|
|
|
|
|
if (isset ( $t [0] ))
|
|
|
@@ -3800,11 +3886,8 @@ class MainController extends DooController {
|
|
|
$tk = array ();
|
|
|
|
|
|
$longleLog = $tk;
|
|
|
-
|
|
|
$longleLog ['klid'] = $t [0] ['lid'];
|
|
|
-
|
|
|
$longleLog ['longle'] = $ky [0];
|
|
|
-
|
|
|
$longleLog ['longleLogHtml'] = $this->_getLongleLogHtml ( $t );
|
|
|
|
|
|
echo json_encode ( $longleLog );
|
|
|
@@ -5655,21 +5738,18 @@ class MainController extends DooController {
|
|
|
|
|
|
// 生成
|
|
|
}elseif ($value ['status'] == 1) {
|
|
|
-
|
|
|
$html .= '<ul class="flowList">
|
|
|
<li class="item iconGenerate">生成<' . $value ['category'] . '<a href="javascript:void(0);" onclick="getStaffInfo(\'' . $value ['operator'] . '\')" >' . $value ['operator'] . '</a></li>
|
|
|
|
|
|
</ul>';
|
|
|
// 接收
|
|
|
} elseif ($value ['status'] == 2) {
|
|
|
-
|
|
|
$html .= '<ul class="flowList">
|
|
|
<li class="item iconReceive">接收<' . $value ['category'] . '<a href="javascript:void(0);" onclick="getStaffInfo(\'' . $value ['operator'] . '\')" >' . $value ['operator'] . '</a></li>
|
|
|
|
|
|
</ul>';
|
|
|
// 借出
|
|
|
} elseif ($value ['status'] == 3) {
|
|
|
-
|
|
|
$html .= '<ul class="flowList">
|
|
|
<li class="item iconBorrow">借出<' . $value ['category'] . '<a href="javascript:void(0);" onclick="getStaffInfo(\'' . $value ['operator'] . '\')" >' . $value ['operator'] . '</a></li>
|
|
|
|
|
|
@@ -5678,7 +5758,6 @@ class MainController extends DooController {
|
|
|
</ul>';
|
|
|
// 销售
|
|
|
} elseif ($value ['status'] == 4) {
|
|
|
-
|
|
|
$html .= '<ul class="flowList">
|
|
|
<li class="item iconSell">销售<' . $value ['category'] . '<a href="javascript:void(0);" onclick="getStaffInfo(\'' . $value ['operator'] . '\')" >' . $value ['operator'] . '</a></li>
|
|
|
|
|
|
@@ -5687,7 +5766,6 @@ class MainController extends DooController {
|
|
|
</ul>';
|
|
|
// 升级
|
|
|
} elseif ($value ['status'] == 5) {
|
|
|
-
|
|
|
$html .= '<ul class="flowList">
|
|
|
<li class="item iconUpdate">升级<' . $value ['category'] . '<a href="javascript:void(0);" onclick="getStaffInfo(\'' . $value ['operator'] . '\')" >' . $value ['operator'] . '</a></li>
|
|
|
|