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
d1716b73
Commit
d1716b73
authored
Oct 19, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goods
parent
36e32176
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
Index.php
application/controllers/Index.php
+1
-1
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+2
-2
StoreService.php
application/models/Business/Store/StoreService.php
+3
-1
GoodsCommon.php
application/models/DAO/GoodsCommon.php
+4
-1
No files found.
application/controllers/Index.php
View file @
d1716b73
...
...
@@ -123,7 +123,7 @@ class IndexController extends \Our\Controller_Abstract {
$goodsCommonId
=
(
int
)
$this
->
getRequest
()
->
getQuery
()[
'goodsCommonId'
];
if
(
$goodsCommonId
>
0
)
{
$commonGoodsInstance
=
\DAO\GoodsCommonModel
::
getInstance
();
$commonInfo
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
(),
array
(
&
$commonGoodsInstance
,
'getOneById'
),
array
(
$goodsCommonId
),
0
,
array
(
$goodsCommonId
)
);
$commonInfo
=
$commonGoodsInstance
->
getOneByIdCache
(
$goodsCommonId
);
}
$this
->
_view
->
assign
(
'commonInfo'
,
$commonInfo
);
}
...
...
application/models/Business/Goods/GoodsCommonService.php
View file @
d1716b73
...
...
@@ -24,7 +24,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyCommonId
);
}
$commonGoodsInstance
=
\DAO\GoodsCommonModel
::
getInstance
();
$commonInfo
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
(),
array
(
&
$commonGoodsInstance
,
'getOneById'
),
array
(
$goodsCommonId
),
0
,
array
(
$goodsCommonId
)
);
$commonInfo
=
$this
->
getOneByIdCache
(
$goodsCommonId
);
$saleNum
=
$commonGoodsInstance
->
getGoodsSaleNumFromCache
(
$goodsCommonId
);
$commonInfo
[
'sale_num'
]
=
$saleNum
;
if
(
!
$commonInfo
){
...
...
@@ -1060,7 +1060,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
public
function
getRealPriceByGoodsCommonId
(
$goodsCommon
,
$memberId
=
null
,
$activities
=
null
){
if
(
!
is_array
(
$goodsCommon
)){
$commonGoodsInstance
=
\DAO\GoodsCommonModel
::
getInstance
();
$goodsCommon
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
(),
array
(
&
$commonGoodsInstance
,
'getOneById'
),
array
(
$goodsCommon
),
0
,
array
(
$goodsCommon
)
);
$goodsCommon
=
$commonGoodsInstance
->
getOneByIdCache
(
$goodsCommon
);
}
$storeId
=
$goodsCommon
[
'store_id'
];
//该用户是否有参加这个店铺销售活动
...
...
application/models/Business/Store/StoreService.php
View file @
d1716b73
...
...
@@ -146,7 +146,9 @@ class StoreServiceModel extends \Business\AbstractModel{
$storeDetailImg
=
unserialize
(
$storeInfo
[
'store_detail_image'
]);
if
(
$storeDetailImg
&&
is_array
(
$storeDetailImg
)){
foreach
(
$storeDetailImg
as
$v
){
$detailImg
[]
=
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$v
,
\Our\ImageConst
::
storeQualificationImg
);
if
(
$v
)
{
$detailImg
[]
=
\DAO\StoreModel
::
getInstance
()
->
getStoreLabelSrc
(
$v
,
\Our\ImageConst
::
storeQualificationImg
);
}
}
}
}
...
...
application/models/DAO/GoodsCommon.php
View file @
d1716b73
...
...
@@ -29,7 +29,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
$this
->
setDb
(
$this
->
dbName
);
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
array
(
'goods_commonid'
=>
$goodsCommonId
))
->
fetchOne
();
}
public
function
getOneByIdCache
(
$goodsCommonId
)
{
$commonInfo
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
(),
array
(
&
$this
,
'getOneById'
),
array
(
$goodsCommonId
),
0
,
array
(
$goodsCommonId
));
return
$commonInfo
;
}
public
function
getOne
(
$where
,
$field
=
\Our\NameConst
::
allField
){
$this
->
setDb
(
$this
->
dbName
);
if
(
is_array
(
$where
)){
...
...
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