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
9f5996d1
Commit
9f5996d1
authored
Jan 29, 2019
by
liuyuzhengrace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配送费相关
parent
bfb185c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
RedisLock.php
application/library/Lock/RedisLock.php
+6
-0
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+1
-1
application.ini
conf/application.ini
+5
-5
No files found.
application/library/Lock/RedisLock.php
View file @
9f5996d1
...
...
@@ -23,8 +23,14 @@ class RedisLock implements \Lock\ILock{
public
function
getLock
(
$key
,
$timeout
=
self
::
EXPIRE
)
{
$currMicroTime
=
$this
->
getMicrotime
();
$is_lock
=
$this
->
lockRedis
->
tableSetnx
(
$key
,
$currMicroTime
+
10
);
$i
=
0
;
while
(
$is_lock
==
false
&&
$i
<
3
){
$is_lock
=
$this
->
lockRedis
->
tableSetnx
(
$key
,
$currMicroTime
+
10
);
$i
++
;
}
// 不能获取锁
if
(
!
$is_lock
){
//判断锁是否过期
...
...
application/library/Order/OrderConfirmUtil.php
View file @
9f5996d1
...
...
@@ -383,7 +383,7 @@ class OrderConfirmUtil {
}
$deliveryFee
=
\Our\ApiConst
::
zero
;
}
if
(
$deliveryFee
!=
$requestData
[
'deliveryFee'
]){
if
(
intval
(
$deliveryFee
)
!=
$requestData
[
'deliveryFee'
]){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
wrongStoreDeliveryFeeForOrder
);
}
$delivery
=
array
();
...
...
conf/application.ini
View file @
9f5996d1
...
...
@@ -390,21 +390,21 @@ elastic.master.scheme="http";
[lyztest : common]
; 数据库配置
resources.database.params.driver
=
"pdo_mysql"
resources.database.params.hostname
=
"1
92.168.134.18
"
resources.database.params.hostname
=
"1
06.14.14.233
"
resources.database.params.port
=
3306
resources.database.params.database
=
"qmcs"
resources.database.params.username
=
"root"
resources.database.params.password
=
"
123456
"
resources.database.params.password
=
"
!@#$%12345werty
"
resources.database.params.charset
=
"UTF8"
resources.database.params.driver_options.1002
=
"SET NAMES utf8"
; 从库配置
resources.database.slave.params.driver
=
"pdo_mysql"
resources.database.slave.params.hostname
=
"1
92.168.134.18
"
resources.database.slave.params.hostname
=
"1
06.14.14.233
"
resources.database.slave.params.port
=
3306
resources.database.slave.params.database
=
"qmcs"
resources.database.slave.params.username
=
"root"
resources.database.slave.params.password
=
"
123456
"
resources.database.slave.params.password
=
"
!@#$%12345werty
"
resources.database.slave.params.charset
=
"UTF8"
resources.database.slave.params.driver_options.1002
=
"SET NAMES utf8"
...
...
@@ -412,7 +412,7 @@ resources.database.slave.params.driver_options.1002 = "SET NAMES utf8"
password.key
=
'~!@#$`1234qwertasdfgzxcvb'
redis.database.params.host
=
"1
27.0.0.1
"
redis.database.params.host
=
"1
92.168.134.18
"
redis.database.params.port
=
"6379"
redis.database.params.prefix
=
"qm_"
;redis.database.params.password = "23456ertyu"
...
...
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