作者 Cool
1 个管道 的构建 通过 耗费 0 秒

支付回调修改

... ... @@ -126,7 +126,7 @@ class Pay extends Api
Db::name('teacher')->where('id',$order['teacher_id'])->setInc('help_num');
// 创建融云用户、群组
$teacher_id = Db::name('teacher')->where('id',$order['teacher_id'])->value('user_id');
$rongyun_chat = $this->rongyun_handle($order['user_id'].','.$teacher_id);
$rongyun_chat = $this->rongyun_handle($order['user_id'].','.$teacher_id,$order['id']);
if($rongyun_chat) {
$update['chat_id'] = $rongyun_chat['chat_id'];
$update['chat_name'] = $rongyun_chat['chat_name'];
... ... @@ -194,7 +194,7 @@ class Pay extends Api
// 融云创建用户、群组
public function rongyun_handle($user_ids) {
public function rongyun_handle($user_ids,$order_id) {
$config = config('rongyun.config'); // 应用配置参数
$RongSDK = new RongCloud($config['appkey'],$config['appsecret']);
$users = Db::name('user')->whereIn('id',$user_ids)->column('id,nickname,avatar,rongyun_id,is_create'); // 获取用户信息
... ... @@ -221,8 +221,8 @@ class Pay extends Api
}
}
// 创建群组
$chat_id = '';
$chat_name = '';
$chat_id = 'xiaowei_teacher'.$order_id;
$chat_name = '小微问问房间'.$order_id;
$Group = $RongSDK->getGroup();
$group_params = [
'id'=> $chat_id,//群组 id
... ...