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

支付回调修改

@@ -68,6 +68,13 @@ class Pay extends Api @@ -68,6 +68,13 @@ class Pay extends Api
68 $update['expirationtime'] = $update['paytime'] + 86400*7; 68 $update['expirationtime'] = $update['paytime'] + 86400*7;
69 $update['finish_status'] = 1; 69 $update['finish_status'] = 1;
70 Db::name('teacher')->where('id',$order['teacher_id'])->setInc('help_num'); 70 Db::name('teacher')->where('id',$order['teacher_id'])->setInc('help_num');
  71 + // 创建融云用户、群组
  72 + $teacher_id = Db::name('teacher')->where('id',$order['teacher_id'])->value('user_id');
  73 + $rongyun_chat = $this->rongyun_handle($order['user_id'].','.$teacher_id);
  74 + if($rongyun_chat) {
  75 + $update['chat_id'] = $rongyun_chat['chat_id'];
  76 + $update['chat_name'] = $rongyun_chat['chat_name'];
  77 + }
71 } else { // 用户支付失败 78 } else { // 用户支付失败
72 $update['status']=1; 79 $update['status']=1;
73 } 80 }
@@ -96,7 +103,8 @@ class Pay extends Api @@ -96,7 +103,8 @@ class Pay extends Api
96 Db::name('coupon')->insertGetId($coupon); 103 Db::name('coupon')->insertGetId($coupon);
97 Db::name('teacher')->where('id',$order['teacher_id'])->setInc('help_num'); 104 Db::name('teacher')->where('id',$order['teacher_id'])->setInc('help_num');
98 // 创建融云用户、群组 105 // 创建融云用户、群组
99 - $rongyun_chat = $this->rongyun_handle($order['user_id'].','.$order['teacher_id']); 106 + $teacher_id = Db::name('teacher')->where('id',$order['teacher_id'])->value('user_id');
  107 + $rongyun_chat = $this->rongyun_handle($order['user_id'].','.$teacher_id);
100 if($rongyun_chat) { 108 if($rongyun_chat) {
101 $update['chat_id'] = $rongyun_chat['chat_id']; 109 $update['chat_id'] = $rongyun_chat['chat_id'];
102 $update['chat_name'] = $rongyun_chat['chat_name']; 110 $update['chat_name'] = $rongyun_chat['chat_name'];
@@ -117,7 +125,8 @@ class Pay extends Api @@ -117,7 +125,8 @@ class Pay extends Api
117 $update['finish_status'] = 1; 125 $update['finish_status'] = 1;
118 Db::name('teacher')->where('id',$order['teacher_id'])->setInc('help_num'); 126 Db::name('teacher')->where('id',$order['teacher_id'])->setInc('help_num');
119 // 创建融云用户、群组 127 // 创建融云用户、群组
120 - $rongyun_chat = $this->rongyun_handle($order['user_id'].','.$order['teacher_id']); 128 + $teacher_id = Db::name('teacher')->where('id',$order['teacher_id'])->value('user_id');
  129 + $rongyun_chat = $this->rongyun_handle($order['user_id'].','.$teacher_id);
121 if($rongyun_chat) { 130 if($rongyun_chat) {
122 $update['chat_id'] = $rongyun_chat['chat_id']; 131 $update['chat_id'] = $rongyun_chat['chat_id'];
123 $update['chat_name'] = $rongyun_chat['chat_name']; 132 $update['chat_name'] = $rongyun_chat['chat_name'];