Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
f7cfd1ea
...
f7cfd1ea442cfb23cdad4fe98c1d985fb77d582d
authored
2021-09-15 11:42:27 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
20234952
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
17 deletions
app/Jobs/StakeholderIncomeSyncJob.php → app/Console/Commands/StakeholderIncomeSyncCommand.php
app/Console/Kernel.php
app/
Jobs/StakeholderIncomeSyncJob
.php
→
app/
Console/Commands/StakeholderIncomeSyncCommand
.php
View file @
f7cfd1e
<?php
namespace
App\
Job
s
;
namespace
App\
Console\Command
s
;
use
App\Helper\CacheKeyTools
;
use
App\Helper\RedisClient
;
...
...
@@ -8,43 +8,51 @@ use App\Models\Legal\Bills;
use
App\Models\Legal\Company
;
use
App\Models\Legal\StakeholderIncomeByPayer
;
use
App\Services\ApiService
;
use
App\Traits\TaxReckon
;
use
Illuminate\Bus\Queueable
;
use
Illuminate\Contracts\Queue\ShouldBeUnique
;
use
Illuminate\Contracts\Queue\ShouldQueue
;
use
Illuminate\Foundation\Bus\Dispatchable
;
use
Illuminate\Queue\InteractsWithQueue
;
use
Illuminate\Queue\SerializesModels
;
use
Illuminate\Console\Command
;
use
Illuminate\Support\Facades\Log
;
/**
* Class StakeholderIncomeSyncJob
* @package App\Jobs
* 合作伙同数据同步
* Class StakeholderIncomeSyncCommand
* @package App\Console\Commands
*/
class
StakeholderIncomeSync
Job
implements
ShouldQueue
class
StakeholderIncomeSync
Command
extends
Command
{
use
Dispatchable
,
InteractsWithQueue
,
Queueable
,
SerializesModels
,
TaxReckon
;
/**
* The name and signature of the console command.
*
* @var string
*/
protected
$signature
=
'stakeholder:income:sync'
;
/**
* The console command description.
*
* @var string
*/
protected
$description
=
'权益人收益同步'
;
//常量定义
const
COUNT
=
1
;
const
BLOCK_TIME
=
3
;
const
BLOCK_TIME
=
1000
;
const
TYPE_BILLS
=
1001601
;
//账单分成
const
TYPE_ROYALTY
=
1001602
;
//合作伙伴打款 type = 1 版税分成
/**
* Create a new
job
instance.
* Create a new
command
instance.
*
* @return void
*/
public
function
__construct
()
{
Log
::
info
(
__METHOD__
.
"入账数据同步任务"
,
[
'time'
=>
now
()
->
toDateTimeString
()]
);
parent
::
__construct
(
);
}
/**
* Execute the
job
.
* Execute the
console command
.
*
* @return
void
* @return
int
*/
public
function
handle
()
{
...
...
@@ -61,6 +69,8 @@ class StakeholderIncomeSyncJob implements ShouldQueue
$id
=
key
(
$msg
[
$key
]);
$income_item
=
$msg
[
$key
][
$id
];
Log
::
channel
(
'api'
)
->
warning
(
__METHOD__
.
"streamid:
{
$id
}
-即将处理任务"
,
[
'income_item'
=>
$income_item
]);
$company
=
Company
::
query
()
->
find
(
$income_item
[
'company_id'
]);
$bills
=
Bills
::
query
()
->
find
(
$income_item
[
'related_id'
]);
$channel
=
'TME'
;
...
...
@@ -109,6 +119,8 @@ class StakeholderIncomeSyncJob implements ShouldQueue
}
}
}
echo
now
()
->
toDateTimeString
()
.
"
\r\n
"
;
}
}
}
...
...
app/Console/Kernel.php
View file @
f7cfd1e
...
...
@@ -3,6 +3,7 @@
namespace
App\Console
;
use
App\Console\Commands\DealSongIp
;
use
App\Console\Commands\StakeholderIncomeSyncCommand
;
use
Illuminate\Console\Scheduling\Schedule
;
use
Illuminate\Foundation\Console\Kernel
as
ConsoleKernel
;
...
...
@@ -15,6 +16,7 @@ class Kernel extends ConsoleKernel
*/
protected
$commands
=
[
DealSongIp
::
class
,
StakeholderIncomeSyncCommand
::
class
,
];
/**
...
...
Please
register
or
sign in
to post a comment