Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fusionapi
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
林洽文
fusionapi
Commits
c9493749
Commit
c9493749
authored
May 06, 2023
by
zazaname
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加渠道下单
parent
b23fbb57
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
20 deletions
+20
-20
ExampleController.php
app/Http/Controllers/ExampleController.php
+4
-11
PayController.php
app/Http/Controllers/PayController.php
+1
-1
PayService.php
app/Http/Service/PayService.php
+4
-4
ExampleJob.php
app/Jobs/ExampleJob.php
+11
-4
No files found.
app/Http/Controllers/ExampleController.php
View file @
c9493749
...
...
@@ -5,20 +5,13 @@ namespace App\Http\Controllers;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Redis
;
use
App\Jobs\ExampleJob
;
class
ExampleController
class
ExampleController
extends
Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public
function
__construct
()
{
//
}
public
function
test
(
Request
$request
){
public
function
test
(
Request
$request
){
$this
->
dispatch
(
new
ExampleJob
(
11111
));
}
}
app/Http/Controllers/PayController.php
View file @
c9493749
...
...
@@ -22,7 +22,7 @@ class PayController extends Controller
*/
public
function
createOrder
()
{
$this
->
checkParam
([
'app_id'
,
'
ctype'
,
'
uid'
,
'cp_order_id'
,
'role_id'
,
'role_name'
,
'server_id'
,
'money'
]);
$this
->
checkParam
([
'app_id'
,
'uid'
,
'cp_order_id'
,
'role_id'
,
'role_name'
,
'server_id'
,
'money'
]);
$data
=
$this
->
paySv
->
createOrder
(
$this
->
requestData
);
return
json
(
$data
);
}
...
...
app/Http/Service/PayService.php
View file @
c9493749
...
...
@@ -40,7 +40,7 @@ class PayService
if
(
!
is_numeric
(
$params
[
'money'
])
||
$params
[
'money'
]
<
1
)
{
return
error
(
"订单金额的格式类型不正确"
);
}
if
(
empty
(
$params
[
'app_id'
])
||
empty
(
$params
[
'
ctype'
])
||
empty
(
$params
[
'
money'
])
||
empty
(
$params
[
'uid'
]))
{
if
(
empty
(
$params
[
'app_id'
])
||
empty
(
$params
[
'money'
])
||
empty
(
$params
[
'uid'
]))
{
return
error
(
"提交参数异常!"
);
}
//获取游戏表配置
...
...
@@ -52,7 +52,7 @@ class PayService
// 获取渠道表配置
$verInfo
=
DB
::
table
(
"app_ver_game as avg"
)
->
leftJoin
(
'app_ver as av'
,
'avg.ver'
,
'='
,
'av.ver_class'
)
->
where
([
'app_id'
=>
$params
[
'app_id'
]
,
'ver_code'
=>
$params
[
'ctype'
]
])
->
first
();
->
where
([
'app_id'
=>
$params
[
'app_id'
]])
->
first
();
if
(
is_null
(
$verInfo
))
{
return
error
(
'该游戏渠道没配置,app_id:'
.
$params
[
'app_id'
]);
}
...
...
@@ -65,7 +65,7 @@ class PayService
'order_id'
=>
$orderId
,
'cp_order_id'
=>
$params
[
'cp_order_id'
],
'veruniqid'
=>
$userInfo
->
veruniqid
,
'ver'
=>
$
params
[
'ctype'
]
,
'ver'
=>
$
verInfo
->
ver_code
,
'appid'
=>
$params
[
'app_id'
],
'server_id'
=>
$params
[
'server_id'
],
'server_name'
=>
$params
[
'server_name'
],
...
...
@@ -85,7 +85,7 @@ class PayService
if
(
$channel_order_id
){
$model
->
where
([
'order_id'
=>
$orderId
])
->
update
([
'channel_order_id'
=>
$channel_order_id
]);
}
return
success
(
'success'
,[
'order_id'
=>
$
orderId
,
'channel_order_id'
=>
$channel_order_i
d
]);
return
success
(
'success'
,[
'order_id'
=>
$
channel_order_id
?:
$orderI
d
]);
}
/**
...
...
app/Jobs/ExampleJob.php
View file @
c9493749
...
...
@@ -2,16 +2,21 @@
namespace
App\Jobs
;
class
ExampleJob
extends
Job
//use Illuminate\Contracts\Bus\SelfHandling;
use
Illuminate\Contracts\Queue\ShouldQueue
;
class
ExampleJob
extends
Job
implements
ShouldQueue
{
private
$cc
;
/**
* Create a new job instance.
*
* @return void
*/
public
function
__construct
()
public
function
__construct
(
$cc
)
{
//
$this
->
cc
=
$cc
;
}
/**
...
...
@@ -21,6 +26,8 @@ class ExampleJob extends Job
*/
public
function
handle
()
{
//
sleep
(
5
);
echo
getmypid
()
.
'-'
.
time
();
dump
(
$this
->
cc
);
}
}
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