php 函数速度问题,在线给分!
在一地方调用下面的函数:
function auto_update_leave_module()
{
if($this->isHR())
{
$userId=$this->getAllStaffUserId();
foreach($userId as $id)
{
$user_id = $id["user_id"];
// $this->update_paid_personal_leave($user_id);
$this->subtract_annual_when_forgot($user_id);
// $this->update_annual($user_id );
$this->update_off($user_id );
$this->update_off_12($user_id );
$this->update_medical($user_id );
$this->auto_update_leave_to_completed($user_id );
}
$this->auto_cancel_annual_leave();
$this->auto_cancel_adv_annual_leave();
$this->auto_cancel_medical_leave();
$this->auto_cancel_off();
$this->auto_cancel_personal_leave();
$this->auto_cancel_adv_personal_leave();
}
}
这一函数中又要调用很多函数,(必要调用的)
这样运行起来要的时间蛮多,
现想办法把时间变少
(如可用定时器,或把其中函数分开调用,别人提的)
大家有什么办法吗,
帮我修改下,要可运行的代码,
谢谢