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
c5e24876
Commit
c5e24876
authored
Sep 04, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image
parent
fa9b3284
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
7 deletions
+15
-7
ImageConst.php
application/library/Our/ImageConst.php
+4
-0
CommentService.php
application/models/Business/Goods/CommentService.php
+2
-1
StoreService.php
application/models/Business/Store/StoreService.php
+1
-1
MemberCenterService.php
application/models/Business/User/MemberCenterService.php
+1
-1
SalespersonService.php
application/models/Business/User/SalespersonService.php
+2
-2
Store.php
application/models/DAO/Store.php
+5
-2
No files found.
application/library/Our/ImageConst.php
View file @
c5e24876
...
@@ -99,4 +99,8 @@ class ImageConst{
...
@@ -99,4 +99,8 @@ class ImageConst{
const
goodsDetailImgSize
=
750
;
const
goodsDetailImgSize
=
750
;
const
goodsCollectionImgSize
=
336
;
const
goodsCollectionImgSize
=
336
;
const
footPrintGoodsImgSize
=
216
;
const
footPrintGoodsImgSize
=
216
;
const
circleStoreLabel
=
124
;
const
commentCircleStoreLabel
=
48
;
const
storeQualificationImg
=
188
;
const
storeCollectionImg
=
112
;
}
}
application/models/Business/Goods/CommentService.php
View file @
c5e24876
...
@@ -61,7 +61,8 @@ class CommentServiceModel extends \Business\AbstractModel {
...
@@ -61,7 +61,8 @@ class CommentServiceModel extends \Business\AbstractModel {
$groupId
=
$comment
[
'goods_id'
];
$groupId
=
$comment
[
'goods_id'
];
}
}
$attr
=
\DAO\GoodsModel
::
getInstance
()
->
getFormatGoodsAttr
(
$comment
[
'goods_spec'
]);
$attr
=
\DAO\GoodsModel
::
getInstance
()
->
getFormatGoodsAttr
(
$comment
[
'goods_spec'
]);
list
(
$storeInfo
,
$storeLabel
)
=
\DAO\StoreModel
::
getInstance
()
->
get
(
$comment
[
'store_id'
]);
$storeInfo
=
\DAO\StoreModel
::
getInstance
()
->
get
(
$comment
[
'store_id'
],
false
);
$storeLabel
=
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$storeInfo
[
'store_label'
],
\Our\ImageConst
::
commentCircleStoreLabel
);
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$goodsDao
=
\DAO\GoodsModel
::
getInstance
();
$goods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsRedisModel
::
getInstance
(),
array
(
&
$goodsDao
,
'find'
),
array
(
array
(
'goods_id'
=>
$comment
[
'goods_id'
]),
'*'
),
\Our\ApiConst
::
oneHour
,
array
(
$comment
[
'goods_id'
]));
$goods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsRedisModel
::
getInstance
(),
array
(
&
$goodsDao
,
'find'
),
array
(
array
(
'goods_id'
=>
$comment
[
'goods_id'
]),
'*'
),
\Our\ApiConst
::
oneHour
,
array
(
$comment
[
'goods_id'
]));
return
array
(
'content'
=>
$comment
[
'content'
],
'addTime'
=>
$comment
[
'addtime'
],
'goodsName'
=>
$comment
[
'goods_name'
],
'goodsImage'
=>
\Our\ImageUtil
::
getGoodsImgUrl
(
$comment
[
'goods_image'
],
\Our\ImageConst
::
CommentDetailGoodsImgSize
),
'goodsAttr'
=>
$attr
,
'goodsPrice'
=>
(
int
)
$comment
[
'goods_pay_price'
],
'storeLabel'
=>
$storeLabel
,
'storeName'
=>
$storeInfo
[
'store_name'
],
'storeId'
=>
$comment
[
'store_id'
],
'goodsCommonId'
=>
$goodsCommonId
,
'groupId'
=>
$groupId
);
return
array
(
'content'
=>
$comment
[
'content'
],
'addTime'
=>
$comment
[
'addtime'
],
'goodsName'
=>
$comment
[
'goods_name'
],
'goodsImage'
=>
\Our\ImageUtil
::
getGoodsImgUrl
(
$comment
[
'goods_image'
],
\Our\ImageConst
::
CommentDetailGoodsImgSize
),
'goodsAttr'
=>
$attr
,
'goodsPrice'
=>
(
int
)
$comment
[
'goods_pay_price'
],
'storeLabel'
=>
$storeLabel
,
'storeName'
=>
$storeInfo
[
'store_name'
],
'storeId'
=>
$comment
[
'store_id'
],
'goodsCommonId'
=>
$goodsCommonId
,
'groupId'
=>
$groupId
);
...
...
application/models/Business/Store/StoreService.php
View file @
c5e24876
...
@@ -154,7 +154,7 @@ class StoreServiceModel extends \Business\AbstractModel{
...
@@ -154,7 +154,7 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeDetailImg
=
unserialize
(
$storeInfo
[
'store_detail_image'
]);
$storeDetailImg
=
unserialize
(
$storeInfo
[
'store_detail_image'
]);
if
(
$storeDetailImg
&&
is_array
(
$storeDetailImg
)){
if
(
$storeDetailImg
&&
is_array
(
$storeDetailImg
)){
foreach
(
$storeDetailImg
as
$v
){
foreach
(
$storeDetailImg
as
$v
){
$detailImg
[]
=
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$v
);
$detailImg
[]
=
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$v
,
\Our\ImageConst
::
storeQualificationImg
);
}
}
}
}
}
}
...
...
application/models/Business/User/MemberCenterService.php
View file @
c5e24876
...
@@ -125,7 +125,7 @@ class MemberCenterServiceModel extends \Business\AbstractModel
...
@@ -125,7 +125,7 @@ class MemberCenterServiceModel extends \Business\AbstractModel
if
(
is_array
(
$list
)
&&
!
empty
(
$list
)){
if
(
is_array
(
$list
)
&&
!
empty
(
$list
)){
foreach
(
$list
as
$v
){
foreach
(
$list
as
$v
){
$v
[
'evaluation_score'
]
?
$grade
=
number_format
((
$v
[
'evaluation_score'
]
/
3
/
$v
[
'evaluation_number'
]),
1
,
'.'
,
''
)
:
$grade
=
'5.0'
;
$v
[
'evaluation_score'
]
?
$grade
=
number_format
((
$v
[
'evaluation_score'
]
/
3
/
$v
[
'evaluation_number'
]),
1
,
'.'
,
''
)
:
$grade
=
'5.0'
;
$stores
[]
=
array
(
'favid'
=>
$v
[
'favid'
],
'storeId'
=>
$v
[
'store_id'
],
'storeLabel'
=>
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$v
[
'store_label'
]),
'storeName'
=>
$v
[
'store_name'
],
'grade'
=>
$grade
,
'collectCount'
=>
$favoritesInstance
->
getFavoritesStoreCountByStoreId
(
$v
[
'store_id'
]));
$stores
[]
=
array
(
'favid'
=>
$v
[
'favid'
],
'storeId'
=>
$v
[
'store_id'
],
'storeLabel'
=>
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$v
[
'store_label'
]
,
\Our\ImageConst
::
storeCollectionImg
),
'storeName'
=>
$v
[
'store_name'
],
'grade'
=>
$grade
,
'collectCount'
=>
$favoritesInstance
->
getFavoritesStoreCountByStoreId
(
$v
[
'store_id'
]));
}
}
}
}
return
array
(
'stores'
=>
$stores
,
'totalCount'
=>
$totalCount
);
return
array
(
'stores'
=>
$stores
,
'totalCount'
=>
$totalCount
);
...
...
application/models/Business/User/SalespersonService.php
View file @
c5e24876
...
@@ -86,7 +86,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
...
@@ -86,7 +86,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
if
(
$goodsList
[
$v
[
'goodsId'
]])
{
if
(
$goodsList
[
$v
[
'goodsId'
]])
{
$goods
[
'goodsId'
]
=
$v
[
'goodsId'
];
$goods
[
'goodsId'
]
=
$v
[
'goodsId'
];
$goods
[
'goodsCommonId'
]
=
$goodsList
[
$v
[
'goodsId'
]][
'goods_commonid'
];
$goods
[
'goodsCommonId'
]
=
$goodsList
[
$v
[
'goodsId'
]][
'goods_commonid'
];
$goods
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goodsList
[
$v
[
'goodsId'
]][
'goods_image'
],
\Our\
Api
Const
::
SaleGoodsImgSize
);
$goods
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goodsList
[
$v
[
'goodsId'
]][
'goods_image'
],
\Our\
Image
Const
::
SaleGoodsImgSize
);
$goods
[
'goodsName'
]
=
$goodsList
[
$v
[
'goodsId'
]][
'goods_name'
];
$goods
[
'goodsName'
]
=
$goodsList
[
$v
[
'goodsId'
]][
'goods_name'
];
$goods
[
'goodsCount'
]
=
(
int
)
$v
[
'goodsCount'
];
$goods
[
'goodsCount'
]
=
(
int
)
$v
[
'goodsCount'
];
$hashData
[
$v
[
'sale_act_id'
]][
$v
[
'sale_act_id'
]
.
'_'
.
$memberId
.
'_'
.
$v
[
'goodsId'
]]
=
serialize
(
$goods
);
$hashData
[
$v
[
'sale_act_id'
]][
$v
[
'sale_act_id'
]
.
'_'
.
$memberId
.
'_'
.
$v
[
'goodsId'
]]
=
serialize
(
$goods
);
...
@@ -116,7 +116,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
...
@@ -116,7 +116,7 @@ class SalespersonServiceModel extends \Business\AbstractModel
if
(
!
in_array
(
$id
,
$existIds
)){
if
(
!
in_array
(
$id
,
$existIds
)){
if
(
$goodsList
[
$id
])
{
if
(
$goodsList
[
$id
])
{
$data
=
[
$data
=
[
'goodsImage'
=>
\Our\ImageUtil
::
getGoodsImgUrl
(
$goodsList
[
$id
][
'goods_image'
],
\Our\
Api
Const
::
SaleGoodsImgSize
),
'goodsImage'
=>
\Our\ImageUtil
::
getGoodsImgUrl
(
$goodsList
[
$id
][
'goods_image'
],
\Our\
Image
Const
::
SaleGoodsImgSize
),
'goodsName'
=>
$goodsList
[
$id
][
'goods_name'
],
'goodsName'
=>
$goodsList
[
$id
][
'goods_name'
],
'goodsCount'
=>
0
,
'goodsCount'
=>
0
,
'goodsId'
=>
$id
,
'goodsId'
=>
$id
,
...
...
application/models/DAO/Store.php
100755 → 100644
View file @
c5e24876
...
@@ -77,18 +77,21 @@ class StoreModel extends \DAO\AbstractModel
...
@@ -77,18 +77,21 @@ class StoreModel extends \DAO\AbstractModel
}
}
/**
/**
* 店铺头像
* 店铺头像
/资质图片
*
*
* @param $storeLabel
* @param $storeLabel
* @return string
* @return string
*/
*/
public
function
getStoreLabelSrc
(
$storeLabel
)
public
function
getStoreLabelSrc
(
$storeLabel
,
$width
=
\Our\ImageConst
::
circleStoreLabel
,
$height
=
0
)
{
{
$width
=
$width
*
\Our\ImageConst
::
sizeScale
;
$height
?
$height
=
$height
*
\Our\ImageConst
::
sizeScale
:
$height
=
$width
;
if
(
$storeLabel
)
{
if
(
$storeLabel
)
{
$storeLabel
=
\Our\Common
::
getStaticFile
(
$storeLabel
,
\Our\ImageConst
::
storeLabel
,
'ossHost'
);
$storeLabel
=
\Our\Common
::
getStaticFile
(
$storeLabel
,
\Our\ImageConst
::
storeLabel
,
'ossHost'
);
}
else
{
}
else
{
$storeLabel
=
\Our\Common
::
getStaticFile
(
ImageConst
::
defaultStoreLabelName
,
ImageConst
::
defaultPath
);
$storeLabel
=
\Our\Common
::
getStaticFile
(
ImageConst
::
defaultStoreLabelName
,
ImageConst
::
defaultPath
);
}
}
$storeLabel
.=
"?x-oss-process=image/resize,m_fill,h_
{
$height
}
,w_
{
$width
}
"
;
return
$storeLabel
;
return
$storeLabel
;
}
}
/**
/**
...
...
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