user = $user; } public function handle() { $imParams = [ 'From_Account' => (string) $this->user->id, 'StartIndex' => 0, 'StandardSequence' => 0, 'CustomSequence' => 0, ]; $vars = app('im')->send('sns', 'friend_get', $imParams); $this->user->f = count($vars['UserDataItem']); $params = [ 'jsonrpc' => '2.0', 'id' => 1, 'method' => 'Chain33.Query', 'params' => [ [ 'execer' => 'chat', 'funcName' => 'GetFriends', 'payload' => [ 'mainAddress' => $this->user->username, 'count' => 2000, ] ] ], ]; $client = new Client([ 'base_uri' => '152.136.224.167:8901' ]); $result = $client->post('', [ 'body' => json_encode($params), ]); $json = json_decode($result->getBody()->getContents(), true); $collect = count($json['result']['friends']); $this->user->c = $collect; $this->user->save(); } }