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
970051eb
Commit
970051eb
authored
Sep 22, 2020
by
冯超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加
parent
daa80127
Pipeline
#140
failed with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
UinappHomeController.php
app/Http/Controllers/UinappHomeController.php
+14
-1
api.php
routes/api.php
+1
-0
No files found.
app/Http/Controllers/UinappHomeController.php
View file @
970051eb
...
@@ -62,7 +62,7 @@ class UinappHomeController extends Controller
...
@@ -62,7 +62,7 @@ class UinappHomeController extends Controller
->
get
();
->
get
();
}
}
return
$this
->
jsonSuccessData
(
$data
);
return
$this
->
jsonSuccessData
(
$data
);
}
else
{
}
else
{
return
$this
->
jsonSuccessData
(
''
);
return
$this
->
jsonSuccessData
(
''
);
}
}
...
@@ -96,6 +96,19 @@ class UinappHomeController extends Controller
...
@@ -96,6 +96,19 @@ class UinappHomeController extends Controller
return
$this
->
jsonSuccessData
(
$data
);
return
$this
->
jsonSuccessData
(
$data
);
}
}
//返回设备类型和单位和介质
public
function
devicetype
()
{
$gas
=
DB
::
table
(
'gas'
)
->
get
()
->
toArray
();
$danwei
=
DB
::
table
(
'danwei'
)
->
get
()
->
toArray
();
$devicetypecount
=
DB
::
table
(
'device_type as t'
)
->
leftjoin
(
'device as d'
,
'd.dtype'
,
'='
,
't.tid'
)
->
selectRaw
(
't.*,count(d.id) as counnum'
)
->
groupBy
(
't.tid'
)
->
get
()
->
toArray
();
return
$this
->
jsonSuccessData
([
'devicetype'
=>
$devicetypecount
,
'gas'
=>
$gas
,
'danwei'
=>
$danwei
]);
}
//监测是否是汉子
//监测是否是汉子
private
function
isKanji
(
$str
)
private
function
isKanji
(
$str
)
{
{
...
...
routes/api.php
View file @
970051eb
...
@@ -125,6 +125,7 @@ Route::group(['middleware'=>'auth:api'],function (){
...
@@ -125,6 +125,7 @@ Route::group(['middleware'=>'auth:api'],function (){
Route
::
get
(
'huinapphome/devicedatainfo/{id}'
,
'UinappHomeController@devicedatainfo'
);
//设备详情
Route
::
get
(
'huinapphome/devicedatainfo/{id}'
,
'UinappHomeController@devicedatainfo'
);
//设备详情
Route
::
post
(
'huinapphome/imitation'
,
'UinappHomeController@imitation'
);
//模糊查询
Route
::
post
(
'huinapphome/imitation'
,
'UinappHomeController@imitation'
);
//模糊查询
Route
::
post
(
'huinapphome/setseachdata'
,
'UinappHomeController@setseachdata'
);
//指定查询
Route
::
post
(
'huinapphome/setseachdata'
,
'UinappHomeController@setseachdata'
);
//指定查询
Route
::
get
(
'huinapphome/devicetype'
,
'UinappHomeController@devicetype'
);
//测试添加页面选择数组数据
});
});
// Fake APIs
// Fake APIs
...
...
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