Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_server_welfare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
187e0248
authored
Oct 10, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
恢复好友助力提现
parent
60020b50
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
11 deletions
app/Models/Assist.php
storage/laravels.json
storage/laravels.pid
app/Models/Assist.php
View file @
187e0248
...
...
@@ -4,6 +4,7 @@
namespace
App\Models
;
use
App\Http\Controllers\ExchangesTask
;
use
App\Http\Filters\QueryFilter
;
use
App\Tasks\IntegralBillTask
;
use
App\Tasks\SendNoticeTask
;
...
...
@@ -76,14 +77,32 @@ class Assist extends Model
if
(
$result
===
false
)
{
return
false
;
}
// //去判断是不是有两个好友助力了
// $assistCount = DB::table('user_exchanges')->where('id', $exchangeId)
// ->value('assist_count');
// //如果$assistCount=2,就代表是有两个好友助力,应该去判断是否自动提现
// //todo:但是由于目前微信的红包自动转账还没有申请下来,所以目前先不做处理
// if ($assistCount == 2) {
// //todo:还有一个问题就是提现成功后,要清除对应ic_welfare_assists里面的exchange_id的数据
// }
//去判断是不是有两个好友助力了
$assistCount
=
DB
::
table
(
'user_exchanges'
)
->
where
(
'id'
,
$exchangeId
)
->
value
(
'assist_count'
);
//如果$assistCount=2,就代表是有两个好友助力,应该去判断是否自动提现
if
(
$assistCount
==
2
)
{
//获取userExchange
$userExchange
=
DB
::
table
(
'user_exchanges'
)
->
where
(
'id'
,
$data
[
'exchange_id'
])
->
first
();
$userExchange
=
(
array
)
$userExchange
;
if
(
$userExchange
[
'amount'
]
<
20
&&
$userExchange
[
'type'
]
==
2
)
{
$ic_exchange_settings
[
'amount'
]
=
$userExchange
[
'amount'
];
$Task
=
new
ExchangesTask
(
$userExchange
,
$ic_exchange_settings
);
$Task
->
delay
(
5
);
$result
=
Task
::
deliver
(
$Task
);
if
(
!
$result
)
{
ErrorLog
(
ErrorCode
(
1
,
9
),
'提现任务推送失败,提现ID:'
.
$userExchange
[
'id'
]);
return
false
;
}
Log
::
info
(
'进行提现任务投递成功'
);
return
true
;
}
else
{
//如果是大于20块的,需要审核,这步就什么都不做
return
true
;
}
}
}
else
{
return
false
;
}
...
...
@@ -124,7 +143,7 @@ class Assist extends Model
public
function
sendNotice
(
$userId
)
{
$redis
=
new
RedisModel
();
$user
=
$redis
->
hget
(
'ic_user'
,
$userId
);
$user
=
$redis
->
hget
(
'ic_user'
,
$userId
);
if
(
$user
)
{
//发送通知
$task
=
new
SendNoticeTask
(
'IC_Code_Exchange'
,
$user
,
$userId
);
...
...
storage/laravels.json
View file @
187e0248
This diff is collapsed.
Click to expand it.
storage/laravels.pid
View file @
187e0248
21975
\ No newline at end of file
23271
\ No newline at end of file
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