Browse Source

Merge branch 'master' of http://svn.ouj.com:3000/eos_sicbo/chat

dmy 5 years ago
parent
commit
1f02b2e26f
1 changed files with 12 additions and 1 deletions
  1. 12 1
      protected/controllers/UserController.php

+ 12 - 1
protected/controllers/UserController.php

@@ -117,7 +117,8 @@ class UserController extends BaseController {
         $rules = [
             'account' => ['string', 'reg' => '/^[a-z0-9\.]{1,13}$/', 'desc' => 'eos账号'],
             'access_token' => ['string', 'len' => 36, 'desc' => 'access_token'],
-            'trx_id' => ['string', 'desc' => '交易id']
+            'trx_id' => ['string', 'desc' => '交易id'],
+            'group_id' => ['int', 'nullable' => true, 'desc' => '群id'],
         ];
         Param::checkParam2($rules, $args);
 
@@ -162,6 +163,16 @@ class UserController extends BaseController {
             Response::error($e->getCode(), $e->getMessage());
         }
 
+        // 带群id检测是否加入群
+        if ($args['group_id']) {
+            try {
+                (new GroupInfo())->joinGroup($data['user_id'], $args['group_id']);
+            } catch (Exception $e) {
+                var_log($e->getMessage());
+            }
+
+        }
+
         return $data;
     }