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
9cd06a48
Commit
9cd06a48
authored
Sep 05, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
1926e9cd
40acfd02
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
59 additions
and
14 deletions
+59
-14
Member.php
application/controllers/Member.php
+2
-1
ImageConst.php
application/library/Our/ImageConst.php
+5
-1
ImageUtil.php
application/library/Our/ImageUtil.php
+9
-2
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+19
-2
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+9
-5
MemberService.php
application/models/Business/User/MemberService.php
+1
-3
StoreOnlineGoodsClass.php
application/models/DAO/GoodsClass/StoreOnlineGoodsClass.php
+10
-0
GoodsCommon.php
application/models/DAO/GoodsCommon.php
+4
-0
No files found.
application/controllers/Member.php
100755 → 100644
View file @
9cd06a48
...
...
@@ -83,7 +83,8 @@ class MemberController extends \Our\Controller_AbstractApi {
* @throws Exception
*/
public
function
logOutAction
(){
$result
=
$this
->
memberService
->
logOut
(
$this
->
key
);
$key
=
$this
->
req
[
\Our\NameConst
::
data
][
'key'
];
$result
=
$this
->
memberService
->
logOut
(
$key
);
if
(
$result
){
$this
->
success
(
new
stdClass
());
}
...
...
application/library/Our/ImageConst.php
View file @
9cd06a48
...
...
@@ -104,5 +104,9 @@ class ImageConst{
const
storeQualificationImg
=
188
;
const
storeCollectionImg
=
112
;
const
homeIndexHotGoodsImageSize
=
250
;
const
goodsStoreImg
=
100
;
//商品详情页的店铺头像
const
goodsGroupImg
=
182
;
//商品/组合详情页的其他搭配图片
const
groupGoodsImg
=
160
;
//组合详情页的搭配商品
const
storeGroupImg
=
186
;
//店铺促销
const
storeGroupGoodsImg
=
130
;
}
application/library/Our/ImageUtil.php
View file @
9cd06a48
...
...
@@ -126,10 +126,17 @@ class ImageUtil {
//$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_fill,h_
{
$height
}
,w_
{
$width
}
"
;
if
(
$width
>
0
)
{
$goodsImg
.=
"?x-oss-process=image/resize,m_fill,h_
{
$height
}
,w_
{
$width
}
"
;
}
return
$goodsImg
;
}
public
function
getGoodsImgWithUrl
(
$goodsImgUrl
,
$width
=
\Our\ImageConst
::
goodsListImgSize
,
$height
=
0
)
{
$width
=
$width
*
\Our\ImageConst
::
sizeScale
;
$height
?
$height
=
$height
*
\Our\ImageConst
::
sizeScale
:
$height
=
$width
;
$goodsImgUrl
.=
"?x-oss-process=image/resize,m_fill,h_
{
$height
}
,w_
{
$width
}
"
;
return
$goodsImgUrl
;
}
public
static
function
getTopClassAdvImageUrl
(
$gcId
){
$fileName
=
\Our\ImageConst
::
topClassAdvImagePrefis
.
$gcId
.
\Our\NameConst
::
jpgSuffix
;
$gcImageUrl
=
\Our\Common
::
getStaticFile
(
$fileName
,
\Our\ImageConst
::
defaultPath
);
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
9cd06a48
...
...
@@ -524,7 +524,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$commonInstance
=
\DAO\GoodsCommonModel
::
getInstance
();
$count
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
(),
array
(
&
$commonInstance
,
'getCount'
),
array
(
array
(
'store_id'
=>
$storeId
)),
\Our\ApiConst
::
oneDaySecond
);
return
array
(
'storeId'
=>
$storeId
,
'storeName'
=>
$storeInfo
[
'store_name'
],
'storeLabel'
=>
$label
,
'goodsTotal'
=>
$count
,
'isQuality'
=>
$storeInfo
[
'store_zhping'
],
'freeShippingPrice'
=>
$storeInfo
[
'free_shipping_price'
],
'shareDesc'
=>
$storeInfo
[
'store_share_desc'
]);
return
array
(
'storeId'
=>
$storeId
,
'storeName'
=>
$storeInfo
[
'store_name'
],
'storeLabel'
=>
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$storeInfo
[
'store_label'
],
\Our\ImageConst
::
goodsStoreImg
)
,
'goodsTotal'
=>
$count
,
'isQuality'
=>
$storeInfo
[
'store_zhping'
],
'freeShippingPrice'
=>
$storeInfo
[
'free_shipping_price'
],
'shareDesc'
=>
$storeInfo
[
'store_share_desc'
]);
}
/**
...
...
@@ -1057,7 +1057,24 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
public
function
checkRemoveOnlineGoodsClass
(
$goodsClass
){
$goodsCommonDao
=
\DAO\GoodsCommonModel
::
getInstance
();
$storeOnlineGoodsClassDao
=
\DAO\GoodsClass\StoreOnlineGoodsClassModel
::
getInstance
();
if
(
$goodsClass
){
$gcFrom
=
$goodsClass
[
'gc_from'
];
$where
[
'gc_id_1'
]
=
$goodsClass
[
'gc_id_1'
];
$where
[
'gc_id_2'
]
=
$goodsClass
[
'gc_id_2'
];
$where
[
'gc_id_3'
]
=
$goodsClass
[
'gc_id_3'
];
$where
[
'store_id'
]
=
$goodsClass
[
'store_id'
];
$where
[
'goods_state'
]
=
\Our\ApiConst
::
onlineGoodsState
;
$where
[
'goods_verify'
]
=
\Our\ApiConst
::
onlineGoodsVerify
;
if
(
$gcFrom
==
\Our\ApiConst
::
one
){
$where
[
'goods_class_t_id'
]
=
$goodsClass
[
'gc_id_3'
];
}
$tempOne
=
$goodsCommonDao
->
getOne
(
$where
,
'goods_commonid'
);
if
(
!
$tempOne
){
$storeOnlineGoodsClassDao
->
del
(
$goodsClass
);
}
}
}
private
static
$_instance
=
null
;
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
9cd06a48
...
...
@@ -44,12 +44,15 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$data
[
'image'
]
=
[];
if
(
$blImg
=
unserialize
(
$data
[
'bl_image'
])){
foreach
(
$blImg
as
$v
){
$data
[
'image'
][]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$v
,
\Our\ImageConst
::
goodsDetailImgSize
);
if
(
$v
)
{
$data
[
'image'
][]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$v
,
\Our\ImageConst
::
goodsDetailImgSize
);
}
}
}
$data
[
'goods'
]
=
[];
if
(
$data
[
'goodsList'
]
&&
is_array
(
$data
[
'goodsList'
])){
foreach
(
$data
[
'goodsList'
]
as
$v
){
$v
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgWithUrl
(
$v
[
'goodsImage'
],
\Our\ImageConst
::
groupGoodsImg
);
unset
(
$v
[
'goods_id'
]);
unset
(
$v
[
'goodsStorage'
]);
unset
(
$v
[
'goodsAttr'
]);
...
...
@@ -227,7 +230,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
if
(
$groupList
){
foreach
(
$groupList
as
$k
=>
$v
){
$v
[
'groupId'
]
=
$v
[
'blId'
];
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]);
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]
,
\our\ImageConst
::
goodsGroupImg
);
unset
(
$v
[
'goodsList'
]);
unset
(
$v
[
'bl_title'
]);
unset
(
$v
[
'store_id'
]);
...
...
@@ -295,7 +298,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach
(
$group
as
$k
=>
$v
){
if
(
$v
[
'bl_quota_starttime'
]
<
TIMESTAMP
&&
$v
[
'endTime'
]
>=
TIMESTAMP
){
$v
[
'groupId'
]
=
$v
[
'blId'
];
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]);
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]
,
\Our\ImageConst
::
goodsGroupImg
);
unset
(
$v
[
'goodsList'
]);
unset
(
$v
[
'bl_title'
]);
unset
(
$v
[
'store_id'
]);
...
...
@@ -346,7 +349,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach
(
$groupList
as
$k
=>
$v
){
if
(
$v
[
'bl_quota_starttime'
]
<
TIMESTAMP
&&
$v
[
'endTime'
]
>=
TIMESTAMP
){
$v
[
'groupId'
]
=
$v
[
'blId'
];
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]);
$v
[
'image'
]
=
ImageUtil
::
getGoodsImgUrl
(
$v
[
'image'
]
,
\Our\ImageConst
::
storeGroupImg
);
unset
(
$v
[
'bl_title'
]);
unset
(
$v
[
'store_id'
]);
unset
(
$v
[
'store_name'
]);
...
...
@@ -365,6 +368,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$goods
=
[];
if
(
$v
[
'goodsList'
]){
foreach
(
$v
[
'goodsList'
]
as
$v2
){
$v2
[
'goodsImage'
]
=
ImageUtil
::
getGoodsImgWithUrl
(
$v2
[
'goodsImage'
],
\our\ImageConst
::
storeGroupGoodsImg
);
unset
(
$v2
[
'goods_id'
]);
unset
(
$v2
[
'goodsStorage'
]);
unset
(
$v2
[
'bl_id'
]);
...
...
@@ -469,7 +473,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$goods_temp
=
array_merge
(
$goods
,
$goodsArray
[
$goods
[
'goods_id'
]]);
$blSumPrice
+=
$goods_temp
[
'goodsPrice'
]
*
$goods_temp
[
'num'
];
$goods_temp
[
'goodsAttr'
]
=
$goodsDao
->
getFormatGoodsAttr
(
$goods_temp
[
'goods_spec'
]);
$goods_temp
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goods_temp
[
'goods_image'
]);
$goods_temp
[
'goodsImage'
]
=
\Our\ImageUtil
::
getGoodsImgUrl
(
$goods_temp
[
'goods_image'
]
,
0
);
//unset($goods_temp['goods_spec']);
//unset($goods_temp['goods_image']);
//unset($goods_temp['bl_id']);
...
...
application/models/Business/User/MemberService.php
100755 → 100644
View file @
9cd06a48
...
...
@@ -209,9 +209,7 @@ class MemberServiceModel extends \Business\AbstractModel
* 退出登录
*/
public
function
logOut
(
$key
){
$this
->
memberDb0Redis
->
tableDel
(
$key
);
$sess
=
\Yaf\Session
::
getInstance
();
$sess
->
del
(
'member_id'
);
$this
->
clearKey
(
$key
);
return
true
;
}
...
...
application/models/DAO/GoodsClass/StoreOnlineGoodsClass.php
View file @
9cd06a48
...
...
@@ -44,6 +44,16 @@ class StoreOnlineGoodsClassModel extends \DAO\AbstractModel{
return
$result
;
}
public
function
del
(
$where
){
$this
->
setDb
(
\Our\DbNameConst
::
masterDBConnectName
);
$temp
=
$this
->
findByWhere
(
$where
);
$result
=
$this
->
db
->
delete
(
$this
->
_tableName
)
->
where
(
$where
)
->
execute
();
return
$result
;
}
public
function
getList
(
$where
,
$field
=
\Our\NameConst
::
allField
){
$this
->
setDb
(
$this
->
dbName
);
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
...
...
application/models/DAO/GoodsCommon.php
View file @
9cd06a48
...
...
@@ -30,6 +30,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
array
(
'goods_commonid'
=>
$goodsCommonId
))
->
fetchOne
();
}
public
function
getOne
(
$where
,
$field
=
\Our\NameConst
::
allField
){
$this
->
setDb
(
$this
->
dbName
);
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchOne
();
}
public
function
getGoodsSaleNumFromCache
(
$goodsCommonId
){
$goodsCommonRedis
=
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
();
$onlineGoodsCommonSaleNumKey
=
\Our\NameConst
::
onlineGoodsCommonSaleNumPrefix
;
...
...
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