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
1df56357
Commit
1df56357
authored
Sep 06, 2018
by
zhz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into master_dev
parents
073c2576
c0a653b4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
1 deletion
+116
-1
OrderService.php
application/models/Business/Order/OrderService.php
+2
-0
StoreOnlineGoodsClass.php
application/models/DAO/GoodsClass/StoreOnlineGoodsClass.php
+23
-0
Order.php
application/models/DAO/Order/Order.php
+1
-1
CodeConfig.php
application/models/Error/CodeConfig.php
+2
-0
storeOnlineGoodsClass.php
scripts/crontab/store/storeOnlineGoodsClass.php
+88
-0
No files found.
application/models/Business/Order/OrderService.php
View file @
1df56357
...
...
@@ -179,6 +179,8 @@ class OrderServiceModel extends \Business\AbstractModel
}
else
{
ErrorModel
::
throwException
(
CodeConfigModel
::
orderDeleteError
);
}
}
else
{
ErrorModel
::
throwException
(
CodeConfigModel
::
notAllowCancel
);
}
}
...
...
application/models/DAO/GoodsClass/StoreOnlineGoodsClass.php
View file @
1df56357
...
...
@@ -112,6 +112,29 @@ class StoreOnlineGoodsClassModel extends \DAO\AbstractModel{
}
}
/**
* 商品详情发生改变存如缓存
* @param $goodsCommon goodsCommon详情
* @param int $type 操作类型(1:加,0:减)
* @return bool
*/
public
function
addGoodsToGoodsClassCache
(
$goodsCommon
,
$type
=
\Our\ApiConst
::
plus
){
if
(
!
$goodsCommon
){
return
false
;
}
$goodsClass
[
'gc_id_1'
]
=
$goodsCommon
[
'gc_id_1'
];
$goodsClass
[
'gc_id_2'
]
=
$goodsCommon
[
'gc_id_2'
];
$goodsClass
[
'gc_id_3'
]
=
$goodsCommon
[
'gc_id_3'
];
$goodsClass
[
'store_id'
]
=
$goodsCommon
[
'store_id'
];
$goodsClass
[
'gc_from'
]
=
\Our\ApiConst
::
zero
;
$this
->
addChangedGoodsClass
(
serialize
(
$goodsClass
),
$type
);
if
(
$goodsCommon
[
'goods_class_t_id'
]){
$goodsClass
[
'gc_id_3'
]
=
$goodsCommon
[
'goods_class_t_id'
];
$goodsClass
[
'gc_from'
]
=
\Our\ApiConst
::
zero
;
$this
->
addChangedGoodsClass
(
serialize
(
$goodsClass
),
$type
);
}
return
true
;
}
public
function
addChangedGoodsClass
(
$goodsClass
,
$type
=
\Our\ApiConst
::
plus
){
$key
=
'changedAddGoodsClass'
;
...
...
application/models/DAO/Order/Order.php
View file @
1df56357
...
...
@@ -736,7 +736,7 @@ class OrderModel extends \DAO\AbstractModel
//放入回收站
case
NameConst
::
delete
:
$state
=
in_array
(
$orderInfo
[
'orderState'
],
array
(
ApiConst
::
orderStateCancel
,
ApiConst
::
orderStateComplete
))
&&
$orderInfo
[
'deleteState'
]
==
ApiConst
::
zero
;
$state
=
in_array
(
$orderInfo
[
'orderState'
],
array
(
ApiConst
::
orderStateCancel
,
ApiConst
::
orderStateComplete
,
ApiConst
::
orderStateClose
))
&&
$orderInfo
[
'deleteState'
]
==
ApiConst
::
zero
;
$this
->
errorMessage
=
CodeConfigModel
::
deleteError
;
break
;
...
...
application/models/Error/CodeConfig.php
100755 → 100644
View file @
1df56357
...
...
@@ -270,6 +270,7 @@ class CodeConfigModel {
const
notExsitDeliver
=
300111
;
const
notExsitOrder
=
300112
;
const
alreadyExsitRefundGoods
=
300113
;
const
notAllowDelete
=
300114
;
//店铺相关错误码
//商品分类
...
...
@@ -664,6 +665,7 @@ class CodeConfigModel {
self
::
notExsitDeliver
=>
'配送单不存在'
,
self
::
notExsitOrder
=>
'订单不存在'
,
self
::
alreadyExsitRefundGoods
=>
'退款订单已经存在'
,
self
::
notAllowDelete
=>
'当前订单状态不允许删除'
,
self
::
deleteError
=>
'放入回收站失败,订单状态有误'
,
self
::
restoreError
=>
'永久删除、从回收站还原失败,订单状态有误'
,
self
::
shareError
=>
'分享失败,订单状态有误'
,
...
...
scripts/crontab/store/storeOnlineGoodsClass.php
0 → 100644
View file @
1df56357
<?php
/**
* User: liuyuzhen
* Date: 2018/9/5
* Time: 19:00
* Description:
*/
define
(
"APPLICATION_PATH"
,
realpath
(
dirname
(
__FILE__
)
.
'/../../../'
));
//指向public的上一级
require
APPLICATION_PATH
.
'/scripts/crontab/baseCli.php'
;
require
APPLICATION_PATH
.
'/scripts/crontab/common.php'
;
error_reporting
(
E_ALL
^
E_NOTICE
);
class
cliStoreOnlineGoodsClass
extends
basecli
{
const
CLI_ADMIN_ID
=
255
;
private
$bDoUnLock
=
FALSE
;
// 是否允许释放 LOCK 文件
private
$_debug
=
0
;
private
$lockFileName
;
private
$fromState
;
private
function
mkdirs
(
$dir
,
$mode
=
0777
)
{
if
(
is_dir
(
$dir
)
||
@
mkdir
(
$dir
,
$mode
))
{
return
TRUE
;
}
if
(
!
$this
->
mkdirs
(
dirname
(
$dir
),
$mode
))
{
return
FALSE
;
}
return
@
mkdir
(
$dir
,
$mode
);
}
/**
* 析构
*/
public
function
__destruct
()
{
parent
::
__destruct
();
if
(
$this
->
bDoUnLock
)
{
@
unlink
(
$this
->
lockFileName
);
}
}
protected
function
storeOnlineGoodsClass
(){
\Business\Goods\GoodsCommonServiceModel
::
getInstance
()
->
storeOnlineGoodsClass
();
}
protected
function
_runCli
()
{
$this
->
_debug
=
isset
(
$this
->
aArgv
[
1
])
?
intval
(
$this
->
aArgv
[
1
])
:
0
;
if
(
$this
->
_debug
)
{
echo
"*** Debug mode ***
\n
"
;
}
// Step: 02 检查是否已有相同CLI在运行中
$lockDir
=
$this
->
_getBaseFileName
(
'storeOnlineGoodsClass'
);
if
(
!
$this
->
mkdirs
(
$lockDir
)){
echo
'****create dir fail ****'
;
exit
;
}
$this
->
lockFileName
=
$lockDir
.
'.locks'
;
if
(
file_exists
(
$this
->
lockFileName
)
)
{
$stat
=
stat
(
$this
->
lockFileName
);
if
(
(
TIMESTAMP
-
$stat
[
'mtime'
])
>
24
*
60
*
60
*
2
)
{
echo
"文件被锁超过2天,被强制删除"
;
@
unlink
(
$this
->
lockFileName
);
}
else
{
$this
->
halt
(
'['
.
date
(
'Y-m-d H:i:s'
)
.
'] The CLI is running'
.
"
\n
"
);
}
}
$this
->
bDoUnLock
=
true
;
file_put_contents
(
$this
->
lockFileName
,
"running"
);
// CLI 独占锁
$this
->
storeOnlineGoodsClass
();
echo
'店铺在售商品分类更新成功'
.
"
\r\n
"
;
}
}
$oCli
=
new
cliShopkeeperIndex
(
TRUE
);
EXIT
;
?>
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