lizhen_gitee пре 1 година
родитељ
комит
4192921558
2 измењених фајлова са 23 додато и 23 уклоњено
  1. 8 6
      application/api/controller/Report.php
  2. 15 17
      application/api/controller/User.php

+ 8 - 6
application/api/controller/Report.php

@@ -13,32 +13,34 @@ class Report extends Api
     protected $noNeedRight = ['*'];
 
     //类型列表
-    public function typelist(){
+    /*public function typelist(){
         $list = Db::name('report_type')->order('id asc')->select();
         $this->success('success',$list);
-    }
+    }*/
 
     //新增举报
     public function addone(){
-        $type_id = input('type_id',1);
+        $type = input('type','');
         $content = input('content','');
         $images  = input('images','');
+        $mobile  = input('mobile','');
 
         if(empty($content)){
             $this->error('内容不能为空');
         }
 
         if(!empty($images) && strpos($images,',')){
-            if(count(explode(',',$images)) > 3){
-                $this->error('一次最多只能上传3张图片');
+            if(count(explode(',',$images)) > 8){
+                $this->error('一次最多只能上传9张图片');
             }
         }
 
         $data = [
             'user_id' => $this->auth->id,
-            'type_id' => $type_id,
+            'type' => $type,
             'content' => $content,
             'images' => $images,
+            'mobile' => $mobile,
             'createtime' => time(),
             'updatetime' => time(),
         ];

+ 15 - 17
application/api/controller/User.php

@@ -122,9 +122,9 @@ class User extends Api
 
         } else {
             $extend = [
-                'register_from' => input('register_from',''),
+//                'register_from' => input('register_from',''),
             ];
-            $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, $extend);
+            $ret = $this->auth->register('', '', '', $mobile, $extend);
 
         }
         if ($ret) {
@@ -554,12 +554,12 @@ class User extends Api
      */
     public function profile()
     {
-        $field_array = ['nickname','introcode','gender','birthday','height','weight','bio','audio_bio','avatar','photo_images','education_id','hobby_ids','job_id','marital_id','tag_ids','wages_id','hometown_cityid','hide_is_finishinfo','wechat_account'];
+        $field_array = ['nickname','introcode','gender','birthday','attribute','shoesize','height','weight','bio','audio_bio','avatar','photo_images','tag_ids','hide_is_finishinfo','wechat_account'];
 
         $data = [];
         foreach($field_array as $key => $field){
 
-            if(!input('?'.$field)){
+            if(!request()->has($field,'post')){
                 continue;
             }
 
@@ -581,9 +581,7 @@ class User extends Api
         if(isset($data['avatar'])){
             //$data['real_status'] = -1;  //或许应该改成0。性别不能改所以不需要
         }
-        if(isset($data['hobby_ids'])){
-            $data['hobby_ids'] = implode(',',explode(',',$data['hobby_ids']));
-        }
+
         if(isset($data['tag_ids'])){
             $data['tag_ids'] = implode(',',explode(',',$data['tag_ids']));
         }
@@ -620,39 +618,39 @@ class User extends Api
 
         //tag任务赠送金币
         //上传头像加5金币
-        if(isset($data['avatar'])){
+        /*if(isset($data['avatar'])){
             $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,1);
             if($task_rs === false){
                 Db::rollback();
                 $this->error('完成任务赠送奖励失败');
             }
-        }
+        }*/
         //上传本人语音介绍 10金币
-        if(isset($data['audio_bio'])){
+        /*if(isset($data['audio_bio'])){
             $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,6);
             if($task_rs === false){
                 Db::rollback();
                 $this->error('完成任务赠送奖励失败');
             }
-        }
+        }*/
         //上传本人五张照片 10金币
-        if(isset($data['photo_images']) && count(explode(',',$data['photo_images'])) >= 5){
+        /*if(isset($data['photo_images']) && count(explode(',',$data['photo_images'])) >= 5){
             $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,8);
             if($task_rs === false){
                 Db::rollback();
                 $this->error('完成任务赠送奖励失败');
             }
-        }
+        }*/
 
         //所有资料完成
-        $user_info = Db::name('user')->where('id',$this->auth->id)->find();
+        /*$user_info = Db::name('user')->where('id',$this->auth->id)->find();
         if($user_info['avatar'] && $user_info['nickname'] && $user_info['mobile'] && $user_info['audio_bio'] && $user_info['photo_images']){
             $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,5);
             if($task_rs === false){
                 Db::rollback();
                 $this->error('完成任务赠送奖励失败');
             }
-        }
+        }*/
 
         Db::commit();
         $this->success();
@@ -976,8 +974,8 @@ class User extends Api
             $this->error(__('Invalid parameters'));
         }
         //退出im
-        $tenIm = new Tenim();
-        $tenIm->loginoutim($this->auth->id);
+//        $tenIm = new Tenim();
+//        $tenIm->loginoutim($this->auth->id);
 
         Db::name('user')->where('id',$this->auth->id)->update(['status'=>-1]);