|
@@ -111,38 +111,32 @@ class indexControl extends specialControl
|
|
|
public function room_inviteOp()
|
|
|
{
|
|
|
$room_id = intval($_GET['room_id']);
|
|
|
- $inviter = intval($_GET["inviter"]);
|
|
|
+ $relay_id = intval($_GET["relay_id"]);
|
|
|
|
|
|
-// if(session_helper::need_wechat_author())
|
|
|
-// {
|
|
|
-// $_SESSION['client_type'] = 'wap';
|
|
|
-//// define('SERVER_TYPE','panda');
|
|
|
-// $author = new thrid_author\wxauthor();
|
|
|
-// $url = author_url::room_invite_url($room_id,$inviter);
|
|
|
-// $url = $author->enter($url);
|
|
|
-// Log::record("url:$url",Log::DEBUG);
|
|
|
-// return self::outsuccess(['direct_uri' => $url],"redirect");
|
|
|
-// }
|
|
|
-
|
|
|
-// $invitee = [session_helper::memberid()];
|
|
|
- $invitee = [39682];
|
|
|
-
|
|
|
- $result = room\factory_client::instance()->invite($room_id,$inviter,$invitee);
|
|
|
+ if(session_helper::need_wechat_author())
|
|
|
+ {
|
|
|
+ $_SESSION['client_type'] = 'wap';
|
|
|
+ $author = new thrid_author\wxauthor();
|
|
|
+ $url = author_url::room_invite_url($room_id,$relay_id);
|
|
|
+ $url = $author->enter($url);
|
|
|
+ Log::record("url:$url",Log::DEBUG);
|
|
|
+ return self::outsuccess(['direct_uri' => $url],"redirect");
|
|
|
+ }
|
|
|
|
|
|
- if(util::from_wechat() == false){
|
|
|
+ $result = room\factory_client::instance()->invite($room_id,$relay_id,[session_helper::memberid()]);
|
|
|
+ if(session_helper::isapp())
|
|
|
+ {
|
|
|
$_SESSION['client_type'] = 'ajax';
|
|
|
if($result === false) {
|
|
|
return self::outerr(errcode::ErrRoom,"进入失败");
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
$members = member_info::get_members($result['newusers']);
|
|
|
$result['invitees'] = $members;
|
|
|
$result["url"] = BASE_SITE_URL.'/mobile/index.php?act=member_talk&op=room_detail&talk_type=room&talk_id='.$result['room'];
|
|
|
return self::outsuccess($result);
|
|
|
}
|
|
|
- }else{
|
|
|
- //todo 修改成同时兼容APP请求返回打开回话和微信返回打开小程序
|
|
|
+ }
|
|
|
+ else {
|
|
|
$_SESSION['client_type'] = 'wap';
|
|
|
return self::outsuccess(null,"talk/share_bonus");
|
|
|
}
|