예제 #1
0
 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 . "删除失败";
     }
 }
예제 #2
0
 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;
     }
 }
예제 #3
0
 public function actionDepartment()
 {
     $model_info = Department::find()->asArray()->all();
     $this->layout = "admin";
     return $this->render("department", ["model_info" => $model_info]);
 }
예제 #4
0
파일: Department.php 프로젝트: perpel/ywfy
 public static function flowNumber($number)
 {
     return Department::find()->where(["Number" => $number])->one()->FlowNumber;
 }