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
23f5a4df
Commit
23f5a4df
authored
Dec 16, 2020
by
冯超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp 协议更新
parent
6c421d6a
Pipeline
#201
failed with stage
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
AlarmOrderController.php
app/Http/Controllers/AlarmOrderController.php
+5
-0
ZehongTcpController.php
app/Http/Controllers/Auth/ZehongTcpController.php
+3
-8
No files found.
app/Http/Controllers/AlarmOrderController.php
View file @
23f5a4df
...
@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
...
@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
use
App\Models\AlarmOrder
;
use
App\Models\AlarmOrder
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\DB
;
use
App\Models\AlarmOrderSchedule
;
use
App\Models\AlarmOrderSchedule
;
use
Illuminate\Support\Facades\Auth
;
class
AlarmOrderController
extends
Controller
class
AlarmOrderController
extends
Controller
{
{
...
@@ -21,6 +22,9 @@ class AlarmOrderController extends Controller
...
@@ -21,6 +22,9 @@ class AlarmOrderController extends Controller
if
(
$this
->
isadmin
())
{
if
(
$this
->
isadmin
())
{
$limit
=
20
;
$limit
=
20
;
$offset
=
$limit
*
(
$request
->
input
(
'page'
)
-
1
);
$offset
=
$limit
*
(
$request
->
input
(
'page'
)
-
1
);
if
(
$request
->
input
(
'isuser'
)
==
'user'
){
$isuser
=
[
'u.id'
,
'='
,
Auth
::
id
()];
}
$orders
=
AlarmOrder
::
selectRaw
(
'
$orders
=
AlarmOrder
::
selectRaw
(
'
FROM_UNIXTIME(r.starttime) AS start_time,
FROM_UNIXTIME(r.starttime) AS start_time,
FROM_UNIXTIME(r.endtime) AS end_time,
FROM_UNIXTIME(r.endtime) AS end_time,
...
@@ -35,6 +39,7 @@ class AlarmOrderController extends Controller
...
@@ -35,6 +39,7 @@ class AlarmOrderController extends Controller
->
leftjoin
(
'users AS u'
,
'alarm_order.user_id'
,
'='
,
'u.id'
)
->
leftjoin
(
'users AS u'
,
'alarm_order.user_id'
,
'='
,
'u.id'
)
->
leftjoin
(
'status AS s'
,
's.id'
,
'='
,
'alarm_order.reportpolice_id'
)
->
leftjoin
(
'status AS s'
,
's.id'
,
'='
,
'alarm_order.reportpolice_id'
)
->
offset
(
$offset
)
->
offset
(
$offset
)
->
where
(
$isuser
)
->
limit
(
$limit
)
->
limit
(
$limit
)
->
get
()
->
toArray
();
->
get
()
->
toArray
();
return
$this
->
jsonSuccessData
(
$orders
);
return
$this
->
jsonSuccessData
(
$orders
);
...
...
app/Http/Controllers/Auth/ZehongTcpController.php
View file @
23f5a4df
...
@@ -39,13 +39,8 @@ class ZehongTcpController extends Controller
...
@@ -39,13 +39,8 @@ class ZehongTcpController extends Controller
if
(
$totcp
==
"暂无设备"
){
if
(
$totcp
==
"暂无设备"
){
return
$totcp
;
return
$totcp
;
}
}
if
(
$totcp
[
'nd'
]
<
999
){
$totcp
[
'nd'
]
=
'0'
.
$totcp
[
'nd'
];
$totcpdata
=
$totcp
[
'devicenum'
]
.
$totcp
[
'shutoff_status'
]
.
$devicechongqi
.
$devicezijian
;
}
if
(
$totcp
[
'nd'
]
<
99
){
$totcp
[
'nd'
]
=
'0'
.
$totcp
[
'nd'
];
}
$totcpdata
=
$totcp
[
'devicenum'
]
.
$totcp
[
'devicepolice'
]
.
$totcp
[
'nd'
]
.
$totcp
[
'shutoff_status'
]
.
$devicechongqi
.
$devicezijian
;
$crcdata
=
$this
->
getPrc
(
$totcpdata
);
$crcdata
=
$this
->
getPrc
(
$totcpdata
);
return
$totcpdata
.
$crcdata
;
return
$totcpdata
.
$crcdata
;
}
}
...
@@ -92,7 +87,7 @@ class ZehongTcpController extends Controller
...
@@ -92,7 +87,7 @@ class ZehongTcpController extends Controller
if
(
$data
!=
[]){
if
(
$data
!=
[]){
$datainfo
=
DB
::
table
(
'device'
)
$datainfo
=
DB
::
table
(
'device'
)
->
where
(
'devicenum'
,
'='
,
$data
[
'id'
])
->
where
(
'devicenum'
,
'='
,
$data
[
'id'
])
->
update
([
'nd'
=>
intval
(
$data
[
'np'
]),
'shutoff_status'
=>
$data
[
'famen'
],
'devicepolice'
=>
$data
[
'status'
]
==
0
?
'1'
:
$data
[
'status'
]]);
->
update
([
'nd'
=>
intval
(
$data
[
'np'
]),
'shutoff_status'
=>
$data
[
'famen'
],
'devicepolice'
=>
$data
[
'status'
]
==
0
?
'1'
:
$data
[
'status'
]
,
'update_time'
=>
time
()
]);
$todata
=
DB
::
table
(
'device'
)
$todata
=
DB
::
table
(
'device'
)
->
where
(
'devicenum'
,
'='
,
$data
[
'id'
])
->
where
(
'devicenum'
,
'='
,
$data
[
'id'
])
->
select
(
'devicenum'
,
'nd'
,
'shutoff_status'
,
'devicepolice'
)
->
select
(
'devicenum'
,
'nd'
,
'shutoff_status'
,
'devicepolice'
)
...
...
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