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
075b3620
Commit
075b3620
authored
Jan 09, 2019
by
testshenbd
Browse files
Options
Browse Files
Download
Plain Diff
conflicts
parents
aebd8775
b9181838
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
4 deletions
+33
-4
Common.php
application/library/Our/Common.php
+14
-0
OrderService.php
application/models/Business/Order/OrderService.php
+10
-2
application.ini
conf/application.ini
+3
-1
closeSecond.php
scripts/crontab/order/closeSecond.php
+6
-1
No files found.
application/library/Our/Common.php
View file @
075b3620
...
@@ -70,6 +70,20 @@ class Common
...
@@ -70,6 +70,20 @@ class Common
}
}
return
false
;
return
false
;
}
}
/**
* @param $arr
* @param $key_name
* @return array
* 将数据库中查出的列表以指定的 id 作为数组的键名
*/
public
static
function
convertArrKey
(
$arr
,
$key_name
)
{
$arr2
=
array
();
foreach
(
$arr
as
$key
=>
$val
)
{
$arr2
[
$val
[
$key_name
]]
=
$val
;
}
return
$arr2
;
}
public
static
function
isSerialized
(
$data
)
public
static
function
isSerialized
(
$data
)
{
{
...
...
application/models/Business/Order/OrderService.php
View file @
075b3620
...
@@ -1198,7 +1198,9 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -1198,7 +1198,9 @@ class OrderServiceModel extends \Business\AbstractModel
public
function
updateGoodsStoregeByGoodsIds
(
$storeId
,
$goodsid
,
$num
=
ApiConst
::
zero
,
$type
=
ApiConst
::
plus
){
public
function
updateGoodsStoregeByGoodsIds
(
$storeId
,
$goodsid
,
$num
=
ApiConst
::
zero
,
$type
=
ApiConst
::
plus
){
if
(
is_array
(
$goodsid
)){
if
(
is_array
(
$goodsid
)){
$where
[
'goods_id'
]
=
array
(
'in'
,
$goodsid
);
$goodsids
=
array
(
$goodsid
);
$convertGoodsId
=
Common
::
convertArrKey
(
$goodsid
,
'goodsId'
);
$where
[
'goods_id'
]
=
array
(
'in'
,
$goodsids
);
}
else
{
}
else
{
$where
[
'goods_id'
]
=
$goodsid
;
$where
[
'goods_id'
]
=
$goodsid
;
}
}
...
@@ -1206,8 +1208,14 @@ class OrderServiceModel extends \Business\AbstractModel
...
@@ -1206,8 +1208,14 @@ class OrderServiceModel extends \Business\AbstractModel
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$goodses
=
$goodsDao
->
getList
(
$where
,
$goodsDao
->
goodsDetailField
);
$goodses
=
$goodsDao
->
getList
(
$where
,
$goodsDao
->
goodsDetailField
);
if
(
!
empty
(
$goodses
)){
if
(
!
empty
(
$goodses
)){
foreach
(
$goodses
as
&
$goods
){
if
(
is_array
(
$goodsid
)){
foreach
(
$goodses
as
&
$goods
){
$goods
[
'goodsNum'
]
=
$convertGoodsId
[
$goods
[
'goodsId'
]][
'num'
];
}
}
else
{
foreach
(
$goodses
as
&
$goods
){
$goods
[
'goodsNum'
]
=
$num
;
$goods
[
'goodsNum'
]
=
$num
;
}
}
}
if
(
$this
->
updateDateGoodsStoregeByOrderGoods
(
$goodses
,
$type
,
false
)){
if
(
$this
->
updateDateGoodsStoregeByOrderGoods
(
$goodses
,
$type
,
false
)){
return
true
;
return
true
;
...
...
conf/application.ini
View file @
075b3620
...
@@ -12,6 +12,8 @@ application.dispatcher.catchException = true
...
@@ -12,6 +12,8 @@ application.dispatcher.catchException = true
; Admin模块用于后台管理
; Admin模块用于后台管理
application.modules
=
Index,Api,Admin,Client
application.modules
=
Index,Api,Admin,Client
redis.redisPublishName
=
'redisPublish'
[productone : common]
[productone : common]
; 数据库配置
; 数据库配置
resources.database.params.driver
=
"pdo_mysql"
resources.database.params.driver
=
"pdo_mysql"
...
@@ -534,4 +536,4 @@ elastic.master.scheme="http";
...
@@ -534,4 +536,4 @@ elastic.master.scheme="http";
;resources.database.params.hostname = "127.0.0.1"
;resources.database.params.hostname = "127.0.0.1"
;resources.database.params.database = "database"
;resources.database.params.database = "database"
;resources.database.params.username = "username"
;resources.database.params.username = "username"
;resources.database.params.password = "password"
;resources.database.params.password = "password"
\ No newline at end of file
scripts/crontab/order/closeSecond.php
View file @
075b3620
...
@@ -43,7 +43,12 @@ class cliOrderClose extends basecli
...
@@ -43,7 +43,12 @@ class cliOrderClose extends basecli
protected
function
autoCloseOrder
(){
protected
function
autoCloseOrder
(){
$orderService
=
\Business\Order\OrderServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$orderService
=
\Business\Order\OrderServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$orderService
->
baseDir
=
\Our\Common
::
getConfig
(
'out.config'
);
$orderService
->
baseDir
=
\Our\Common
::
getConfig
(
'out.config'
);
$orderService
->
changeOrderStatusSecond
();
if
(
$this
->
aArgv
[
1
]){
$orderService
->
changeOrderStatusSecond
(
true
);
}
else
{
$orderService
->
changeOrderStatusSecond
();
}
$messageService
=
\Business\Message\MessageServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$messageService
=
\Business\Message\MessageServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$messageService
->
addMessageCenterToDb
();
$messageService
->
addMessageCenterToDb
();
}
}
...
...
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