public function checkUnRest1Action() { $sql = "select * from yoga_card where status=3 "; $Model = new \Think\Model(); $ret = $Model->query($sql); foreach ($ret as $key => $value) { $id = $value['id']; $extension = $value['extension']; $ex = json_decode($extension); $end_time = $ex->end_time; if ($end_time < date("Y-m-d")) { $ret = CardService::getInstance()->unrest($id); echo "unrest {$id} [" . $value['extension'] . "]\n"; } } }
public function unrestAction($id) { $ret = CardService::getInstance()->unrest($id); if (!$ret) { $this->error(CardService::getInstance()->getError()); } $this->ajaxReturn(array("status" => 1, "info" => "销假成功!", "end_time" => $ret)); }