Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
cd750195
authored
Jul 27, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整联营账期支付记录
parent
c7f7b535
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
4 deletions
app/Http/Controllers/CronController.php
app/Http/Controllers/CronController.php
View file @
cd750195
...
...
@@ -37,7 +37,8 @@ class CronController extends Controller
// 查询联营、自营线上支付记录
$pay_log_list
=
$PayLogModel
->
getPayLog
(
$start_time
,
$end_time
);
$pay_log_amount
=
$this
->
countByCurrency
(
$pay_log_list
);
// 统计金额
$pay_log
=
$this
->
filterJointAccounts
(
$pay_log_list
);
// 过滤掉联营账期 (账期金额根据erp_pay_log表统计)
$pay_log_amount
=
$this
->
countByCurrency
(
$pay_log
);
// 统计金额
// 联营线下支付记录
$joint_offline_list
=
$ErpPayLogModel
->
getErpPayLog
(
$start_time
,
$end_time
);
...
...
@@ -114,17 +115,47 @@ class CronController extends Controller
return
$RedisModel
->
get
(
'api_lx_activity_user_rank'
);
}
// 过滤掉联营账期
public
function
filterJointAccounts
(
$data
)
{
if
(
!
$data
)
return
false
;
$OrderModel
=
new
OrderModel
();
foreach
(
$data
as
$k
=>
$v
)
{
$map
=
[];
$map
[
'order_id'
]
=
$v
[
'order_id'
];
$map
[
'order_goods_type'
]
=
1
;
$map
[
'order_pay_type'
]
=
3
;
$order
=
$OrderModel
->
where
(
$map
)
->
select
(
'order_id'
)
->
first
();
if
(
$order
)
{
unset
(
$data
[
$k
]);
continue
;
}
}
return
$data
;
}
// 过滤联营线下支付数据
public
function
filterData
(
$data
)
{
if
(
!
$data
)
return
false
;
$OrderModel
=
new
OrderModel
();
$PayLogModel
=
new
PayLogModel
();
foreach
(
$data
as
$k
=>
$v
)
{
$pay_log
=
$PayLogModel
->
where
([
'order_id'
=>
$v
[
'order_id'
]])
->
select
(
'pay_log_id'
)
->
first
();
$order
=
$OrderModel
->
where
(
'order_id'
,
$v
[
'order_id'
])
->
where
(
'order_goods_type'
,
1
)
->
where
(
'order_pay_type'
,
'<>'
,
3
)
->
first
();
if
(
!
$order
)
continue
;
$pay_log
=
$PayLogModel
->
where
(
'order_id'
,
$v
[
'order_id'
])
->
select
(
'pay_log_id'
)
->
first
();
// 若pay_log表里已存在订单支付记录,则说明该订单已收款完成,需要清除
// 若
非账期且
pay_log表里已存在订单支付记录,则说明该订单已收款完成,需要清除
if
(
$pay_log
)
{
unset
(
$data
[
$k
]);
continue
;
...
...
@@ -203,7 +234,7 @@ class CronController extends Controller
$temp
=
json_decode
(
curlApi
(
$url
,
$check
,
"POST"
),
true
);
return
isset
(
$temp
[
'data'
])
?
$temp
[
'data'
]
:
6.9
;
return
isset
(
$temp
[
'data'
])
&&
$temp
[
'data'
]
?
$temp
[
'data'
]
:
6.9
;
}
// 清除用户表数据和缓存数据
...
...
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