webmain/model/flow/leaveModel.php
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
//请假条的
class flow_leaveClassModel extends flowModel
{
public function flowrsreplace($rs)
{
$rs['modenum'] = $this->modenum;
$totday = floatval(arrvalue($rs,'totday','0'));
if($totday>0)$rs['totals'].='('.$totday.'天)';
return $rs;
}
protected function flowbillwhere($uid, $lx)
{
$month = $this->rock->post('month');
$where = '';
if($month!=''){
$where.=" and `stime` like '$month%'";
}
return array(
'where' => $where
);
}
/**
* 年假添加设置(自动添加),可计划任务没有运行一次,兑换为小时的,默认一天8小时
*/
public function autoaddleave($ndate='')
{
$type = 0; //根据哪个类型计算年:0根据入职日期,1根据转正日期
$hour = (int)m('option')->getval('kqsbtime', 8); //默认一天8小时(请自己设定)
if($hour<=0)$hour = 8;
if($ndate=='')$ndate = $this->rock->date;
if($ndate > $this->rock->date)return array();
$Y = substr($ndate,0,4);
$niana = array(
// 开始 截止 年假天数
array(0, 0, 0), //0-0年,0天
array(1, 10, 5), //1年(含)-10年(含),5天
array(11, 20, 10), //11年(含)-20年(含),10天
array(21, 9999, 15), //21年(含)以上,15天
);
//配置可根据自己情况修改
$adlx = array('workdate','positivedt');
$adln = array('入职','转正');
$dtobj= c('date');
$usea = $this->db->getall("select `uid` from `[Q]kqinfo` where `kind`='增加年假' and `status`=1 and `optname`='系统' and `stime` like '".$Y."-%'"); //系统已经自动添加过
$uids = '0';
foreach($usea as $k=>$rs)$uids.=','.$rs['uid'].'';
$rows = $this->db->getall("select a.`id`,a.`name`,a.`workdate`,b.`positivedt` from `[Q]admin` a left join `[Q]userinfo` b on a.id=b.id where a.`status`=1 and a.id not in($uids) and b.`state`<>5");
$barr = array();
foreach($rows as $k=>$rs){
$dt = $rs[$adlx[$type]];
if(isempt($dt))continue;
$dttime = strtotime($dt);
$rs['dt'] = $dt;
$jg = $dtobj->datediff('d', $dt, $ndate);
后面还有 63 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
