Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
d10a3ead
Commit
d10a3ead
authored
Sep 13, 2021
by
pengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' into test
# Conflicts: # application/services/user/UserService.php
parents
4cc5fd92
5a660b43
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
BaseException.php
application/exception/BaseException.php
+3
-3
BaseValidate.php
application/library/Validate/BaseValidate.php
+1
-1
Colonelorder.php
application/modules/Job/controllers/Colonelorder.php
+2
-2
No files found.
application/exception/BaseException.php
View file @
d10a3ead
...
@@ -33,11 +33,11 @@ class BaseException extends \Exception
...
@@ -33,11 +33,11 @@ class BaseException extends \Exception
$this
->
msg
=
$params
[
'msg'
]
??
Registry
::
get
(
'config'
)
->
exception
->
user
->
msg
;
$this
->
msg
=
$params
[
'msg'
]
??
Registry
::
get
(
'config'
)
->
exception
->
user
->
msg
;
if
(
isset
(
$params
[
'cus'
])
&&
$this
->
cus
&&
isset
(
$this
->
cus
[
intval
(
$params
[
'cus'
])])
&&
$this
->
base_code
)
{
if
(
isset
(
$params
[
'cus'
])
&&
$this
->
cus
&&
isset
(
$this
->
cus
[
intval
(
$params
[
'cus'
])])
&&
$this
->
base_code
)
{
return
$this
->
setCusMsg
(
$params
[
'cus'
]);
return
$this
->
setCusMsg
(
$params
[
'cus'
]
,
$params
[
'data'
]
??
''
);
}
}
}
}
public
function
setCusMsg
(
$cus
)
public
function
setCusMsg
(
$cus
,
$data
=
''
)
{
{
//每个服务都有自己的codePrefix
//每个服务都有自己的codePrefix
$appid
=
\Yaf\Application
::
app
()
->
getConfig
()
->
get
(
"appid"
);
$appid
=
\Yaf\Application
::
app
()
->
getConfig
()
->
get
(
"appid"
);
...
@@ -48,7 +48,7 @@ class BaseException extends \Exception
...
@@ -48,7 +48,7 @@ class BaseException extends \Exception
$base_code
=
intval
(
$this
->
base_code
);
$base_code
=
intval
(
$this
->
base_code
);
$this
->
code
=
$codePrefix
+
$base_code
+
$cus_code
;
$this
->
code
=
$codePrefix
+
$base_code
+
$cus_code
;
$this
->
msg
=
isset
(
$params
[
'data'
])
?
vsprintf
(
$this
->
cus
[
$cus_code
],
$params
[
'data'
]
)
:
$this
->
cus
[
$cus_code
];
$this
->
msg
=
!
empty
(
$data
)
?
vsprintf
(
$this
->
cus
[
$cus_code
],
$data
)
:
$this
->
cus
[
$cus_code
];
}
}
public
function
__get
(
$name
)
:
bool
public
function
__get
(
$name
)
:
bool
...
...
application/library/Validate/BaseValidate.php
View file @
d10a3ead
...
@@ -41,7 +41,7 @@ class BaseValidate extends Validate
...
@@ -41,7 +41,7 @@ class BaseValidate extends Validate
protected
function
isMobile
(
$value
)
protected
function
isMobile
(
$value
)
{
{
$rule
=
'^1(3|4|5|
7|8
)[0-9]\d{8}$^'
;
$rule
=
'^1(3|4|5|
6|7|8|9
)[0-9]\d{8}$^'
;
$result
=
preg_match
(
$rule
,
$value
);
$result
=
preg_match
(
$rule
,
$value
);
if
(
$result
)
{
if
(
$result
)
{
return
true
;
return
true
;
...
...
application/modules/Job/controllers/Colonelorder.php
View file @
d10a3ead
...
@@ -234,7 +234,7 @@ class ColonelorderController extends Job
...
@@ -234,7 +234,7 @@ class ColonelorderController extends Job
$res
=
Idgen
::
get
(
appConfig
(
'idgen.partner'
),
appConfig
(
'idgen.key'
),
[],
$httpParams
);
$res
=
Idgen
::
get
(
appConfig
(
'idgen.partner'
),
appConfig
(
'idgen.key'
),
[],
$httpParams
);
$ids
=
$res
[
'id_datetime'
][
'goods'
]
??
[];
$ids
=
$res
[
'id_datetime'
][
'goods'
]
??
[];
if
(
$count
>
count
(
$ids
))
{
if
(
$count
>
count
(
$ids
))
{
throw
new
Exception
(
'请求idgen服务失败,'
.
[
'req'
=>
$httpParams
,
'res'
=>
$res
]);
throw
new
Exception
(
'请求idgen服务失败,'
.
[
'req'
=>
$httpParams
,
'res'
=>
$res
]);
}
}
foreach
(
$data
as
$key
=>
$item
)
{
foreach
(
$data
as
$key
=>
$item
)
{
$data
[
$key
][
'pay_info_trade_id'
]
=
$ids
[
$key
];
$data
[
$key
][
'pay_info_trade_id'
]
=
$ids
[
$key
];
...
@@ -288,7 +288,7 @@ class ColonelorderController extends Job
...
@@ -288,7 +288,7 @@ class ColonelorderController extends Job
$response
=
HttpUtil
::
post
(
$url
,
$httpParams
,
100000
,
3
);
$response
=
HttpUtil
::
post
(
$url
,
$httpParams
,
100000
,
3
);
$this
->
loggerInfo
(
"url=
$url
,request="
.
json_encode
(
$httpParams
)
.
";response="
.
json_encode
(
$response
));
$this
->
loggerInfo
(
"url=
$url
,request="
.
json_encode
(
$httpParams
)
.
";response="
.
json_encode
(
$response
));
if
(
!
isset
(
$response
[
'response'
][
'result'
][
'capital_pool_total'
]))
{
if
(
!
isset
(
$response
[
'response'
][
'result'
][
'capital_pool_total'
]))
{
throw
new
Exception
(
'没有获取到资金池信息
'
);
throw
new
Exception
(
'没有获取到资金池信息
,'
.
[
'req'
=>
$httpParams
,
'res'
=>
$response
]
);
}
}
$result
=
$response
[
'response'
][
'result'
];
$result
=
$response
[
'response'
][
'result'
];
$balance
=
(
$result
[
'capital_pool_total'
]
-
$result
[
'capital_pool_lock'
]
-
$result
[
'capital_pool_used'
]);
$balance
=
(
$result
[
'capital_pool_total'
]
-
$result
[
'capital_pool_lock'
]
-
$result
[
'capital_pool_used'
]);
...
...
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