laboratory_appointment(); // 实验室预约 未上课处理 $this->laboratory_appointment_status();// 解除爽约时间限制 var_dump("index"); }, true); } /** * 获取学生成绩 */ public function student_status() { Timer::add(10, function () { $cweb=new Cweb(); $cweb->student_status(); var_dump("student_status"); }, true); } /** 获取老师数据 */ public function getteacher() { Timer::add(10, function () { $cweb=new Cweb(); $cweb->getteacher(); var_dump("getteacher"); }, true); } // 实验室预约 未上课处理 public function laboratory_appointment() { $where[] = ["end_time", "<", time()]; $where[] = ["status", "=", 0]; $laboratory_appointment = Db::name("laboratory_appointment")->where($where)->limit(10)->select()->toArray(); if ($laboratory_appointment) { $agreement = Db::name("systems")->where(["id" => 1])->value("agreement"); foreach ($laboratory_appointment as $k => $v) { $update["status"] = 2; if ($agreement) { $update["day"] = (int)$agreement; $update["kai_time"] = $laboratory_appointment["stat_time"] + $agreement * 24 * 60 * 60;// 禁止报名时间 } Db::name("laboratory_appointment")->where(["id" => $v["id"]])->update($update); } } } // 解除爽约时间限制 public function laboratory_appointment_status() { $where["status"] = 2; $laboratory_appointment = Db::name("laboratory_appointment") ->where("kai_time", "<>", "") ->where("kai_time", "<", time())->where($where)->limit(10)->select()->toArray(); if ($laboratory_appointment) { foreach ($laboratory_appointment as $k => $v) { Db::name("laboratory_appointment")->where(["id" => $v["id"]])->update(["kai_time" => ""]); } } } // 升级 public function star_class() { } }