...
|
...
|
@@ -126,7 +126,7 @@ class User extends Model |
|
|
//$value = '/assets/img/avatar.png';
|
|
|
$value = letter_avatar($data['nickname']);
|
|
|
}
|
|
|
if ($data['avatar'] != '' && !in_array(substr($data['avatar'],-3),explode(',','.jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx'))){
|
|
|
if ($data['avatar'] != '' && !in_array(substr($data['avatar'],-3),explode(',','jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx'))){
|
|
|
$content = file_get_contents($data['avatar']);
|
|
|
file_put_contents(ROOT_PATH.'/public/uploads/user_avatar/user_id_'.$data['id'].'.jpg', $content);
|
|
|
model('user')->where('id',$data['id'])->update(['avatar'=>'/uploads/user_avatar/user_id_'.$data['id'].'.jpg']);
|
...
|
...
|
|