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
9264645e
Commit
9264645e
authored
Nov 24, 2021
by
顾敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
984490f8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
25 deletions
+21
-25
src/app/Http/Controllers/Card/CardController.php
src/app/Http/Controllers/Card/CardController.php
+21
-17
src/app/Http/Controllers/Card/HomeController.php
src/app/Http/Controllers/Card/HomeController.php
+0
-4
src/app/Http/Controllers/Card/WxController.php
src/app/Http/Controllers/Card/WxController.php
+0
-4
No files found.
src/app/Http/Controllers/Card/CardController.php
View file @
9264645e
...
@@ -352,11 +352,11 @@ class CardController extends Controller
...
@@ -352,11 +352,11 @@ class CardController extends Controller
if
(
!
Schema
::
connection
(
'wx_mysql'
)
->
hasTable
(
'wx_card_role_'
.
$serverId
))
return
redirect
(
route
(
'index'
));
if
(
!
Schema
::
connection
(
'wx_mysql'
)
->
hasTable
(
'wx_card_role_'
.
$serverId
))
return
redirect
(
route
(
'index'
));
$info
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
'wx_card_role_'
.
$serverId
)
->
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
where
(
'server_id'
,
$serverId
)
->
first
();
$info
=
DB
::
connection
(
'wx_mysql'
)
->
table
(
'wx_card_role_'
.
$serverId
)
->
where
(
'uid'
,
$userId
)
->
where
(
'role_id'
,
$roleId
)
->
where
(
'server_id'
,
$serverId
)
->
first
();
if
(
!
$info
)
return
redirect
(
route
(
'index'
));
if
(
!
$info
)
return
redirect
(
route
(
'index'
));
$serverName
=
''
;
if
(
$info
->
server_name
!=
''
){
$serverName
=
$info
->
server_name
;
$serverName
=
str_replace
(
'非硬核-'
,
''
,
$info
->
server_name
);
$splitIndex
=
strpos
(
$info
->
server_name
,
"-"
);
$serverName
=
str_replace
(
'硬核-'
,
''
,
$serverName
);
if
(
$splitIndex
!==
false
)
{
$serverName
=
s
tr_replace
(
'越狱-'
,
''
,
$serverName
);
$serverName
=
s
ubstr
(
$info
->
server_name
,
$splitIndex
+
1
);
}
}
$user
=
User
::
where
(
'uid'
,
$userId
)
->
select
(
'uid'
,
'account'
)
->
first
();
$user
=
User
::
where
(
'uid'
,
$userId
)
->
select
(
'uid'
,
'account'
)
->
first
();
...
@@ -387,12 +387,14 @@ class CardController extends Controller
...
@@ -387,12 +387,14 @@ 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'
;
// $roleScore = '00000';
if
(
strlen
(
$info
->
role_score
)
==
1
)
$roleScore
=
'0000'
.
(
string
)
$info
->
role_score
;
// 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) == 2) $roleScore = '000'.(string)$info->role_score;
if
(
strlen
(
$info
->
role_score
)
==
3
)
$roleScore
=
'00'
.
(
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) == 4) $roleScore = '0'.(string)$info->role_score;
if
(
strlen
(
$info
->
role_score
)
==
5
)
$roleScore
=
(
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
);
$jobInco
=
config
(
'sign.jobInco'
);
$jobInco
=
config
(
'sign.jobInco'
);
$data
[
'info'
]
=
$info
;
$data
[
'info'
]
=
$info
;
...
@@ -418,12 +420,14 @@ class CardController extends Controller
...
@@ -418,12 +420,14 @@ 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'
;
// $armsScoreNum = '00000';
if
(
strlen
(
$armsScore
[
0
][
'score'
])
==
1
)
$armsScoreNum
=
'0000'
.
(
string
)
$armsScore
[
0
][
'score'
];
// 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']) == 2) $armsScoreNum = '000'.(string)$armsScore[0]['score'];
if
(
strlen
(
$armsScore
[
0
][
'score'
])
==
3
)
$armsScoreNum
=
'00'
.
(
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']) == 4) $armsScoreNum = '0'.(string)$armsScore[0]['score'];
if
(
strlen
(
$armsScore
[
0
][
'score'
])
==
5
)
$armsScoreNum
=
(
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
);
$data
[
'armsScoreName'
]
=
$armsScore
[
0
][
'name'
];
$data
[
'armsScoreName'
]
=
$armsScore
[
0
][
'name'
];
$data
[
'armsScore'
]
=
$armsScoreNum
;
$data
[
'armsScore'
]
=
$armsScoreNum
;
}
else
{
}
else
{
...
...
src/app/Http/Controllers/Card/HomeController.php
View file @
9264645e
...
@@ -3,11 +3,7 @@ namespace App\Http\Controllers\Card;
...
@@ -3,11 +3,7 @@ namespace App\Http\Controllers\Card;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Validator
;
use
Throwable
;
use
Exception
;
use
Carbon\Carbon
;
use
Carbon\Carbon
;
use
Illuminate\Validation\Rule
;
use
App\Services\UtilService
;
use
App\Services\UtilService
;
use
App\Models\User
;
use
App\Models\User
;
...
...
src/app/Http/Controllers/Card/WxController.php
View file @
9264645e
...
@@ -3,11 +3,7 @@ namespace App\Http\Controllers\Card;
...
@@ -3,11 +3,7 @@ namespace App\Http\Controllers\Card;
use
App\Http\Controllers\Controller
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Validator
;
use
Throwable
;
use
Exception
;
use
Carbon\Carbon
;
use
Carbon\Carbon
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Support\Facades\Cache
;
use
Illuminate\Support\Facades\Cache
;
class
WxController
extends
Controller
class
WxController
extends
Controller
...
...
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