Explorar o código

各个任务完成,完善用户资料

lizhen_gitee hai 1 ano
pai
achega
ce1782b866

+ 0 - 7
application/admin/controller/Appcomment.php

@@ -94,13 +94,6 @@ class Appcomment extends Backend
 
             if($status == 1){
 
-                //task任务
-                //好评有礼
-                $task_rs = \app\common\model\TaskLog::tofinish($info['user_id'],17);
-                if($task_rs === false){
-                    Db::rollback();
-                    $this->error('完成任务失败');
-                }
 
                 //系统消息
                 $msg_id = \app\common\model\Message::addMessage($info['user_id'],'好评有礼','好评有礼审核通过');

+ 1 - 1
application/admin/model/Topicdongtai.php

@@ -52,7 +52,7 @@ class Topicdongtai extends Model
                     //通过
                     //$msg_id = \app\common\model\Message::addMessage($row['user_id'],'动态审核','动态审核通过');
                     $task_rs = \app\common\model\TaskLog::tofinish($row['user_id'],10);
-                    
+
                 }
             }
         });

+ 2 - 1
application/api/controller/Greet.php

@@ -33,7 +33,7 @@ class Greet extends Api
     public function get_greet(){
         $type = input('type',1);
 
-        $list = Db::name('user_greet')->where('user_id',$this->auth->id)->where('type',$type)->select();
+        $list = Db::name('user_greet')->where('user_id',$this->auth->id)->where('type',$type)->where('status',1)->select();
         $list = list_domain_image($list,['image']);
 
         $this->success(1,$list);
@@ -56,6 +56,7 @@ class Greet extends Api
             'type' => $type,
             'title' => $title,
             'image' => $image,
+            'status' => 0,
         ];
 
         Db::name('user_greet')->insertGetId($data);

+ 36 - 6
application/api/controller/User.php

@@ -340,7 +340,7 @@ class User extends Api
             $data[$field] = $newone;
         }
 
-        //关于我,是否需要审核
+        //视频,需要审核
         $user_audit_switch = config('site.user_audit_switch');
         if(isset($data['video_bio']) && !empty($data['video_bio']) && $user_audit_switch == 1){
 
@@ -363,7 +363,7 @@ class User extends Api
             }
             unset($data['video_bio']);
         }
-        //关于我,是否需要审核
+        //相册,需要审核
         if(isset($data['photo_images']) && !empty($data['photo_images']) && $user_audit_switch == 1){
 
             $check_exist = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','photo_images')->where('status',0)->find();
@@ -385,7 +385,7 @@ class User extends Api
             }
             unset($data['photo_images']);
         }
-        //关于我,是否需要审核
+        //语音,需要审核
         if(isset($data['audio_bio']) && !empty($data['audio_bio']) && $user_audit_switch == 1){
 
             $check_exist = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','audio_bio')->where('status',0)->find();
@@ -407,6 +407,36 @@ class User extends Api
             }
             unset($data['audio_bio']);
         }
+        //头像,是否需要审核
+        if(isset($data['avatar']) && !empty($data['avatar']) && $data['avatar'] != config('avatar_boy') && $data['avatar'] != config('avatar_girl') && $user_audit_switch == 1){
+
+            $check_exist = Db::name('user_audit')->where('user_id',$this->auth->id)->where('type','audio_bio')->where('status',0)->find();
+            if(!empty($check_exist)){
+                $this->error('信息已提交等待审核,请勿重复提交');
+            }
+
+            if($data['avatar'] != $this->auth->avatar){
+                $bio_data = [
+                    'user_id' => $this->auth->id,
+                    'type'     => 'avatar',
+                    'old_data'     => $this->auth->avatar,
+                    'new_data' => $data['avatar'],
+                    'createtime' => time(),
+                ];
+                Db::name('user_audit')->insertGetId($bio_data);
+
+                if(!isset($data['gender'])){
+                    $this->error('信息已提交,审核通过后即可正常展示');//正确不弹出,只能用error
+                }
+            }
+            unset($data['avatar']);
+
+        }
+
+        //第一次传入性别,头像只能用默认
+        if(isset($data['gender']) && $user_audit_switch == 1){
+            $data['avatar'] = $data['gender'] == 1 ? config('avatar_boy') : config('avatar_girl');
+        }
 
         //
         if(isset($data['birthday'])){
@@ -457,9 +487,9 @@ class User extends Api
         }
 
         //task任务
