Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
data-collect
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
汪伟伟
data-collect
Commits
91d21562
Commit
91d21562
authored
Feb 02, 2024
by
汪伟伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成 按照 名称 时间 地区 跳转
parent
74eee49d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
17 deletions
+35
-17
.gitignore
.gitignore
+1
-0
app/Admin/Controllers/NoDoneTaskController.php
app/Admin/Controllers/NoDoneTaskController.php
+33
-16
app/Admin/Extensions/Tools/ReceiveAction.php
app/Admin/Extensions/Tools/ReceiveAction.php
+1
-1
No files found.
.gitignore
View file @
91d21562
/node_modules
/public/hot
/public/storage
/public/uploads
/storage/*.key
.env
.env.backup
...
...
app/Admin/Controllers/NoDoneTaskController.php
View file @
91d21562
...
...
@@ -38,13 +38,19 @@ class NoDoneTaskController extends AdminController
return
Grid
::
make
(
TasksReceive
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Grid
$grid
)
{
$user
=
Admin
::
user
();
$user
->
is_admin
==
0
&&
$grid
->
model
()
->
where
(
'user_id'
,
$user
->
id
);
$grid
->
model
()
->
select
(
'tasks_receives.*'
)
->
join
(
'tasks as b'
,
'b.id'
,
'='
,
'tasks_receives.task_id'
)
->
where
(
'tasks_receives.user_id'
,
$user
->
id
)
->
where
(
'tasks_receives.status'
,
0
)
->
orderByRaw
(
'b.city_id desc,b.year desc'
)
// ->orderBy('b.year','desc')
;
$grid
->
addTableClass
([
'table-text-center'
]);
//设置表格文字居中
$grid
->
withBorder
();
$grid
->
model
()
->
where
(
'status'
,
0
);
// dd(trans('admin.view'));//查看
$grid
->
model
()
->
orderBy
(
'created_at'
,
'desc'
);
// 在 display 回调中使用
$grid
->
column
(
'序号'
)
->
display
(
function
()
{
return
$this
->
_index
+
1
;
...
...
@@ -283,13 +289,17 @@ class NoDoneTaskController extends AdminController
]);
}
$no
=
\App\Models\TasksReceive
::
query
()
->
where
(
'id'
,
'!='
,
$id
)
->
where
(
'user_id'
,
(
Admin
::
user
())
->
id
)
->
where
(
'status'
,
0
)
->
first
();
$no
=
DB
::
table
(
'tasks_receives as a'
)
->
leftJoin
(
'tasks as b'
,
'a.task_id'
,
'='
,
'b.id'
)
->
where
(
'a.id'
,
'!='
,
$id
)
->
where
(
'a.user_id'
,
(
Admin
::
user
())
->
id
)
->
where
(
'a.status'
,
0
)
->
orderBy
(
'b.city_id'
,
'desc'
)
->
orderBy
(
'b.year'
,
'desc'
)
->
get
([
'a.id'
,
'b.name'
,
'b.city_id'
,
'b.year'
])
->
toArray
();
if
(
$no
)
{
$url
=
'/noDone/'
.
$no
->
id
.
'/edit'
;
$url
=
'/noDone/'
.
$no
[
0
]
->
id
.
'/edit'
;
}
else
{
$url
=
'/noDone'
;
}
...
...
@@ -318,7 +328,7 @@ class NoDoneTaskController extends AdminController
$form
->
display
(
'id'
);
$form
->
display
(
'task.name'
,
'指标名称'
);
// $form->select('task.sort','优先级')->options([3 => '高', 2 => '中', 1 => '低']);
$form
->
display
(
'
area
'
,
'地区'
);
$form
->
display
(
'
task.city_id
'
,
'地区'
);
// $form->distpicker(['city_id'=>'市']);
$form
->
display
(
'task.year'
,
'时间'
);
$form
->
display
(
'task.refer'
,
'参考信源'
);
...
...
@@ -356,6 +366,7 @@ class NoDoneTaskController extends AdminController
// });
//保存后回调
$form
->
saved
(
function
(
Form
$form
)
{
$start
=
'src="'
;
$end
=
'" alt'
;
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
...
...
@@ -391,13 +402,19 @@ class NoDoneTaskController extends AdminController
'receive_id'
=>
$this
->
id
,
]);
$no
=
\App\Models\TasksReceive
::
query
()
->
where
(
'id'
,
'!='
,
$this
->
id
)
->
where
(
'user_id'
,
(
Admin
::
user
())
->
id
)
->
where
(
'status'
,
0
)
->
first
();
$no
=
DB
::
table
(
'tasks_receives as a'
)
->
leftJoin
(
'tasks as b'
,
'a.task_id'
,
'='
,
'b.id'
)
->
where
(
'a.id'
,
'!='
,
$this
->
id
)
->
where
(
'a.user_id'
,
(
Admin
::
user
())
->
id
)
->
where
(
'a.status'
,
0
)
->
orderBy
(
'b.city_id'
,
'desc'
)
->
orderBy
(
'b.year'
,
'desc'
)
->
get
([
'a.id'
,
'b.name'
,
'b.city_id'
,
'b.year'
])
->
toArray
();
// dd($no[0]->id,$no);
if
(
$no
)
{
$url
=
'/noDone/'
.
$no
->
id
.
'/edit'
;
$url
=
'/noDone/'
.
$no
[
0
]
->
id
.
'/edit'
;
}
else
{
$url
=
'/noDone'
;
}
...
...
app/Admin/Extensions/Tools/ReceiveAction.php
View file @
91d21562
...
...
@@ -67,7 +67,7 @@ class ReceiveAction extends RowAction
'tas_id'
=>
$task
->
tas_id
,
'task_id'
=>
$id
,
'user_id'
=>
$user
->
id
,
'area'
=>
CityAreaService
::
getAreaName
(
$task
->
city_id
)
,
'area'
=>
$task
->
city_id
,
]);
$task
->
num
-=
1
;
$task
->
save
();
...
...
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