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
75b902b5
Commit
75b902b5
authored
Sep 05, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会员
parent
84900118
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+18
-1
StoreOnlineGoodsClass.php
application/models/DAO/GoodsClass/StoreOnlineGoodsClass.php
+10
-0
GoodsCommon.php
application/models/DAO/GoodsCommon.php
+4
-0
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
75b902b5
...
@@ -1057,7 +1057,24 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -1057,7 +1057,24 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
public
function
checkRemoveOnlineGoodsClass
(
$goodsClass
){
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
;
private
static
$_instance
=
null
;
...
...
application/models/DAO/GoodsClass/StoreOnlineGoodsClass.php
View file @
75b902b5
...
@@ -44,6 +44,16 @@ class StoreOnlineGoodsClassModel extends \DAO\AbstractModel{
...
@@ -44,6 +44,16 @@ class StoreOnlineGoodsClassModel extends \DAO\AbstractModel{
return
$result
;
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
){
public
function
getList
(
$where
,
$field
=
\Our\NameConst
::
allField
){
$this
->
setDb
(
$this
->
dbName
);
$this
->
setDb
(
$this
->
dbName
);
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
$result
=
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
$where
)
->
fetchAll
();
...
...
application/models/DAO/GoodsCommon.php
View file @
75b902b5
...
@@ -30,6 +30,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
...
@@ -30,6 +30,10 @@ class GoodsCommonModel extends \DAO\AbstractModel {
return
$this
->
db
->
select
(
$field
)
->
from
(
$this
->
_tableName
)
->
where
(
array
(
'goods_commonid'
=>
$goodsCommonId
))
->
fetchOne
();
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
){
public
function
getGoodsSaleNumFromCache
(
$goodsCommonId
){
$goodsCommonRedis
=
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
();
$goodsCommonRedis
=
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
();
$onlineGoodsCommonSaleNumKey
=
\Our\NameConst
::
onlineGoodsCommonSaleNumPrefix
;
$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