protected function _delete($post, $acode) { $model = Department::find()->where(["Number" => $post["Number"]])->one(); if ($model && $model->delete()) { Yii::$app->cache->set($acode, 1); return "法院:" . $model->Name . "删除成功"; } else { return "法院:" . $model->Name . "删除失败"; } }
protected function sysValidate($number) { $depart = Department::find()->where(["Number" => $number])->one(); $start = $depart->StartDate; $end = $depart->EndDate; $d1 = strtotime($start); $d2 = strtotime($end); $Days = round(($d2 - $d1) / 3600 / 24); $code = md5(md5($end . $Days . "shangxiangwangluokeji")); if ($code == $depart->RegistrationCode) { if ($end <= date("Y-m-d")) { echo "<script>alert('法院注册到期!')</script>"; return false; } return true; } else { echo "<script>alert('法院注册失败!')</script>"; return false; } }
public function actionDepartment() { $model_info = Department::find()->asArray()->all(); $this->layout = "admin"; return $this->render("department", ["model_info" => $model_info]); }
public static function flowNumber($number) { return Department::find()->where(["Number" => $number])->one()->FlowNumber; }