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
9c757215
Commit
9c757215
authored
Jan 24, 2024
by
汪伟伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片 地址 和base64问题
parent
d11cc855
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
53 additions
and
13 deletions
+53
-13
app/Admin/Controllers/AlreadyApproveController.php
+11
-3
app/Admin/Controllers/AlreadyDoneTaskController.php
+9
-4
app/Admin/Controllers/NoDoneTaskController.php
+9
-2
app/Admin/Controllers/TaskController.php
+13
-2
app/Admin/Controllers/TasksApproveController.php
+4
-0
app/Admin/Extensions/Tools/PassAction.php
+1
-0
app/Admin/Forms/MsgSetting.php
+1
-0
app/Models/TasksApprove.php
+1
-0
app/Models/TasksCollect.php
+1
-0
database/migrations/2024_01_17_170122_create_tasks_collects_table.php
+2
-1
resources/views/admin/check.blade.php
+1
-1
No files found.
app/Admin/Controllers/AlreadyApproveController.php
View file @
9c757215
...
@@ -26,7 +26,7 @@ class AlreadyApproveController extends AdminController
...
@@ -26,7 +26,7 @@ class AlreadyApproveController extends AdminController
$grid
->
addTableClass
([
'table-text-center'
]);
//设置表格文字居中
$grid
->
addTableClass
([
'table-text-center'
]);
//设置表格文字居中
$grid
->
model
()
->
where
(
'status'
,
'>'
,
0
)
$grid
->
model
()
->
where
(
'status'
,
'>'
,
0
)
->
orderBy
(
'
updated_at
'
,
'desc'
)
->
orderBy
(
'
time
'
,
'desc'
)
->
orderBy
(
'task_id'
,
'desc'
);
->
orderBy
(
'task_id'
,
'desc'
);
...
@@ -93,7 +93,7 @@ class AlreadyApproveController extends AdminController
...
@@ -93,7 +93,7 @@ class AlreadyApproveController extends AdminController
*/
*/
protected
function
detail
(
$id
)
protected
function
detail
(
$id
)
{
{
return
Show
::
make
(
$id
,
TasksApprove
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Show
$show
)
{
return
Show
::
make
(
$id
,
TasksApprove
::
with
([
'task'
,
'collects'
,
'user'
]),
function
(
Show
$show
)
use
(
$id
)
{
$show
->
field
(
'user.name'
,
'用户'
);
$show
->
field
(
'user.name'
,
'用户'
);
$show
->
field
(
'task.name'
,
'指标名称'
);
$show
->
field
(
'task.name'
,
'指标名称'
);
...
@@ -107,7 +107,15 @@ class AlreadyApproveController extends AdminController
...
@@ -107,7 +107,15 @@ class AlreadyApproveController extends AdminController
$show
->
field
(
'collects.value'
,
'指标值'
);
$show
->
field
(
'collects.value'
,
'指标值'
);
$show
->
field
(
'collects.reality_refer'
,
'实际信源'
);
$show
->
field
(
'collects.reality_refer'
,
'实际信源'
);
$show
->
field
(
'collects.refer_level'
,
'信源等级'
);
$show
->
field
(
'collects.refer_level'
,
'信源等级'
);
$show
->
field
(
'collects.net_img'
,
'截图链接'
)
->
unescape
();
$ap
=
\App\Models\TasksApprove
::
query
()
->
find
(
$id
);
if
(
$ap
->
collects
->
images
){
//是链接
$show
->
field
(
'collects.images'
,
'截图链接'
)
->
image
();
}
else
{
$show
->
field
(
'collects.net_img'
,
'截图链接'
)
->
unescape
();
//不 转义html内容
}
$show
->
field
(
'status'
,
'状态'
)
->
as
(
function
(
$statusValue
)
{
$show
->
field
(
'status'
,
'状态'
)
->
as
(
function
(
$statusValue
)
{
// 获取当前行的其他字段
// 获取当前行的其他字段
...
...
app/Admin/Controllers/AlreadyDoneTaskController.php
View file @
9c757215
...
@@ -135,10 +135,9 @@ class AlreadyDoneTaskController extends AdminController
...
@@ -135,10 +135,9 @@ class AlreadyDoneTaskController extends AdminController
// $show->field('collects.net_img', '网页截图')->unescape();
// $show->field('collects.net_img', '网页截图')->unescape();
$res
=
\App\Models\TasksReceive
::
query
()
->
find
(
$id
);
$res
=
\App\Models\TasksReceive
::
query
()
->
find
(
$id
);
$img
=
explode
(
','
,
$res
->
collects
->
net_img
);
if
(
filter_var
(
$img
[
0
],
FILTER_VALIDATE_URL
)
!==
false
){
//是链接
if
(
$res
->
collects
->
images
){
//是链接
$show
->
field
(
'collects.
net_img
'
,
'网页截图'
)
->
image
();
$show
->
field
(
'collects.
images
'
,
'网页截图'
)
->
image
();
}
else
{
}
else
{
$show
->
field
(
'collects.net_img'
,
'网页截图'
)
->
unescape
();
//不 转义html内容
$show
->
field
(
'collects.net_img'
,
'网页截图'
)
->
unescape
();
//不 转义html内容
}
}
...
@@ -213,7 +212,13 @@ class AlreadyDoneTaskController extends AdminController
...
@@ -213,7 +212,13 @@ class AlreadyDoneTaskController extends AdminController
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
preg_match_all
(
$pattern
,
$form
->
input
(
'collects.net_img'
),
$matches
);
preg_match_all
(
$pattern
,
$form
->
input
(
'collects.net_img'
),
$matches
);
$images
=
implode
(
','
,
$matches
[
1
]);
$images
=
implode
(
','
,
$matches
[
1
]);
if
(
$images
)
TasksCollect
::
query
()
->
where
(
'receive_id'
,
$this
->
id
)
->
update
([
'net_img'
=>
$images
]);
//更新
foreach
(
$matches
[
1
]
as
$v
)
{
if
(
!
(
filter_var
(
$v
,
FILTER_VALIDATE_URL
)
!==
false
))
{
//不是链接
$images
=
null
;
break
;
}
}
TasksCollect
::
query
()
->
where
(
'receive_id'
,
$this
->
id
)
->
update
([
'images'
=>
$images
]);
//更新
});
});
$form
->
disableDeleteButton
();
$form
->
disableDeleteButton
();
...
...
app/Admin/Controllers/NoDoneTaskController.php
View file @
9c757215
...
@@ -221,13 +221,18 @@ class NoDoneTaskController extends AdminController
...
@@ -221,13 +221,18 @@ 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
)
.
'/'
;
preg_match_all
(
$pattern
,
$form
->
input
(
'collects.net_img'
),
$matches
);
preg_match_all
(
$pattern
,
$form
->
input
(
'collects.net_img'
),
$matches
);
$images
=
implode
(
','
,
$matches
[
1
]);
$images
=
implode
(
','
,
$matches
[
1
]);
if
(
$images
)
TasksCollect
::
query
()
->
where
(
'receive_id'
,
$this
->
id
)
->
update
([
'net_img'
=>
$images
]);
//更新
foreach
(
$matches
[
1
]
as
$v
)
{
if
(
!
(
filter_var
(
$v
,
FILTER_VALIDATE_URL
)
!==
false
))
{
//不是链接
$images
=
null
;
break
;
}
}
TasksCollect
::
query
()
->
where
(
'receive_id'
,
$this
->
id
)
->
update
([
'images'
=>
$images
]);
//更新
if
(
$this
->
status
==
0
)
{
if
(
$this
->
status
==
0
)
{
// dd($this->id);
// dd($this->id);
...
@@ -256,6 +261,8 @@ class NoDoneTaskController extends AdminController
...
@@ -256,6 +261,8 @@ class NoDoneTaskController extends AdminController
// var_dump($url);
// var_dump($url);
return
$form
->
response
()
->
success
(
'保存成功'
)
->
redirect
(
$url
);
return
$form
->
response
()
->
success
(
'保存成功'
)
->
redirect
(
$url
);
}
}
});
});
$form
->
disableDeleteButton
();
$form
->
disableDeleteButton
();
...
...
app/Admin/Controllers/TaskController.php
View file @
9c757215
...
@@ -266,7 +266,7 @@ class TaskController extends AdminController
...
@@ -266,7 +266,7 @@ class TaskController extends AdminController
})
->
value
(
2024
)
->
required
();
})
->
value
(
2024
)
->
required
();
$form
->
decimal
(
'price'
,
'单价'
);
$form
->
decimal
(
'price'
,
'单价'
);
$form
->
text
(
'refer'
,
'参考信源'
)
->
required
();
$form
->
text
(
'refer'
,
'参考信源'
)
->
required
();
$form
->
editor
(
'guide'
,
'收集指南'
)
->
required
();
$form
->
editor
(
'guide'
,
'收集指南'
)
->
options
([
'pasteImage'
=>
false
])
->
required
();
$form
->
hidden
(
'images'
);
$form
->
hidden
(
'images'
);
// $form->text('status');
// $form->text('status');
...
@@ -281,7 +281,12 @@ class TaskController extends AdminController
...
@@ -281,7 +281,12 @@ class TaskController extends AdminController
$end
=
'" alt'
;
$end
=
'" alt'
;
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
preg_match_all
(
$pattern
,
$form
->
input
(
'guide'
),
$matches
);
preg_match_all
(
$pattern
,
$form
->
input
(
'guide'
),
$matches
);
foreach
(
$matches
[
1
]
as
$v
)
{
if
(
!
(
filter_var
(
$v
,
FILTER_VALIDATE_URL
)
!==
false
))
{
//不是链接
$form
->
images
=
null
;
return
;
}
}
$images
=
implode
(
','
,
$matches
[
1
]);
$images
=
implode
(
','
,
$matches
[
1
]);
$form
->
images
=
$images
;
$form
->
images
=
$images
;
...
@@ -332,6 +337,12 @@ class TaskController extends AdminController
...
@@ -332,6 +337,12 @@ class TaskController extends AdminController
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
$pattern
=
'/'
.
preg_quote
(
$start
)
.
'(.*?)'
.
preg_quote
(
$end
)
.
'/'
;
preg_match_all
(
$pattern
,
$param
[
'guide'
],
$matches
);
preg_match_all
(
$pattern
,
$param
[
'guide'
],
$matches
);
$images
=
implode
(
','
,
$matches
[
1
]);
$images
=
implode
(
','
,
$matches
[
1
]);
foreach
(
$matches
[
1
]
as
$v
)
{
if
(
!
(
filter_var
(
$v
,
FILTER_VALIDATE_URL
)
!==
false
))
{
//是链接
$images
=
null
;
break
;
}
}
$query
=
\App\Models\Task
::
query
();
$query
=
\App\Models\Task
::
query
();
foreach
(
$param
[
'city_id'
]
as
$city
)
{
foreach
(
$param
[
'city_id'
]
as
$city
)
{
...
...
app/Admin/Controllers/TasksApproveController.php
View file @
9c757215
...
@@ -235,6 +235,7 @@ class TasksApproveController extends AdminController
...
@@ -235,6 +235,7 @@ class TasksApproveController extends AdminController
$approve
=
\App\Models\TasksApprove
::
query
()
->
where
(
'receive_id'
,
$receiveId
)
->
first
();
$approve
=
\App\Models\TasksApprove
::
query
()
->
where
(
'receive_id'
,
$receiveId
)
->
first
();
TasksReceive
::
query
()
->
where
(
'id'
,
$receiveId
)
->
update
([
'status'
=>
3
]);
//3:审核通过但未结算的任务
TasksReceive
::
query
()
->
where
(
'id'
,
$receiveId
)
->
update
([
'status'
=>
3
]);
//3:审核通过但未结算的任务
$approve
->
status
=
2
;
//审核通过
$approve
->
status
=
2
;
//审核通过
$approve
->
time
=
date
(
'Y-m-d H:i:s'
);
$approve
->
save
();
$approve
->
save
();
// dd($id,$user->id);
// dd($id,$user->id);
...
@@ -251,6 +252,7 @@ class TasksApproveController extends AdminController
...
@@ -251,6 +252,7 @@ class TasksApproveController extends AdminController
TasksReceive
::
query
()
->
where
(
'id'
,
$receiveId
)
->
update
([
'status'
=>
2
]);
//2:审核不通过的任务
TasksReceive
::
query
()
->
where
(
'id'
,
$receiveId
)
->
update
([
'status'
=>
2
]);
//2:审核不通过的任务
$approve
->
status
=
1
;
//审核不通过
$approve
->
status
=
1
;
//审核不通过
$approve
->
msg
=
$msg
;
$approve
->
msg
=
$msg
;
$approve
->
time
=
date
(
'Y-m-d H:i:s'
);
$approve
->
save
();
$approve
->
save
();
return
true
;
return
true
;
}
}
...
@@ -263,6 +265,7 @@ class TasksApproveController extends AdminController
...
@@ -263,6 +265,7 @@ class TasksApproveController extends AdminController
$approve
=
\App\Models\TasksApprove
::
query
()
->
where
(
'receive_id'
,
$receive
[
'id'
])
->
first
();
$approve
=
\App\Models\TasksApprove
::
query
()
->
where
(
'receive_id'
,
$receive
[
'id'
])
->
first
();
TasksReceive
::
query
()
->
where
(
'id'
,
$receive
[
'id'
])
->
update
([
'status'
=>
3
]);
//3:审核通过但未结算的任务
TasksReceive
::
query
()
->
where
(
'id'
,
$receive
[
'id'
])
->
update
([
'status'
=>
3
]);
//3:审核通过但未结算的任务
$approve
->
status
=
2
;
//审核通过
$approve
->
status
=
2
;
//审核通过
$approve
->
time
=
date
(
'Y-m-d H:i:s'
);
$approve
->
save
();
$approve
->
save
();
}
}
}
}
...
@@ -281,6 +284,7 @@ class TasksApproveController extends AdminController
...
@@ -281,6 +284,7 @@ class TasksApproveController extends AdminController
TasksReceive
::
query
()
->
where
(
'id'
,
$receive
[
'id'
])
->
update
([
'status'
=>
2
]);
//2:审核不通过的任务
TasksReceive
::
query
()
->
where
(
'id'
,
$receive
[
'id'
])
->
update
([
'status'
=>
2
]);
//2:审核不通过的任务
$approve
->
status
=
1
;
//审核不通过
$approve
->
status
=
1
;
//审核不通过
$approve
->
msg
=
$msg
;
$approve
->
msg
=
$msg
;
$approve
->
time
=
date
(
'Y-m-d H:i:s'
);
$approve
->
save
();
$approve
->
save
();
}
}
}
}
...
...
app/Admin/Extensions/Tools/PassAction.php
View file @
9c757215
...
@@ -53,6 +53,7 @@ class PassAction extends RowAction
...
@@ -53,6 +53,7 @@ class PassAction extends RowAction
$approve
=
TasksApprove
::
query
()
->
find
(
$id
);
$approve
=
TasksApprove
::
query
()
->
find
(
$id
);
TasksReceive
::
query
()
->
where
(
'id'
,
$approve
->
receive_id
)
->
update
([
'status'
=>
3
]);
//3:审核通过但未结算的任务
TasksReceive
::
query
()
->
where
(
'id'
,
$approve
->
receive_id
)
->
update
([
'status'
=>
3
]);
//3:审核通过但未结算的任务
$approve
->
status
=
2
;
//审核通过
$approve
->
status
=
2
;
//审核通过
$approve
->
time
=
date
(
'Y-m-d H:i:s'
);
$approve
->
save
();
$approve
->
save
();
// dd($id,$user->id);
// dd($id,$user->id);
...
...
app/Admin/Forms/MsgSetting.php
View file @
9c757215
...
@@ -29,6 +29,7 @@ class MsgSetting extends Form implements LazyRenderable
...
@@ -29,6 +29,7 @@ class MsgSetting extends Form implements LazyRenderable
TasksReceive
::
query
()
->
where
(
'id'
,
$approve
->
receive_id
)
->
update
([
'status'
=>
2
]);
//2:审核不通过的任务
TasksReceive
::
query
()
->
where
(
'id'
,
$approve
->
receive_id
)
->
update
([
'status'
=>
2
]);
//2:审核不通过的任务
$approve
->
status
=
1
;
//审核不通过
$approve
->
status
=
1
;
//审核不通过
$approve
->
msg
=
$msg
;
$approve
->
msg
=
$msg
;
$approve
->
time
=
date
(
'Y-m-d H:i:s'
);
$approve
->
save
();
$approve
->
save
();
return
$this
return
$this
...
...
app/Models/TasksApprove.php
View file @
9c757215
...
@@ -30,6 +30,7 @@ class TasksApprove extends Model
...
@@ -30,6 +30,7 @@ class TasksApprove extends Model
'receive_id'
,
'receive_id'
,
'status'
,
'status'
,
'msg'
,
'msg'
,
'time'
,
'created_at'
,
'created_at'
,
'updated_at'
,
'updated_at'
,
];
];
...
...
app/Models/TasksCollect.php
View file @
9c757215
...
@@ -25,6 +25,7 @@ class TasksCollect extends Model
...
@@ -25,6 +25,7 @@ class TasksCollect extends Model
'reality_refer'
,
'reality_refer'
,
'refer_level'
,
'refer_level'
,
'net_img'
,
'net_img'
,
'images'
,
'is_find'
,
'is_find'
,
'remark'
,
'remark'
,
'created_at'
,
'created_at'
,
...
...
database/migrations/2024_01_17_170122_create_tasks_collects_table.php
View file @
9c757215
...
@@ -21,7 +21,8 @@ class CreateTasksCollectsTable extends Migration
...
@@ -21,7 +21,8 @@ class CreateTasksCollectsTable extends Migration
$table
->
string
(
'value'
)
->
default
(
''
)
->
comment
(
'指标值'
);
$table
->
string
(
'value'
)
->
default
(
''
)
->
comment
(
'指标值'
);
$table
->
string
(
'reality_refer'
)
->
default
(
''
)
->
comment
(
'实际信源'
);
$table
->
string
(
'reality_refer'
)
->
default
(
''
)
->
comment
(
'实际信源'
);
$table
->
string
(
'refer_level'
)
->
nullable
()
->
comment
(
'信源等级'
);
$table
->
string
(
'refer_level'
)
->
nullable
()
->
comment
(
'信源等级'
);
$table
->
longText
(
'net_img'
)
->
nullable
()
->
comment
(
'网页截图'
);
$table
->
longText
(
'net_img'
)
->
nullable
()
->
comment
(
'网页截图富文本'
);
$table
->
longText
(
'images'
)
->
nullable
()
->
comment
(
'图片'
);
$table
->
unsignedTinyInteger
(
'is_find'
)
->
default
(
'0'
)
->
comment
(
'是否找到'
);
$table
->
unsignedTinyInteger
(
'is_find'
)
->
default
(
'0'
)
->
comment
(
'是否找到'
);
$table
->
string
(
'remark'
)
->
nullable
()
->
comment
(
'备注信息'
);
$table
->
string
(
'remark'
)
->
nullable
()
->
comment
(
'备注信息'
);
$table
->
timestamps
();
$table
->
timestamps
();
...
...
resources/views/admin/check.blade.php
View file @
9c757215
...
@@ -151,7 +151,7 @@
...
@@ -151,7 +151,7 @@
</td>
</td>
<td>
{
{$rec['collects']['refer_level']}
}
</td>
<td>
{
{$rec['collects']['refer_level']}
}
</td>
<td>
<td>
@foreach(explode(',',
$rec['collects']['
net_img
']
) as
$url
)
@foreach(explode(',',
$rec['collects']['
images
']
) as
$url
)
@if(filter_var(
$url
, FILTER_VALIDATE_URL) !== false)
@if(filter_var(
$url
, FILTER_VALIDATE_URL) !== false)
<a target="
_blank
" href=
{
{$url}
}
>点击查看</a><br>
<a target="
_blank
" href=
{
{$url}
}
>点击查看</a><br>
...
...
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