Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uc_card
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhoujun
uc_card
Commits
c5d5d4fc
Commit
c5d5d4fc
authored
Nov 25, 2021
by
liyadong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of
http://gitlab.cccwangluo.com/zhoujun/uc_card
into test
parents
8302b1e1
f7464781
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
79 deletions
+113
-79
src/app/Http/Controllers/Card/CardController.php
src/app/Http/Controllers/Card/CardController.php
+44
-49
src/app/Models/GameUserPvp.php
src/app/Models/GameUserPvp.php
+0
-10
src/app/Models/GameUserPvpCount.php
src/app/Models/GameUserPvpCount.php
+0
-10
src/app/Models/GameUserRoleTime.php
src/app/Models/GameUserRoleTime.php
+0
-10
src/config/gameservers.php
src/config/gameservers.php
+64
-0
src/routes/web.php
src/routes/web.php
+5
-0
No files found.
src/app/Http/Controllers/Card/CardController.php
View file @
c5d5d4fc
...
@@ -15,6 +15,7 @@ use App\Models\BaseItem;
...
@@ -15,6 +15,7 @@ use App\Models\BaseItem;
use
App\Models\WxUserImg
;
use
App\Models\WxUserImg
;
use
App\Services\UploadServer
;
use
App\Services\UploadServer
;
use
App\Models\User
;
use
App\Models\User
;
use
Illuminate\Support\Optional
;
class
CardController
extends
Controller
class
CardController
extends
Controller
{
{
...
@@ -74,21 +75,25 @@ class CardController extends Controller
...
@@ -74,21 +75,25 @@ class CardController extends Controller
$userId
=
$request
->
session
()
->
get
(
"uid"
);
$userId
=
$request
->
session
()
->
get
(
"uid"
);
$result
=
$this
->
getVerityLogin
(
$userId
);
$result
=
$this
->
getVerityLogin
(
$userId
);
if
(
$result
[
'code'
]
!=
200
)
return
$this
->
jsonReturn
(
$result
[
'code'
],
$result
[
'msg'
]);
if
(
$result
[
'code'
]
!=
200
)
return
$this
->
jsonReturn
(
$result
[
'code'
],
$result
[
'msg'
]);
if
(
Cache
::
has
(
$userId
.
':card:bind:role'
))
return
$this
->
jsonReturn
(
10022
,
'绑定角色过于频繁,请稍后再试'
);
$roleId
=
$request
->
input
(
'roleId'
);
$roleId
=
$request
->
input
(
'roleId'
);
$serverId
=
$request
->
input
(
'serverId'
);
$serverId
=
$request
->
input
(
'serverId'
);
$serverName
=
$request
->
input
(
'serverName'
);
$serverName
=
$request
->
input
(
'serverName'
);
if
(
empty
(
$roleId
)
||
empty
(
$serverId
)
||
empty
(
$serverName
))
return
$this
->
jsonReturn
(
7002
,
'参数错误'
);
if
(
empty
(
$roleId
)
||
empty
(
$serverId
)
||
empty
(
$serverName
))
return
$this
->
jsonReturn
(
7002
,
'参数错误'
);
$lock
=
Cache
::
lock
(
"card:bind:role:"
.
$userId
,
30
);
if
(
!
$lock
->
get
())
{
return
$this
->
jsonReturn
(
10022
,
'绑定角色过于频繁,请稍后再试'
);
}
$tableName
=
'wx_card_role_'
.
$serverId
;
$tableName
=
'wx_card_role_'
.
$serverId
;
$this
->
getCheckRoleInfoTable
(
$tableName
);
$this
->
getCheckRoleInfoTable
(
$tableName
);
$verity
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
$tableName
)
->
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
select
(
'id'
)
->
first
();
$verity
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
$tableName
)
->
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
select
(
'id'
)
->
first
();
if
(
$verity
)
return
$this
->
jsonReturn
(
0
,
'角色绑定成功'
);
if
(
$verity
)
return
$this
->
jsonReturn
(
0
,
'角色绑定成功'
);
Cache
::
put
(
$userId
.
':card:bind:role'
,
1
,
30
);
$insert
=
$this
->
getInsertRoleInfo
(
$userId
,
$roleId
,
$serverId
,
$serverName
,
$tableName
);
$insert
=
$this
->
getInsertRoleInfo
(
$userId
,
$roleId
,
$serverId
,
$serverName
,
$tableName
);
optional
(
$lock
)
->
release
();
if
(
$insert
[
'code'
]
==
200
)
return
$this
->
jsonReturn
(
0
,
'角色绑定成功'
);
if
(
$insert
[
'code'
]
==
200
)
return
$this
->
jsonReturn
(
0
,
'角色绑定成功'
);
Cache
::
forget
(
$userId
.
':card:bind:role'
);
return
$this
->
jsonReturn
(
$insert
[
'code'
],
$insert
[
'msg'
]);
return
$this
->
jsonReturn
(
$insert
[
'code'
],
$insert
[
'msg'
]);
}
}
...
@@ -342,43 +347,26 @@ class CardController extends Controller
...
@@ -342,43 +347,26 @@ class CardController extends Controller
$roleId
=
$request
->
input
(
'roleId'
);
$roleId
=
$request
->
input
(
'roleId'
);
$serverId
=
$request
->
input
(
'serverId'
);
$serverId
=
$request
->
input
(
'serverId'
);
$result
=
$this
->
getVerityLogin
(
$userId
);
if
(
$result
[
'code'
]
!=
200
)
return
$this
->
jsonReturn
(
$result
[
'code'
],
$result
[
'msg'
]);
if
(
empty
(
$roleId
)
||
empty
(
$serverId
))
return
$this
->
jsonReturn
(
7002
,
'参数错误'
);
$data
=
[];
$data
=
[];
if
(
Cache
::
has
(
'card:info:'
.
$userId
.
':'
.
$roleId
)){
if
(
Cache
::
has
(
'card:info:'
.
$userId
.
':'
.
$roleId
)){
$data
=
Cache
::
get
(
'card:info:'
.
$userId
.
':'
.
$roleId
);
$data
=
Cache
::
get
(
'card:info:'
.
$userId
.
':'
.
$roleId
);
}
else
{
}
else
{
$
result
=
$this
->
getVerityLogin
(
$userId
);
$
info
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
'wx_card_role_'
.
$serverId
)
if
(
$result
[
'code'
]
!=
200
)
return
$this
->
jsonReturn
(
$result
[
'code'
],
$result
[
'msg'
]);
->
where
(
'uid'
,
$userId
)
if
(
empty
(
$roleId
)
||
empty
(
$serverId
))
return
$this
->
jsonReturn
(
7002
,
'参数错误'
);
->
where
(
'role_id'
,
$roleId
)
if
(
!
Schema
::
connection
(
'wx_mysql'
)
->
hasTable
(
'wx_card_role_'
.
$serverId
))
return
redirect
(
route
(
'index'
));
->
where
(
'server_id'
,
$serverId
)
$info
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
'wx_card_role_'
.
$serverId
)
->
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
where
(
'server_id'
,
$serverId
)
->
first
();
->
first
();
if
(
!
$info
)
return
redirect
(
route
(
'index'
));
if
(
!
$info
)
return
redirect
(
route
(
'index'
));
$serverName
=
$info
->
server_name
;
$serverNames
=
config
(
"gameservers"
);
$splitIndex
=
strpos
(
$info
->
server_name
,
"-"
);
if
(
$splitIndex
!==
false
)
{
$serverName
=
substr
(
$info
->
server_name
,
$splitIndex
+
1
);
}
$user
=
User
::
where
(
'uid'
,
$userId
)
->
select
(
'uid'
,
'account'
)
->
first
();
$user
=
User
::
where
(
'uid'
,
$userId
)
->
select
(
'uid'
,
'account'
)
->
first
();
$data
[
'userName'
]
=
$user
->
account
??
''
;
$data
[
'userName'
]
=
$user
->
account
??
''
;
$data
[
'serverName'
]
=
$serverName
;
$data
[
'serverName'
]
=
$serverNames
[
$info
->
server_id
]
??
$info
->
server_id
;
$img
=
WxUserImg
::
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$info
->
id
)
->
where
(
'server_id'
,
$info
->
server_id
)
->
select
(
'id'
,
'img_url'
,
'status'
,
'is_upload'
)
->
first
();
if
(
$img
){
if
(
$img
->
status
==
1
){
if
(
$img
->
is_upload
==
1
){
$data
[
'userImgStatus'
]
=
1
;
}
else
{
$data
[
'userImgStatus'
]
=
0
;
}
}
else
{
$data
[
'userImgStatus'
]
=
$img
->
status
;
}
$data
[
'userImg'
]
=
$img
->
img_url
;
}
else
{
$data
[
'userImg'
]
=
''
;
$data
[
'userImgStatus'
]
=
-
1
;
}
$armsScore
=
[];
$armsScore
=
[];
$armsStrong
=
[];
$armsStrong
=
[];
...
@@ -387,13 +375,6 @@ class CardController extends Controller
...
@@ -387,13 +375,6 @@ class CardController extends Controller
if
(
$info
->
arms_strong
!=
''
)
$armsStrong
=
json_decode
(
$info
->
arms_strong
,
true
);
if
(
$info
->
arms_strong
!=
''
)
$armsStrong
=
json_decode
(
$info
->
arms_strong
,
true
);
if
(
$info
->
arms_exciting
!=
''
)
$armsExciting
=
json_decode
(
$info
->
arms_exciting
,
true
);
if
(
$info
->
arms_exciting
!=
''
)
$armsExciting
=
json_decode
(
$info
->
arms_exciting
,
true
);
// $roleScore = '00000';
// if(strlen($info->role_score) == 1) $roleScore = '0000'.(string)$info->role_score;
// if(strlen($info->role_score) == 2) $roleScore = '000'.(string)$info->role_score;
// if(strlen($info->role_score) == 3) $roleScore = '00'.(string)$info->role_score;
// if(strlen($info->role_score) == 4) $roleScore = '0'.(string)$info->role_score;
// if(strlen($info->role_score) == 5) $roleScore = (string)$info->role_score;
$roleScore
=
str_pad
(
$info
->
role_score
,
5
,
"0"
,
STR_PAD_LEFT
);
$roleScore
=
str_pad
(
$info
->
role_score
,
5
,
"0"
,
STR_PAD_LEFT
);
$jobInco
=
config
(
'sign.jobInco'
);
$jobInco
=
config
(
'sign.jobInco'
);
...
@@ -420,13 +401,6 @@ class CardController extends Controller
...
@@ -420,13 +401,6 @@ class CardController extends Controller
$data
[
'rank'
]
=
empty
(
$info
->
max_rank
)
?
'青铜5'
:
$info
->
max_rank
;
$data
[
'rank'
]
=
empty
(
$info
->
max_rank
)
?
'青铜5'
:
$info
->
max_rank
;
if
(
!
empty
(
$armsScore
)){
if
(
!
empty
(
$armsScore
)){
// $armsScoreNum = '00000';
// if(strlen($armsScore[0]['score']) == 1) $armsScoreNum = '0000'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 2) $armsScoreNum = '000'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 3) $armsScoreNum = '00'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 4) $armsScoreNum = '0'.(string)$armsScore[0]['score'];
// if(strlen($armsScore[0]['score']) == 5) $armsScoreNum = (string)$armsScore[0]['score'];
$armsScoreNum
=
str_pad
(
$armsScore
[
0
][
'score'
],
5
,
"0"
,
STR_PAD_LEFT
);
$armsScoreNum
=
str_pad
(
$armsScore
[
0
][
'score'
],
5
,
"0"
,
STR_PAD_LEFT
);
$data
[
'armsScoreName'
]
=
$armsScore
[
0
][
'name'
];
$data
[
'armsScoreName'
]
=
$armsScore
[
0
][
'name'
];
$data
[
'armsScore'
]
=
$armsScoreNum
;
$data
[
'armsScore'
]
=
$armsScoreNum
;
...
@@ -470,6 +444,27 @@ class CardController extends Controller
...
@@ -470,6 +444,27 @@ class CardController extends Controller
Cache
::
put
(
'card:info:'
.
$userId
.
':'
.
$roleId
,
$data
,
86400
);
Cache
::
put
(
'card:info:'
.
$userId
.
':'
.
$roleId
,
$data
,
86400
);
}
}
$img
=
WxUserImg
::
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
where
(
'server_id'
,
$serverId
)
->
select
(
'id'
,
'img_url'
,
'status'
,
'is_upload'
)
->
first
();
if
(
$img
){
if
(
$img
->
status
==
1
){
if
(
$img
->
is_upload
==
1
){
$data
[
'userImgStatus'
]
=
1
;
}
else
{
$data
[
'userImgStatus'
]
=
0
;
}
}
else
{
$data
[
'userImgStatus'
]
=
$img
->
status
;
}
$data
[
'userImg'
]
=
$img
->
img_url
;
}
else
{
$data
[
'userImg'
]
=
''
;
$data
[
'userImgStatus'
]
=
-
1
;
}
return
view
(
'card.card'
,
$data
);
return
view
(
'card.card'
,
$data
);
}
}
}
}
\ No newline at end of file
src/app/Models/GameUserPvp.php
deleted
100644 → 0
View file @
8302b1e1
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
GameUserPvp
extends
Model
{
protected
$connection
=
'wx_mysql'
;
protected
$table
=
'game_user_pvp'
;
}
\ No newline at end of file
src/app/Models/GameUserPvpCount.php
deleted
100644 → 0
View file @
8302b1e1
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
GameUserPvpCount
extends
Model
{
protected
$connection
=
'wx_mysql'
;
protected
$table
=
'game_user_pvp_count'
;
}
\ No newline at end of file
src/app/Models/GameUserRoleTime.php
deleted
100644 → 0
View file @
8302b1e1
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
GameUserRoleTime
extends
Model
{
protected
$connection
=
'wx_mysql'
;
protected
$table
=
'game_user_role_time'
;
}
\ No newline at end of file
src/config/gameservers.php
0 → 100644
View file @
c5d5d4fc
<?php
return
[
269
=>
'月光酒馆1-36服'
,
267
=>
'月光酒馆37-53服'
,
268
=>
'月光酒馆54-71服'
,
271
=>
'月光酒馆72-77服'
,
272
=>
'月光酒馆78-79服'
,
3848
=>
'天空之城1-30服'
,
3868
=>
'时空裂缝1-30服'
,
3871
=>
'时空裂缝31-36服'
,
3872
=>
'时空裂缝37-38服'
,
910
=>
'格林之森1-50服'
,
888
=>
'诺克玛尔1-30服'
,
883
=>
'冰封雪域1-23服'
,
903
=>
'冰封雪域24-50服'
,
936
=>
'冰封雪域51-68服'
,
934
=>
'冰封雪域69-79服'
,
933
=>
'冰封雪域80-83服'
,
938
=>
'冰封雪域84-89服'
,
939
=>
'冰封雪域90-92服'
,
494
=>
'冰封雪域93服'
,
940
=>
'冰封雪域94-95服'
,
941
=>
'冰封雪域96-97服'
,
942
=>
'冰封雪域98-99服'
,
501
=>
'冰封雪域100服'
,
502
=>
'冰封雪域101服'
,
503
=>
'冰封雪域102服'
,
504
=>
'冰封雪域103服'
,
505
=>
'冰封雪域104服'
,
506
=>
'冰封雪域105服'
,
507
=>
'冰封雪域106服'
,
508
=>
'冰封雪域107服'
,
509
=>
'冰封雪域108服'
,
510
=>
'冰封雪域109服'
,
1000
=>
'天空之海1服'
,
1957
=>
'天空之海2-32服'
,
1953
=>
'元素回廊1-31服'
,
1933
=>
'元素回廊32-50服'
,
1993
=>
'元素回廊51-59服'
,
1908
=>
'元素回廊60-71服'
,
1904
=>
'元素回廊72-79服'
,
1909
=>
'元素回廊80-87服'
,
1918
=>
'元素回廊88-95服'
,
1939
=>
'元素回廊96-107服'
,
1944
=>
'元素回廊108-115服'
,
1947
=>
'元素回廊116-121服'
,
1936
=>
'元素回廊122-125服'
,
1951
=>
'元素回廊126-129服'
,
1954
=>
'元素回廊130-133服'
,
1952
=>
'元素回廊134-139服'
,
1960
=>
'元素回廊140-151服'
,
1182
=>
'元素回廊152服'
,
2843
=>
'光之宫殿1-30服'
,
2858
=>
'光之宫殿31-54服'
,
2859
=>
'光之宫殿55-60服'
,
2862
=>
'光之宫殿61-64服'
,
2871
=>
'光之宫殿65-68服'
,
2870
=>
'光之宫殿69-75服'
,
2872
=>
'光之宫殿76-79服'
,
2873
=>
'光之宫殿80-81服'
,
4101
=>
'迷雾峡谷1-2服'
,
5001
=>
'时之漩涡1服'
,
5002
=>
'时之漩涡2服'
,
];
\ No newline at end of file
src/routes/web.php
View file @
c5d5d4fc
...
@@ -10,6 +10,11 @@
...
@@ -10,6 +10,11 @@
| contains the 'web' middleware group. Now create something great!
| contains the 'web' middleware group. Now create something great!
|
|
*/
*/
Route
::
get
(
"config/game_servers"
,
function
()
{
return
json_encode
(
config
(
"gameservers"
),
JSON_UNESCAPED_UNICODE
);
});
Route
::
get
(
'health/status'
,
'CheckController@getCheckDB'
);
Route
::
get
(
'health/status'
,
'CheckController@getCheckDB'
);
Route
::
any
(
'/wx/home'
,
'HomeController@getIndex'
)
->
name
(
'wxIndex'
);
Route
::
any
(
'/wx/home'
,
'HomeController@getIndex'
)
->
name
(
'wxIndex'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment