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
5b2f77a5
Commit
5b2f77a5
authored
Dec 18, 2020
by
冯超鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user用户工单列表
parent
68363ce4
Pipeline
#214
canceled with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
AlarmOrderController.php
app/Http/Controllers/AlarmOrderController.php
+24
-1
api.php
routes/api.php
+1
-0
No files found.
app/Http/Controllers/AlarmOrderController.php
View file @
5b2f77a5
...
@@ -29,6 +29,7 @@ class AlarmOrderController extends Controller
...
@@ -29,6 +29,7 @@ class AlarmOrderController extends Controller
if
(
$request
->
input
(
'isuser'
)
==
'user'
){
if
(
$request
->
input
(
'isuser'
)
==
'user'
){
$where
[]
=
[
'u.id'
,
'='
,
Auth
::
id
()];
$where
[]
=
[
'u.id'
,
'='
,
Auth
::
id
()];
print_r
(
explode
(
','
,
$request
->
input
(
'userstate'
)));
}
}
if
(
$request
->
input
(
'order_num'
))
{
if
(
$request
->
input
(
'order_num'
))
{
$where
[]
=
[
'alarm_order.order_num'
,
'='
,
$request
->
input
(
'order_num'
)];
$where
[]
=
[
'alarm_order.order_num'
,
'='
,
$request
->
input
(
'order_num'
)];
...
@@ -66,8 +67,10 @@ class AlarmOrderController extends Controller
...
@@ -66,8 +67,10 @@ class AlarmOrderController extends Controller
->
limit
(
$limit
)
->
limit
(
$limit
)
->
get
()
->
toArray
();
->
get
()
->
toArray
();
$count
=
AlarmOrder
::
leftjoin
(
'reportpolice AS r'
,
'r.id'
,
'='
,
'alarm_order.reportpolice_id'
)
$count
=
AlarmOrder
::
leftjoin
(
'reportpolice AS r'
,
'r.id'
,
'='
,
'alarm_order.reportpolice_id'
)
->
leftjoin
(
'users AS u'
,
'alarm_order.user_id'
,
'='
,
'u.id'
)
->
whereBetween
(
'alarm_order.created_at'
,
$whereBetween
)
->
whereBetween
(
'alarm_order.created_at'
,
$whereBetween
)
->
where
(
$where
)
->
count
();
->
where
(
$where
)
->
count
();
$meta
=
[
$meta
=
[
'count'
=>
$count
,
'count'
=>
$count
,
'current_page'
=>
$request
->
input
(
'page'
),
'current_page'
=>
$request
->
input
(
'page'
),
...
@@ -77,6 +80,26 @@ class AlarmOrderController extends Controller
...
@@ -77,6 +80,26 @@ class AlarmOrderController extends Controller
}
}
public
function
userworklist
(
Request
$request
){
$orders
=
AlarmOrder
::
selectRaw
(
'
FROM_UNIXTIME(r.starttime) AS start_time,
FROM_UNIXTIME(r.endtime) AS end_time,
alarm_order.*,
r.devicenumber, r.concentration, r.location, r.policestatus, r.shutoff_status,
d.devicecoord, d.username,t.tname,
u.name, u.phone_number,
s.status_name
'
)
->
leftjoin
(
'reportpolice AS r'
,
'r.id'
,
'='
,
'alarm_order.reportpolice_id'
)
->
leftjoin
(
'device AS d'
,
'd.id'
,
'='
,
'alarm_order.device_id'
)
->
leftjoin
(
'users AS u'
,
'alarm_order.user_id'
,
'='
,
'u.id'
)
->
leftjoin
(
'status AS s'
,
's.id'
,
'='
,
'alarm_order.reportpolice_id'
)
->
leftjoin
(
'device_type AS t'
,
'r.policestatus'
,
'='
,
't.tid'
)
->
whereIn
(
'alarm_order.state'
,
explode
(
','
,
$request
->
input
(
'userstate'
)))
->
where
(
'u.id'
,
'='
,
Auth
::
id
())
->
get
()
->
toArray
();
return
$this
->
jsonSuccessData
(
$orders
);
}
/**
/**
* Store a newly created resource in storage.
* Store a newly created resource in storage.
*
*
...
...
routes/api.php
View file @
5b2f77a5
...
@@ -56,6 +56,7 @@ Route::group(['middleware' => 'auth:api'], function () {
...
@@ -56,6 +56,7 @@ Route::group(['middleware' => 'auth:api'], function () {
Route
::
get
(
'alarm_order/user'
,
'AlarmOrderController@getUserInfo'
);
// 获取派单人员
Route
::
get
(
'alarm_order/user'
,
'AlarmOrderController@getUserInfo'
);
// 获取派单人员
Route
::
get
(
'alarm_order/show'
,
'AlarmOrderController@show'
);
// 工单详情
Route
::
get
(
'alarm_order/show'
,
'AlarmOrderController@show'
);
// 工单详情
Route
::
get
(
'alarm_order/order_in'
,
'AlarmOrderController@orderin'
);
// 获取当前订单为第几步
Route
::
get
(
'alarm_order/order_in'
,
'AlarmOrderController@orderin'
);
// 获取当前订单为第几步
Route
::
get
(
'alarm_order/userworklist'
,
'AlarmOrderController@userworklist'
);
// 获取当前订单为第几步
});
});
...
...
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