Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravelzh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冯超鹏
laravelzh
Commits
66f7b2d2
Commit
66f7b2d2
authored
Sep 03, 2020
by
冯超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
6c0540e2
Pipeline
#135
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
27 deletions
+37
-27
UinappHomeController.php
app/Http/Controllers/UinappHomeController.php
+37
-27
No files found.
app/Http/Controllers/UinappHomeController.php
View file @
66f7b2d2
...
...
@@ -38,50 +38,58 @@ class UinappHomeController extends Controller
public
function
imitation
(
Request
$request
)
{
$imitationdata
=
$request
->
input
(
'imitationdata'
);
if
(
$this
->
isKanji
(
$imitationdata
))
{
$data
=
DB
::
table
(
'device as d'
)
->
join
(
'device_type as t'
,
'd.dtype'
,
'='
,
't.tid'
)
->
join
(
'gas as g'
,
'd.status'
,
'='
,
'g.id'
)
->
join
(
'danwei as w'
,
'd.devicemonad'
,
'='
,
'w.id'
)
->
join
(
'status as s'
,
'd.devicepolice'
,
'='
,
's.id'
)
->
join
(
'users as u'
,
'd.uid'
,
'='
,
'u.id'
)
->
where
(
'd.username'
,
'like'
,
'%'
.
$imitationdata
.
'%'
)
->
select
(
'd.*'
,
't.tname'
,
'g.gas'
,
'w.danwei'
,
's.status_name'
,
'u.username as nameh'
,
'u.isadmin'
)
->
get
();
}
else
{
$data
=
DB
::
table
(
'device as d'
)
->
join
(
'device_type as t'
,
'd.dtype'
,
'='
,
't.tid'
)
->
join
(
'gas as g'
,
'd.status'
,
'='
,
'g.id'
)
->
join
(
'danwei as w'
,
'd.devicemonad'
,
'='
,
'w.id'
)
->
join
(
'status as s'
,
'd.devicepolice'
,
'='
,
's.id'
)
->
join
(
'users as u'
,
'd.uid'
,
'='
,
'u.id'
)
->
where
(
'd.devicenum'
,
'like'
,
'%'
.
$imitationdata
.
'%'
)
->
select
(
'd.*'
,
't.tname'
,
'g.gas'
,
'w.danwei'
,
's.status_name'
,
'u.username as nameh'
,
'u.isadmin'
)
->
get
();
if
(
$imitationdata
!=
''
)
{
if
(
$this
->
isKanji
(
$imitationdata
))
{
$data
=
DB
::
table
(
'device as d'
)
->
join
(
'device_type as t'
,
'd.dtype'
,
'='
,
't.tid'
)
->
join
(
'gas as g'
,
'd.status'
,
'='
,
'g.id'
)
->
join
(
'danwei as w'
,
'd.devicemonad'
,
'='
,
'w.id'
)
->
join
(
'status as s'
,
'd.devicepolice'
,
'='
,
's.id'
)
->
join
(
'users as u'
,
'd.uid'
,
'='
,
'u.id'
)
->
where
(
'd.username'
,
'like'
,
'%'
.
$imitationdata
.
'%'
)
->
select
(
'd.*'
,
't.tname'
,
'g.gas'
,
'w.danwei'
,
's.status_name'
,
'u.username as nameh'
,
'u.isadmin'
)
->
get
();
}
else
{
$data
=
DB
::
table
(
'device as d'
)
->
join
(
'device_type as t'
,
'd.dtype'
,
'='
,
't.tid'
)
->
join
(
'gas as g'
,
'd.status'
,
'='
,
'g.id'
)
->
join
(
'danwei as w'
,
'd.devicemonad'
,
'='
,
'w.id'
)
->
join
(
'status as s'
,
'd.devicepolice'
,
'='
,
's.id'
)
->
join
(
'users as u'
,
'd.uid'
,
'='
,
'u.id'
)
->
where
(
'd.devicenum'
,
'like'
,
'%'
.
$imitationdata
.
'%'
)
->
select
(
'd.*'
,
't.tname'
,
'g.gas'
,
'w.danwei'
,
's.status_name'
,
'u.username as nameh'
,
'u.isadmin'
)
->
get
();
}
return
$this
->
jsonSuccessData
(
$data
);
}
else
{
return
$this
->
jsonSuccessData
(
''
);
}
return
$this
->
jsonSuccessData
(
$data
);
}
//指定查询
public
function
setseachdata
(
Request
$request
){
public
function
setseachdata
(
Request
$request
)
{
$setdata
=
$request
->
input
(
'setseachdata'
);
if
(
$this
->
isKanji
(
$setdata
)){
if
(
$this
->
isKanji
(
$setdata
))
{
$data
=
DB
::
table
(
'device as d'
)
->
join
(
'device_type as t'
,
'd.dtype'
,
'='
,
't.tid'
)
->
join
(
'gas as g'
,
'd.status'
,
'='
,
'g.id'
)
->
join
(
'danwei as w'
,
'd.devicemonad'
,
'='
,
'w.id'
)
->
join
(
'status as s'
,
'd.devicepolice'
,
'='
,
's.id'
)
->
join
(
'users as u'
,
'd.uid'
,
'='
,
'u.id'
)
->
where
(
'd.username'
,
'='
,
$setdata
)
->
where
(
'd.username'
,
'='
,
$setdata
)
->
select
(
'd.*'
,
't.tname'
,
'g.gas'
,
'w.danwei'
,
's.status_name'
,
'u.username as nameh'
,
'u.isadmin'
)
->
get
();
}
else
{
}
else
{
$data
=
DB
::
table
(
'device as d'
)
->
join
(
'device_type as t'
,
'd.dtype'
,
'='
,
't.tid'
)
->
join
(
'gas as g'
,
'd.status'
,
'='
,
'g.id'
)
->
join
(
'danwei as w'
,
'd.devicemonad'
,
'='
,
'w.id'
)
->
join
(
'status as s'
,
'd.devicepolice'
,
'='
,
's.id'
)
->
join
(
'users as u'
,
'd.uid'
,
'='
,
'u.id'
)
->
where
(
'd.devicenum'
,
'='
,
$setdata
)
->
where
(
'd.devicenum'
,
'='
,
$setdata
)
->
select
(
'd.*'
,
't.tname'
,
'g.gas'
,
'w.danwei'
,
's.status_name'
,
'u.username as nameh'
,
'u.isadmin'
)
->
get
();
}
...
...
@@ -91,10 +99,12 @@ class UinappHomeController extends Controller
//监测是否是汉子
private
function
isKanji
(
$str
)
{
if
(
preg_match
(
"/^[
"
.
chr
(
0x80
)
.
"-"
.
chr
(
0xff
)
.
"]
$/"
,
$str
))
{
if
(
preg_match
(
"/^[
\x7f
-
\xff
]+
$/"
,
$str
))
{
return
true
;
}
else
{
return
false
;
}
}
//主页home的
}
\ No newline at end of file
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