Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-collect
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
17 deletions
+35
-17
.gitignore
+1
-0
app/Admin/Controllers/NoDoneTaskController.php
+33
-16
app/Admin/Extensions/Tools/ReceiveAction.php
+1
-1
No files found.
.gitignore
View file @
91d21562
/node_modules
/node_modules
/public/hot
/public/hot
/public/storage
/public/storage
/public/uploads
/storage/*.key
/storage/*.key
.env
.env
.env.backup
.env.backup
...
...
app/Admin/Controllers/NoDoneTaskController.php
View file @
91d21562
...
@@ -38,13 +38,19 @@ class NoDoneTaskController extends AdminController
...
@@ -38,13 +38,19 @@ class NoDoneTaskController extends AdminController
return
Grid
::
make
(
TasksReceive
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Grid
$grid
)
{
return
Grid
::
make
(
TasksReceive
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Grid
$grid
)
{
$user
=
Admin
::
user
();
$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
->
addTableClass
([
'table-text-center'
]);
//设置表格文字居中
$grid
->
withBorder
();
$grid
->
withBorder
();
$grid
->
model
()
->
where
(
'status'
,
0
);
// dd(trans('admin.view'));//查看
// dd(trans('admin.view'));//查看
$grid
->
model
()
->
orderBy
(
'created_at'
,
'desc'
);
// 在 display 回调中使用
// 在 display 回调中使用
$grid
->
column
(
'序号'
)
->
display
(
function
()
{
$grid
->
column
(
'序号'
)
->
display
(
function
()
{
return
$this
->
_index
+
1
;
return
$this
->
_index
+
1
;
...
@@ -283,13 +289,17 @@ class NoDoneTaskController extends AdminController
...
@@ -283,13 +289,17 @@ class NoDoneTaskController extends AdminController
]);
]);
}
}
$no
=
\App\Models\TasksReceive
::
query
()
$no
=
DB
::
table
(
'tasks_receives as a'
)
->
where
(
'id'
,
'!='
,
$id
)
->
leftJoin
(
'tasks as b'
,
'a.task_id'
,
'='
,
'b.id'
)
->
where
(
'user_id'
,
(
Admin
::
user
())
->
id
)
->
where
(
'a.id'
,
'!='
,
$id
)
->
where
(
'status'
,
0
)
->
where
(
'a.user_id'
,
(
Admin
::
user
())
->
id
)
->
first
();
->
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
)
{
if
(
$no
)
{
$url
=
'/noDone/'
.
$no
->
id
.
'/edit'
;
$url
=
'/noDone/'
.
$no
[
0
]
->
id
.
'/edit'
;
}
else
{
}
else
{
$url
=
'/noDone'
;
$url
=
'/noDone'
;
}
}
...
@@ -318,7 +328,7 @@ class NoDoneTaskController extends AdminController
...
@@ -318,7 +328,7 @@ class NoDoneTaskController extends AdminController
$form
->
display
(
'id'
);
$form
->
display
(
'id'
);
$form
->
display
(
'task.name'
,
'指标名称'
);
$form
->
display
(
'task.name'
,
'指标名称'
);
// $form->select('task.sort','优先级')->options([3 => '高', 2 => '中', 1 => '低']);
// $form->select('task.sort','优先级')->options([3 => '高', 2 => '中', 1 => '低']);
$form
->
display
(
'
area
'
,
'地区'
);
$form
->
display
(
'
task.city_id
'
,
'地区'
);
// $form->distpicker(['city_id'=>'市']);
// $form->distpicker(['city_id'=>'市']);
$form
->
display
(
'task.year'
,
'时间'
);
$form
->
display
(
'task.year'
,
'时间'
);
$form
->
display
(
'task.refer'
,
'参考信源'
);
$form
->
display
(
'task.refer'
,
'参考信源'
);
...
@@ -356,6 +366,7 @@ class NoDoneTaskController extends AdminController
...
@@ -356,6 +366,7 @@ class NoDoneTaskController extends AdminController
// });
// });
//保存后回调
//保存后回调
$form
->
saved
(
function
(
Form
$form
)
{
$form
->
saved
(
function
(
Form
$form
)
{
$start
=
'src="'
;
$start
=
'src="'
;
$end
=
'" alt'
;
$end
=
'" alt'
;
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
...
@@ -391,13 +402,19 @@ class NoDoneTaskController extends AdminController
...
@@ -391,13 +402,19 @@ class NoDoneTaskController extends AdminController
'receive_id'
=>
$this
->
id
,
'receive_id'
=>
$this
->
id
,
]);
]);
$no
=
\App\Models\TasksReceive
::
query
()
->
where
(
'id'
,
'!='
,
$this
->
id
)
$no
=
DB
::
table
(
'tasks_receives as a'
)
->
where
(
'user_id'
,
(
Admin
::
user
())
->
id
)
->
leftJoin
(
'tasks as b'
,
'a.task_id'
,
'='
,
'b.id'
)
->
where
(
'status'
,
0
)
->
where
(
'a.id'
,
'!='
,
$this
->
id
)
->
first
();
->
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
)
{
if
(
$no
)
{
$url
=
'/noDone/'
.
$no
->
id
.
'/edit'
;
$url
=
'/noDone/'
.
$no
[
0
]
->
id
.
'/edit'
;
}
else
{
}
else
{
$url
=
'/noDone'
;
$url
=
'/noDone'
;
}
}
...
...
app/Admin/Extensions/Tools/ReceiveAction.php
View file @
91d21562
...
@@ -67,7 +67,7 @@ class ReceiveAction extends RowAction
...
@@ -67,7 +67,7 @@ class ReceiveAction extends RowAction
'tas_id'
=>
$task
->
tas_id
,
'tas_id'
=>
$task
->
tas_id
,
'task_id'
=>
$id
,
'task_id'
=>
$id
,
'user_id'
=>
$user
->
id
,
'user_id'
=>
$user
->
id
,
'area'
=>
CityAreaService
::
getAreaName
(
$task
->
city_id
)
,
'area'
=>
$task
->
city_id
,
]);
]);
$task
->
num
-=
1
;
$task
->
num
-=
1
;
$task
->
save
();
$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