Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
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
hujun
tl_estate
Commits
f7a17a64
Commit
f7a17a64
authored
Mar 25, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除无效视频
parent
90466652
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
GHousesVideo.php
application/model/GHousesVideo.php
+12
-0
route.php
application/route.php
+1
-0
JobTask.php
application/task/controller/JobTask.php
+32
-0
No files found.
application/model/GHousesVideo.php
View file @
f7a17a64
...
@@ -37,6 +37,18 @@ class GHousesVideo extends BaseModel
...
@@ -37,6 +37,18 @@ class GHousesVideo extends BaseModel
return
$num
;
return
$num
;
}
}
/**
* @param $data
* @param $where
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public
function
updateData
(
$data
,
$where
)
{
return
$this
->
db_
->
where
(
$where
)
->
update
(
$data
);
}
public
function
getHouseVideoList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
public
function
getHouseVideoList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
{
{
$order
=
"a.create_time desc"
;
$order
=
"a.create_time desc"
;
...
...
application/route.php
View file @
f7a17a64
...
@@ -609,6 +609,7 @@ Route::group('task', [
...
@@ -609,6 +609,7 @@ Route::group('task', [
'updateForActivityBegins'
=>
[
'task/UpdateActivityTask/updateForActivityBegins'
,
[
'method'
=>
'get'
]],
'updateForActivityBegins'
=>
[
'task/UpdateActivityTask/updateForActivityBegins'
,
[
'method'
=>
'get'
]],
'updateCouponExpired'
=>
[
'task/UpdateCouponTask/updateCouponExpired'
,
[
'method'
=>
'get'
]],
//超过有效期的券改过期
'updateCouponExpired'
=>
[
'task/UpdateCouponTask/updateCouponExpired'
,
[
'method'
=>
'get'
]],
//超过有效期的券改过期
'delHouseVideo'
=>
[
'task/JobTask/delHouseVideo'
,
[
'method'
=>
'get'
]],
//删除无效视频
]);
]);
Route
::
group
(
'broker'
,
[
Route
::
group
(
'broker'
,
[
...
...
application/task/controller/JobTask.php
View file @
f7a17a64
...
@@ -5,6 +5,7 @@ namespace app\task\controller;
...
@@ -5,6 +5,7 @@ namespace app\task\controller;
use
app\index\service\ImageDepotService
;
use
app\index\service\ImageDepotService
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesExt
;
use
app\model\GHousesExt
;
use
app\model\GHousesVideo
;
use
app\model\GImageDepot
;
use
app\model\GImageDepot
;
use
app\model\GLandlordPhone
;
use
app\model\GLandlordPhone
;
use
think\Image
;
use
think\Image
;
...
@@ -188,4 +189,34 @@ class JobTask
...
@@ -188,4 +189,34 @@ class JobTask
unset
(
$save_data
);
unset
(
$save_data
);
}
}
}
}
/**
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public
function
delHouseVideo
()
{
set_time_limit
(
0
);
$m_house_video
=
new
GHousesVideo
();
$where
[
'is_del'
]
=
1
;
$total
=
$m_house_video
->
getTotal
(
$where
);
$pageSize
=
200
;
$pageTotal
=
ceil
(
$total
/
$pageSize
);
$path
=
ROOT_PATH
.
'public/resource/lib/Attachments/video/'
;
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
$data
=
$m_house_video
->
getList
(
$pageNo
,
$pageSize
,
''
,
'id,video_name'
,
$where
);
foreach
(
$data
as
$k
=>
$v
)
{
$del_file
=
$path
.
$v
[
'video_name'
];
@
unlink
(
$del_file
);
if
(
!
file_exists
(
$del_file
))
{
$m_house_video
->
updateData
([
'is_del'
=>
2
],
[
'id'
=>
$v
[
'id'
]]);
}
}
}
return
;
}
}
}
\ No newline at end of file
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