-        //上传本人头像
-        if(isset($data['avatar']) && $data['avatar'] != config('avatar_boy') && $data['avatar'] != config('avatar_girl')){
-            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,1);
+        if(isset($data['tag_ids']) && isset($data['bio']) && !empty($this->auth->audio_bio)){
+            //task任务
+            $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,4);
             if($task_rs === false){
                 Db::rollback();
                 $this->error('完成任务失败');

+ 0 - 111
application/common/model/User.php

@@ -231,118 +231,7 @@ class User extends Model
         return $value;
     }
 
-    /**
-     * 获取用户贵族信息
-     */
-    public static function getUserNoble($user_id) {
-        $result = [];
-        $result["noble_on"] = 0;
-        $nobleInfo = self::alias("a")
-            ->field("a.noble,n.level_no,a.noble_duetime,n.explain")
-            ->join("hx_noble_level n","a.noble = n.id")
-            ->where(["a.id"=>$user_id])->find();
-
-        if($nobleInfo && $nobleInfo["noble_duetime"] > time()) {
-            $result["noble_on"] = 1;
-            $result["noble"] = $nobleInfo["noble"];
-            $result["explain"] = $nobleInfo["explain"];
-            $result["level_no"] = $nobleInfo["level_no"] ? $nobleInfo["level_no"] : "";
-            $result["noble_duetime"] = date("Y-m-d H:i:s", $nobleInfo["noble_duetime"]);
-        }
-
-        return $result;
-    }
-
-    /**
-     * 获取用户贵族开通信息
-     */
-    public function getUserNobleInfo($user_id) {
-        $result = [];
-        $result["noble_on"] = 0;
-        $result["noble"] = 0;
-        $result["noble_txt"] = "";
-        $result["noble_duetime"] = 0;
-        $nobleInfo = $this->alias("a")
-            ->field("a.noble,n.level_no,a.noble_duetime,n.name,n.back_image,n.icon_image,n.jctx,n.tqgq,n.lxrys,n.zlys,n.diylw,n.fjft,n.zdych")
-            ->join("hx_noble_level n","a.noble = n.id")
-            ->where(["a.id"=>$user_id])->find();
-        if($nobleInfo) {
-            if($nobleInfo["noble_duetime"] > time()) {
-                $result["noble_on"] = 1;
-                $result["noble"] = $nobleInfo["noble"];
-                $result["level_no"] = $nobleInfo["level_no"]?$nobleInfo["level_no"]:"";
-                $result["noble_txt"] = $nobleInfo["name"]?$nobleInfo["name"]:"";
-//                $result["noble_back_image"] = $nobleInfo["back_image"];
-                $result["noble_icon_image"] = $nobleInfo["icon_image"]?$nobleInfo["icon_image"]:"";
-                $result["noble_jctx"] = $nobleInfo["jctx"]?$nobleInfo["jctx"]:"";
-//                $result["noble_tqgq"] = $nobleInfo["tqgq"];
-                $result["noble_lxrys"] = $nobleInfo["lxrys"]?$nobleInfo["lxrys"]:"";
-                $result["noble_zlys"] = $nobleInfo["zlys"]?$nobleInfo["zlys"]:"";
-                $result["noble_diylw"] = $nobleInfo["diylw"]?$nobleInfo["diylw"]:"";
-                $result["noble_fjft"] = $nobleInfo["fjft"]?$nobleInfo["fjft"]:"";
-                $result["noble_zdych"] = $nobleInfo["zdych"]?$nobleInfo["zdych"]:"";
-                $result["noble_duetime"] = date("Y-m-d H:i:s",$nobleInfo["noble_duetime"]);
-            } else {
-                $result["noble"] = $nobleInfo["noble"];
-                $result["noble_txt"] = $nobleInfo["name"]?$nobleInfo["name"]:"";
-                $nobleInfo["noble"] > 0 && $result["noble_duetime"] = -1; // 已到期
-            }
-        }
-        return $result;
-    }
 
