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
6ffa00d3
Commit
6ffa00d3
authored
Sep 12, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
压缩图片
parent
d23c7620
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
route.php
application/route.php
+1
-0
JobTask.php
application/task/controller/JobTask.php
+17
-0
No files found.
application/route.php
View file @
6ffa00d3
...
@@ -446,6 +446,7 @@ Route::group('task', [
...
@@ -446,6 +446,7 @@ Route::group('task', [
'updateShopTask'
=>
[
'task/JobTask/updateShopTask'
,
[
'method'
=>
'post | get'
]
],
//默认跟进
'updateShopTask'
=>
[
'task/JobTask/updateShopTask'
,
[
'method'
=>
'post | get'
]
],
//默认跟进
'updateShopImageIdTask'
=>
[
'task/JobTask/updateShopImageIdTask'
,
[
'method'
=>
'post | get'
]
],
//默认图片
'updateShopImageIdTask'
=>
[
'task/JobTask/updateShopImageIdTask'
,
[
'method'
=>
'post | get'
]
],
//默认图片
'image'
=>
[
'task/JobTask/image'
,
[
'method'
=>
'post | get'
]
],
//压缩图片
'updateShopAddress'
=>
[
'task/JobTask/updateShopAddress'
,
[
'method'
=>
'get'
]
],
//默认图片
'updateShopAddress'
=>
[
'task/JobTask/updateShopAddress'
,
[
'method'
=>
'get'
]
],
//默认图片
'push'
=>
[
'task/PushMessageTask/push'
,
[
'method'
=>
'get'
]
]
//推送
'push'
=>
[
'task/PushMessageTask/push'
,
[
'method'
=>
'get'
]
]
//推送
...
...
application/task/controller/JobTask.php
View file @
6ffa00d3
...
@@ -4,6 +4,8 @@ namespace app\task\controller;
...
@@ -4,6 +4,8 @@ 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\GImageDepot
;
use
think\Image
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
@@ -106,4 +108,18 @@ class JobTask
...
@@ -106,4 +108,18 @@ class JobTask
$this
->
gHouseModel
->
updateHouse
(
$houseArr
);
$this
->
gHouseModel
->
updateHouse
(
$houseArr
);
}
}
}
}
/**
* 压缩图片
*/
public
function
image
()
{
set_time_limit
(
0
);
// 取消脚本运行时间的超时上限
$depot
=
new
GImageDepot
();
$image_data
=
$depot
->
getImageDepotList
(
'img_name'
,
[],
1
,
500
);
$path
=
'./static/shop_image_depot/'
;
foreach
(
$image_data
as
$k
=>
$v
)
{
$image
=
\think\Image
::
open
(
$path
.
$v
[
'img_name'
]);
$image
->
thumb
(
960
,
960
)
->
save
(
$path
.
$v
[
'img_name'
]);
}
}
}
}
\ 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