Explorar o código

move room_detail

huangdong %!s(int64=6) %!d(string=hai) anos
pai
achega
2c0dcff2c7
Modificáronse 2 ficheiros con 5 adicións e 94 borrados
  1. 5 48
      mobile/control/index.php
  2. 0 46
      mobile/control/member_talk.php

+ 5 - 48
mobile/control/index.php

@@ -103,56 +103,10 @@ class indexControl extends specialControl
         }
     }
 
-
     /**
      * 会话详情页 talk_type:room/chatwo   talk_id:room_id/user
-     * app打开
-     */
-    public function room_detailOp()
-    {
-        $talk_type = trim($_GET['talk_type']);
-        $talk_id = intval($_GET['talk_id']);
-        $relay_id = intval($_GET['relay_id']);
-        if($talk_id <= 0) {
-            return self::outerr(errcode::ErrParamter);
-        }
-
-        $user = session_helper::memberid();
-        $param = ["talk_type" => $talk_type, "talk_id"   => $talk_id , "member_id" => $user,"room_name"=>"","relay_id"=>$relay_id];
-
-        if($talk_type == "room")
-        {
-            $room_id = $talk_id;
-            try {
-                $tpl = new room\tpl_group_home($user,$talk_id,$relay_id);
-                $room_name = $tpl->get_room_info()->name();
-                $param["room_name"] = $room_name;
-                return self::outsuccess(['tpl' => $tpl,"param" => $param],'talk/homepage_room');
-            } catch (Exception $ex) {
-                Log::record("member_talk.room_detail error: room_id={$room_id} user={$user}",Log::ERR);
-                return self::outerr(errcode::ErrParamter);
-            }
-        }
-        elseif($talk_type == 'chatwo')
-        {
-            $other = $talk_id;
-            try {
-                $tpl = new room\tpl_chatwo_home($user,$other);
-                return self::outsuccess(['tpl' => $tpl,"param"=>$param],'talk/homepage_chatwo');
-            } catch (Exception $ex) {
-                Log::record("member_talk.room_detail error: other={$other} user={$user}",Log::ERR);
-                return self::outerr(errcode::ErrParamter);
-            }
-        }
-        else
-        {
-            return self::outerr(errcode::ErrParamter);
-        }
-    }
-
-    /**
-     * 群详情@扫码进入
-     * @微信扫码场景
+     * 回话详情@ app打开
+     * 群详情@ 微信扫码进入
      */
     public function room_indexOp()
     {
@@ -164,6 +118,7 @@ class indexControl extends specialControl
             return self::outerr(errcode::ErrParamter);
         }
 
+        //微信使用授权判断
         if(session_helper::need_wechat_author()) {
             $author = new thrid_author\wxauthor();
             $url = url_helper::room_detail_url($talk_type,$talk_id,$relay_id);
@@ -172,6 +127,8 @@ class indexControl extends specialControl
         }
 
         $user = session_helper::memberid();
+        if($user <= 0) return self::outerr(errcode::ErrUnLogin,"用户未登录");
+
         $param = ["talk_type" => $talk_type, "talk_id"   => $talk_id , "member_id" => $user,"room_name"=>"","relay_id"=>$relay_id];
 
         if($talk_type == "room")

+ 0 - 46
mobile/control/member_talk.php

@@ -486,52 +486,6 @@ class member_talkControl extends mbMemberControl
     }
 
     ///////////群详情设置/////////////////////////////////////////////////////////////////////////////////////////////////
-
-    /**
-     * 会话详情页 talk_type:room/chatwo   talk_id:room_id/user
-     */
-    public function room_detailOp()
-    {
-        $talk_type = trim($_GET['talk_type']);
-        $talk_id = intval($_GET['talk_id']);
-        $relay_id = intval($_GET['relay_id']);
-        if($talk_id <= 0) {
-            return self::outerr(errcode::ErrParamter);
-        }
-
-        $user = session_helper::memberid();
-        $param = ["talk_type" => $talk_type, "talk_id"   => $talk_id , "member_id" => $user,"room_name"=>"","relay_id"=>$relay_id];
-
-        if($talk_type == "room")
-        {
-            $room_id = $talk_id;
-            try {
-                $tpl = new room\tpl_group_home($user,$talk_id,$relay_id);
-                $room_name = $tpl->get_room_info()->name();
-                $param["room_name"] = $room_name;
-                return self::outsuccess(['tpl' => $tpl,"param" => $param],'talk/homepage_room');
-            } catch (Exception $ex) {
-                Log::record("member_talk.room_detail error: room_id={$room_id} user={$user}",Log::ERR);
-                return self::outerr(errcode::ErrParamter);
-            }
-        }
-        elseif($talk_type == 'chatwo')
-        {
-            $other = $talk_id;
-            try {
-                $tpl = new room\tpl_chatwo_home($user,$other);
-                return self::outsuccess(['tpl' => $tpl,"param"=>$param],'talk/homepage_chatwo');
-            } catch (Exception $ex) {
-                Log::record("member_talk.room_detail error: other={$other} user={$user}",Log::ERR);
-                return self::outerr(errcode::ErrParamter);
-            }
-        }
-        else
-        {
-            return self::outerr(errcode::ErrParamter);
-        }
-    }
-
     /**
      * 修改群名称和群描述 room_id room_name room_desc
      */