|
@@ -390,10 +390,12 @@ class Talent extends EnterpriseController {
|
|
|
}
|
|
|
$age = 0;
|
|
|
if ($params["birthday"]) {
|
|
|
- $birthday = $params["birthday"];
|
|
|
- $birthdayYear = substr($birthday, 0, 4);
|
|
|
+ $birthtime = strtotime($params["birthday"]);
|
|
|
$currentYear = date("Y");
|
|
|
- $age = $currentYear - $birthdayYear;
|
|
|
+ $currentMonth = date("n");
|
|
|
+ $birthdayYear = date("Y", $birthtime);
|
|
|
+ $birthdayMonth = date("n", $birthtime);
|
|
|
+ $age = ($currentYear * 12 + $currentMonth - $birthdayYear * 12 - $birthdayMonth) / 12;
|
|
|
}
|
|
|
$ft_ids = [];
|
|
|
$deletes = [];
|
|
@@ -634,7 +636,7 @@ class Talent extends EnterpriseController {
|
|
|
$headimg = $request->file("photo");
|
|
|
$upload = new \app\common\api\UploadApi();
|
|
|
$result = $upload->uploadOne($headimg, "image", "talent/photo");
|
|
|
- if($result->code != 200){
|
|
|
+ if ($result->code != 200) {
|
|
|
throw new ValidateException($result->msg);
|
|
|
}
|
|
|
$file = imagecreatefromstring(file_get_contents("storage/" . $result->filepath));
|