update CRUD list-management

This commit is contained in:
2020-12-04 10:11:56 +07:00
parent efb4113001
commit 6030ccd0a5
11 changed files with 428 additions and 43 deletions

View File

@@ -78,5 +78,9 @@ class ListManagement extends \yii\db\ActiveRecord {
"wl" => "Whitelist",
"bl" => "Blacklist"
];
public static $genderArray = [
"Male" => "Male",
"Female" => "Female"
];
}

View File

@@ -59,7 +59,7 @@ class common extends \yii\db\ActiveRecord {
// $now = time();
// $range = $now - $time;
// if ($range > 60 * 60 * 12) {
return date($format, $time);
return date($format, $time);
// } else {
// return Yii::$app->formatter->asRelativeTime($time);
// }
@@ -171,4 +171,14 @@ class common extends \yii\db\ActiveRecord {
return $visible;
}
public static function requestToEngine($path, $data) {
return file_get_contents("http://192.168.2.158:2305" . $path, false, stream_context_create([
'http' => [
'header' => "Content-Type: application/json",
'method' => "POST",
'content' => json_encode($data)
]
]));
}
}