Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
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
chenchuanwen
my-yaf-project
Commits
2ce93bc2
Commit
2ce93bc2
authored
Aug 26, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goodsimage
parent
7c05c1dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
ImageUtil.php
application/library/Our/ImageUtil.php
+9
-5
No files found.
application/library/Our/ImageUtil.php
View file @
2ce93bc2
...
...
@@ -114,18 +114,22 @@ class ImageUtil {
* @return mixed|string 返回图片路径
*/
public
static
function
getGoodsImgUrl
(
$goodsImg
,
$type
=
240
){
if
(
!
in_array
(
$type
,
\Our\ArrayConst
::
goodsImageExt
)){
$type
=
240
;
}
// if(!in_array($type,\Our\ArrayConst::goodsImageExt)){
// $type = 240;
// }
if
(
empty
(
$goodsImg
))
{
$directory
=
\Our\ImageConst
::
defaultPath
;
$goodsImg
=
str_ireplace
(
'.'
,
'_'
.
$type
.
'.'
,
'default_goods_image.gif'
);
//$goodsImg = str_ireplace('.', '_' . $type . '.', 'default_goods_image.gif');
$goodsImg
.=
'default_goods_image.gif'
;
}
else
{
$storeId
=
substr
(
$goodsImg
,
0
,
strpos
(
$goodsImg
,
'_'
)
);
$directory
=
\Our\ImageConst
::
goods
.
$storeId
.
\Our\NameConst
::
slash
;
$goodsImg
=
str_ireplace
(
'.'
,
'_'
.
$type
.
'.'
,
$goodsImg
);
//$goodsImg = str_ireplace('.', '_' . $type . '.', $goodsImg);
//$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334';
}
$goodsImg
=
\Our\Common
::
getStaticFile
(
$goodsImg
,
$directory
);
$goodsImg
.=
'?x-oss-process=image/resize,m_pad,h_226,w_334'
;
return
$goodsImg
;
}
...
...
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