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
849551af
Commit
849551af
authored
Jan 10, 2019
by
liuyuzhen
Browse files
Options
Browse Files
Download
Plain Diff
合并代码
parents
d76db5a9
4458d513
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
18 deletions
+57
-18
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+17
-4
Common.php
application/library/Our/Common.php
+14
-0
GroupSaleService.php
application/models/Business/Goods/GroupSaleService.php
+5
-3
OrderService.php
application/models/Business/Order/OrderService.php
+10
-2
StoreService.php
application/models/Business/Store/StoreService.php
+1
-1
application.ini
conf/application.ini
+4
-7
closeSecond.php
scripts/crontab/order/closeSecond.php
+6
-1
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
849551af
...
...
@@ -715,15 +715,28 @@ class OrderConfirmUtil {
$authInfo
=
$sess
->
get
(
'wxAuthInfo'
);
$openid
=
$authInfo
[
'openid'
];
$
req_data
=
array
(
'touser'
=>
$openid
,
'template_id'
=>
$msg_tpl
,
'form_id'
=>
$formId
,
'page'
=>
'pages/orders/detail/index?id='
.
$orderId
,
'data'
=>
array
(
$
tpl_datas
=
array
();
if
(
$msg_tpl
==
'G7R8NV0eLQGJhyBbbbYvdoaY6vLgi47s4kpOK0oACUA'
)
{
$tpl_datas
=
array
(
'keyword1'
=>
array
(
'value'
=>
'下单成功'
),
'keyword2'
=>
array
(
'value'
=>
$order
[
'order_sn'
]),
'keyword3'
=>
array
(
'value'
=>
number_format
(
$order
[
'order_amount'
]
/
100
,
2
)
.
'元'
),
'keyword4'
=>
array
(
'value'
=>
$order
[
'store_name'
]),
'keyword5'
=>
array
(
'value'
=>
$goods_str
),
));
);
}
else
{
$tpl_datas
=
array
(
'keyword1'
=>
array
(
'value'
=>
'下单成功'
),
'keyword2'
=>
array
(
'value'
=>
$order
[
'order_sn'
]),
'keyword3'
=>
array
(
'value'
=>
date
(
'Y-m-d H:i'
,
TIMESTAMP
)),
'keyword4'
=>
array
(
'value'
=>
number_format
(
$order
[
'order_amount'
]
/
100
,
2
)
.
'元'
),
'keyword5'
=>
array
(
'value'
=>
$order
[
'store_name'
]),
'keyword6'
=>
array
(
'value'
=>
$goods_str
),
);
}
$req_data
=
array
(
'touser'
=>
$openid
,
'template_id'
=>
$msg_tpl
,
'form_id'
=>
$formId
,
'page'
=>
'pages/orders/detail/index?id='
.
$orderId
,
'data'
=>
$tpl_datas
);
// \Our\Log::getInstance()->write(json_encode($req_data), '/data/log/apptest');
$json
=
$wechatCommon
->
sendTemplateMessage
(
$access_token
,
$req_data
);
// \Our\Log::getInstance()->write($json, '/data/log/apptest');
...
...
application/library/Our/Common.php
View file @
849551af
...
...
@@ -70,6 +70,20 @@ class Common
}
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
)
{
...
...
application/models/Business/Goods/GroupSaleService.php
View file @
849551af
...
...
@@ -275,8 +275,10 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
foreach
(
$storeIds
as
$key
){
$tempReturnCart
=
$result
[
$key
];
$tempStore
=
$storeDao
->
get
(
$key
,
false
,
false
);
$tempReturnCart
[
'inAreaFlag'
]
=
$storeDao
->
checkAddressInServiceArea
(
$address
,
$tempStore
);
$newResult
[]
=
$tempReturnCart
;
if
(
$tempStore
)
{
//如果存在店铺数据
$tempReturnCart
[
'inAreaFlag'
]
=
$storeDao
->
checkAddressInServiceArea
(
$address
,
$tempStore
);
$newResult
[]
=
$tempReturnCart
;
}
}
return
array
(
'totalCount'
=>
count
(
$storeCartList
),
'list'
=>
$newResult
);
}
...
...
@@ -1206,4 +1208,4 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
}
}
\ No newline at end of file
}
application/models/Business/Order/OrderService.php
View file @
849551af
...
...
@@ -1198,7 +1198,9 @@ class OrderServiceModel extends \Business\AbstractModel
public
function
updateGoodsStoregeByGoodsIds
(
$storeId
,
$goodsid
,
$num
=
ApiConst
::
zero
,
$type
=
ApiConst
::
plus
){
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
{
$where
[
'goods_id'
]
=
$goodsid
;
}
...
...
@@ -1206,8 +1208,14 @@ class OrderServiceModel extends \Business\AbstractModel
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
masterDBConnectName
);
$goodses
=
$goodsDao
->
getList
(
$where
,
$goodsDao
->
goodsDetailField
);
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
;
}
}
if
(
$this
->
updateDateGoodsStoregeByOrderGoods
(
$goodses
,
$type
,
false
)){
return
true
;
...
...
application/models/Business/Store/StoreService.php
View file @
849551af
...
...
@@ -1011,7 +1011,7 @@ class StoreServiceModel extends \Business\AbstractModel{
foreach
(
$signClassStores
as
$signClass
){
$inAreaFlag
=
\Our\CommonExtension
::
locationInArea
(
$position
[
'lat'
],
$position
[
'lng'
],
$signClass
[
'sign_scope'
]);
if
(
$inAreaFlag
){
if
(
$return
[
$signClass
[
'gc_id'
]]
){
if
(
isset
(
$return
[
$signClass
[
'gc_id'
]])
){
continue
;
}
$return
[
$signClass
[
'gc_id'
]]
=
$signClass
[
'store_id'
];
...
...
conf/application.ini
View file @
849551af
...
...
@@ -12,10 +12,7 @@ application.dispatcher.catchException = true
; Admin模块用于后台管理
application.modules
=
Index,Api,Admin,Client
redis.redisPublishName
=
'redisPublish'
;
redis.redisPublishName
=
'redisPublish'
[productone : common]
; 数据库配置
...
...
@@ -63,7 +60,7 @@ elastic.master.port="9200"
elastic.master.scheme
=
"http"
;
password.key
=
'~!@#$`1234qwertasdfgzxcvb'
;
//
生产环境
;
生产环境
[product : common]
; 数据库配置
resources.database.params.driver
=
"pdo_mysql"
...
...
@@ -453,7 +450,7 @@ elastic.master.scheme="http";
resources.database.params.driver
=
"pdo_mysql"
resources.database.params.hostname
=
"127.0.0.1"
resources.database.params.port
=
3306
resources.database.params.database
=
"
test
qmcs"
resources.database.params.database
=
"qmcs"
resources.database.params.username
=
"root"
resources.database.params.password
=
"123456"
resources.database.params.charset
=
"UTF8"
...
...
@@ -463,7 +460,7 @@ resources.database.params.driver_options.1002 = "SET NAMES utf8"
resources.database.slave.params.driver
=
"pdo_mysql"
resources.database.slave.params.hostname
=
"127.0.0.1"
resources.database.slave.params.port
=
3306
resources.database.slave.params.database
=
"
test
qmcs"
resources.database.slave.params.database
=
"qmcs"
resources.database.slave.params.username
=
"root"
resources.database.slave.params.password
=
"123456"
resources.database.slave.params.charset
=
"UTF8"
...
...
scripts/crontab/order/closeSecond.php
View file @
849551af
...
...
@@ -43,7 +43,12 @@ class cliOrderClose extends basecli
protected
function
autoCloseOrder
(){
$orderService
=
\Business\Order\OrderServiceModel
::
getInstance
(
\Our\DbNameConst
::
masterDBConnectName
);
$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
->
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