|
@@ -150,6 +150,12 @@ class User extends Api
|
|
|
$this->success(__('success'),$info);
|
|
|
}
|
|
|
|
|
|
+ //申请真人认证
|
|
|
+ public function apply_real_confirm(){
|
|
|
+ Db::name('user')->where('id',$this->auth->id)->update(['real_status'=>1]);
|
|
|
+ $this->success();
|
|
|
+ }
|
|
|
+
|
|
|
//实名认证信息
|
|
|
public function idcard_confirm_info(){
|
|
|
$check = Db::name('user_idconfirm')->where('user_id',$this->auth->id)->order('id desc')->find();
|
|
@@ -157,7 +163,7 @@ class User extends Api
|
|
|
}
|
|
|
|
|
|
//申请实名认证
|
|
|
- public function idcard_confirm(){
|
|
|
+ public function apply_idcard_confirm(){
|
|
|
$truename = input('truename','');
|
|
|
$idcard = input('idcard','');
|
|
|
$idcard_images = input('idcard_images','');
|
|
@@ -241,24 +247,37 @@ class User extends Api
|
|
|
*/
|
|
|
public function profile()
|
|
|
{
|
|
|
- $user = $this->auth->getUser();
|
|
|
+ $field_array = ['nickname','gender','birthday','height','weight','bio','audio_bio','avatar','photo_images','education_id','hobby_ids','job_id','marital_id','tag_ids','wages_id'];
|
|
|
|
|
|
- $nickname = $this->request->post('nickname');
|
|
|
- $gender = $this->request->post('gender');
|
|
|
- $birthday = $this->request->post('birthday');
|
|
|
- $height = $this->request->post('height');
|
|
|
- $weight = $this->request->post('weight');
|
|
|
+ $data = [];
|
|
|
+ foreach($field_array as $key => $field){
|
|
|
|
|
|
+ $newone = input_post($field);
|
|
|
|
|
|
- $bio = $this->request->post('bio');
|
|
|
- $audio_bio = $this->request->post('audio_bio');
|
|
|
- $avatar = $this->request->post('avatar', '', 'trim,strip_tags,htmlspecialchars');
|
|
|
- $avatar = $this->request->post('photo_images', '', 'trim,strip_tags,htmlspecialchars');
|
|
|
+ if($field == 'avatar'){
|
|
|
+ $newone = input_post('avatar', '', 'trim,strip_tags,htmlspecialchars');
|
|
|
+ }
|
|
|
+ if($field == 'photo_images'){
|
|
|
+ $newone = input_post('avatar', '', 'trim,strip_tags,htmlspecialchars');
|
|
|
+ }
|
|
|
|
|
|
+ if(!empty($newone)){
|
|
|
+ $data[$field] = $newone;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- $user->bio = $bio;
|
|
|
- $user->avatar = $avatar;
|
|
|
- $user->save();
|
|
|
+ if(isset($data['birthday'])){
|
|
|
+ $data['birthday'] = strtotime($data['birthday']);
|
|
|
+ }
|
|
|
+ if(isset($data['avatar'])){
|
|
|
+ $data['real_status'] = -1; //或许应该改成0
|
|
|
+ }
|
|
|
+ //dump($data);
|
|
|
+ if(empty($data)){
|
|
|
+ $this->error('没有任何改变');
|
|
|
+ }
|
|
|
+
|
|
|
+ Db::name('user')->where('id',$this->auth->id)->update($data);
|
|
|
$this->success();
|
|
|
}
|
|
|
|