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
9622ed85
Commit
9622ed85
authored
Aug 21, 2020
by
冯超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建
parent
477af4dc
Pipeline
#126
canceled with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
UinappHomeController.php
app/Http/Controllers/UinappHomeController.php
+11
-11
api.php
routes/api.php
+1
-1
No files found.
app/Http/Controllers/UinappHomeController.php
View file @
9622ed85
...
...
@@ -20,17 +20,17 @@ use Validator;
class
UinappHomeController
extends
Controller
{
public
function
devicedatainfo
(){
//
$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.id','=',$id)
//
->select('d.*','t.tname','g.gas','w.danwei','s.status_name','u.username','u.isadmin')
//
->first();
//
return $this->jsonSuccessData($data);
public
function
devicedatainfo
(
$id
){
$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.id'
,
'='
,
$id
)
->
select
(
'd.*'
,
't.tname'
,
'g.gas'
,
'w.danwei'
,
's.status_name'
,
'u.username'
,
'u.isadmin'
)
->
first
();
return
$this
->
jsonSuccessData
(
$data
);
return
$this
->
jsonSuccessData
(
'2313'
);
}
...
...
routes/api.php
View file @
9622ed85
...
...
@@ -122,7 +122,7 @@ Route::group(['middleware'=>'auth:api'],function (){
//uinapp 接口
Route
::
group
([
'middleware'
=>
'auth:api'
],
function
(){
Route
::
get
(
'huinapphome/devicedatainfo'
,
'UinappHomeController@devicedatainfo'
);
//设备详情
Route
::
get
(
'huinapphome/devicedatainfo
/{id}
'
,
'UinappHomeController@devicedatainfo'
);
//设备详情
});
// Fake APIs
Route
::
get
(
'/table/list'
,
function
()
{
...
...
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