-    /**
-     * 增加经验值
-     */
-    public static function addEmpirical($user_id,$empirical) {
-        if($empirical <= 0) return false;
-        // 获取用户经验值
-        $userInfo = \app\common\model\User::field("id,level,empirical")->where(["id"=>$user_id])->find();
-        if(!$userInfo) return false;
-        $userempirical = $userInfo["empirical"];
-
-        // 增加之后的经验值
-        $empirical = $userempirical + $empirical;
-        // 查询等级配置信息
-        $levelconfigModel = new \app\common\model\UserLevelConfig();
-        $where = [];
-        $where["empirical"] = ["elt",$empirical];
-        $userexplainstart = $levelconfigModel->where($where)->order("empirical","desc")->limit(1)->select();
-
-        if(!$userexplainstart)  {
-            $userexplainlevel = 0;
-        } else {
-            $userexplainlevel = $userexplainstart[0]["level"];
-        }
-
-        // 更新用户等级信息和经验值
-        $data = [];
-        $data["level"] = $userexplainlevel;
-        $data["empirical"] = $empirical;
-        $where = [];
-        $where["id"] = $user_id;
-        $res = \app\common\model\User::update($data,$where);
-
-        // 获取任务信息
-        $taskList = \app\common\model\Task::where(["is_show"=>1])->select();
-        $taskArr = [];
-        if($taskList) foreach($taskList as $k => $v) {
-            $taskArr[$v["task_no"]] = $v["number"];
-        }
-        // 提升等级后 添加经验值任务  +exp
-        $levelup = intval($userexplainlevel)-intval($userInfo["level"]);
-//        echo $userexplainlevel;
-//        print_r($taskArr);exit;
-        isset($taskArr["IbehRkoF"]) && \app\common\model\TaskLog::tofinish($user_id,"IbehRkoF",$levelup);
-        isset($taskArr["CD2Vtv0W"]) && \app\common\model\TaskLog::tofinish($user_id,"CD2Vtv0W",$levelup);
-        isset($taskArr["TL0m4wnf"]) && \app\common\model\TaskLog::tofinish($user_id,"TL0m4wnf",$levelup);
-        isset($taskArr["SHcIn8pz"]) && \app\common\model\TaskLog::tofinish($user_id,"SHcIn8pz",$levelup);
-        isset($taskArr["Y3XZQDGk"]) && \app\common\model\TaskLog::tofinish($user_id,"Y3XZQDGk",$levelup);
-        isset($taskArr["1NBgxLP3"]) && \app\common\model\TaskLog::tofinish($user_id,"1NBgxLP3",$levelup);
-        isset($taskArr["ai5l2QkD"]) && \app\common\model\TaskLog::tofinish($user_id,"ai5l2QkD",$levelup);
-
-        return $res;
-    }
 
 
 }

+ 2 - 2
application/extra/site.php

@@ -65,14 +65,14 @@ return array (
   'iso_desc' => '这次更新了很多内容',
   'iso_versioncode' => '1',
   'ios_pay_sandbox' => '0',
-  'dongtai_audit_switch' => '0',
+  'dongtai_audit_switch' => '1',
   'teenage_rule' => '模式限制:
 无法使用安心聊的所有功能
 
 使用方法:
 1、青少年模式开启后会立即生效,需要输入密码关闭青少年模式才能继续使用。
 2、青少年模式开启后,每次登录或重启应用均需要输入密码,关闭后才能正常使用APP。',
-  'user_audit_switch' => '0',
+  'user_audit_switch' => '1',
   'user_auth_switch' => '0',
   'fangzhapian' => '以下行为一经发现,平台将严肃处理 
 1、以交友/网恋等为由诱导发生任何形式的金钱来往