Explorar o código

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

dmy %!s(int64=5) %!d(string=hai) anos
pai
achega
1f02b2e26f
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      protected/controllers/UserController.php

+ 12 - 1
protected/controllers/UserController.php

@@ -117,7 +117,8 @@ class UserController extends BaseController {
         $rules = [
         $rules = [
             'account' => ['string', 'reg' => '/^[a-z0-9\.]{1,13}$/', 'desc' => 'eos账号'],
             'account' => ['string', 'reg' => '/^[a-z0-9\.]{1,13}$/', 'desc' => 'eos账号'],
             'access_token' => ['string', 'len' => 36, 'desc' => 'access_token'],
             '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);
         Param::checkParam2($rules, $args);
 
 
@@ -162,6 +163,16 @@ class UserController extends BaseController {
             Response::error($e->getCode(), $e->getMessage());
             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;
         return $data;
     }
     }