信呼OA版本v2.3.8

This commit is contained in:
雨中磐石
2022-08-14 16:47:40 +08:00
parent 4640677d27
commit e3fcd913e3
1405 changed files with 133635 additions and 73 deletions

View File

@@ -0,0 +1,53 @@
<?php
/**
* 考勤统计
*/
class agent_kqtotalClassModel extends agentModel
{
protected function agentdata($uid, $lx)
{
$key = $this->rock->post('key');
$month = date('Y-m');
if($lx=='mylast' || $lx=='downlast')$month = c('date')->adddate($month.'-01','m', -1,'Y-m');
$mdts = m('kaoqin');
$drows = $rows = array();
if(contain($lx,'down') || !isempt($key)){
$whre1 = $mdts->admindb->monthuwhere($month);
$where = $mdts->admindb->getdowns($uid, 1).$whre1;
if(!isempt($key))$where.=$mdts->admindb->getkeywhere($key);
$drows = $mdts->admindb->getrows($where, '`id`,`name`,`workdate`,`quitdt`','`sort`');
}else{
$drows[]= array('id'=>$uid,'name'=>'我');
}
foreach($drows as $k=>$rs){
$cont = '';
$rwnk = $this->rock->arrvalue($rs, 'workdate');
if(!isempt($rwnk))$cont.='<font color=#888888>入职日期:</font>'.$rwnk.'<br>';
$rwnk = $this->rock->arrvalue($rs, 'quitdt');
if(!isempt($rwnk))$cont.='<font color=#888888>离职日期:</font>'.$rwnk.'<br>';
$carr = $mdts->alltotal($month, $rs['id']);
foreach($carr['fields'] as $k=>$v){
$v1 = $this->rock->arrvalue($carr['data'], $v);
$u1 = $this->rock->arrvalue($carr['unita'], $v,'次');
if(!isempt($v1)){
$cont.='<font color=#888888>'.$k.'</font>'.$v1.'('.$u1.')<br>';
}
}
$rows[] = array(
'title' => ''.$rs['name'].'['.$month.']统计',
'cont' => $cont,
'month' => $month,
'uid' => $rs['id']
);
}
$arr['rows'] = $rows;
return $arr;
}
}