| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Module\AppGame;
- use App\Module\AppGame\SessionApp;
- class UserService
- {
- public function getToken()
- {
- return SessionApp::$session_id;
- }
- public function __construct(protected int $user_id)
- {
- }
- /**
- * @return static
- */
- static public function newBySession()
- {
- return new static(SessionApp::getUserId());
- }
- /**
- * 传入数据处理
- * @param $data
- * @return array|int[]
- */
- public function callData($data)
- {
- $page = $data['page'] ?? 1;
- $limit = $data['limit'] ?? 10;
- unset($data['page']);
- unset($data['limit']);
- $where = $data;
- return [
- $page, $limit, $where,
- ];
- }
- }
|