Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
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
hujun
tl_estate
Commits
d2aa2762
Commit
d2aa2762
authored
Jul 31, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4523f070
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
38 deletions
+43
-38
PayLogService.php
application/api_broker/service/PayLogService.php
+43
-38
No files found.
application/api_broker/service/PayLogService.php
View file @
d2aa2762
...
...
@@ -431,93 +431,97 @@ class PayLogService
case
2
://
部门
和公司都可以看全部
break
;
case
3
://
门店
$vModel
=
new
VerifyService
();
$agentArr
=
$vModel
->
getAgentsByAgentIdAndType
(
$params
[
"agent_id"
],
$check_type
);
$vModel
=
new
VerifyService
();
$agentArr
=
$vModel
->
getAgentsByAgentIdAndType
(
$params
[
"agent_id"
],
$check_type
);
$conditions
[
"a.agent_id"
]
=
array
(
"in"
,
$agentArr
);
break
;
default
:
return
""
;
}
return
$this
->
payLogModel
->
getPayLogList
(
$conditions
,
$field
,
$pageNo
,
$pageSize
);
return
$this
->
payLogModel
->
getPayLogList
(
$conditions
,
$field
,
$pageNo
,
$pageSize
);
}
/**
* 收款详情
*
* @return \think\Response
*/
public
function
getCollectionDetail
(
$pay_id
)
{
public
function
getCollectionDetail
(
$pay_id
)
{
$pay_data
=
[];
try
{
$m_pay
=
new
OPayLogModel
();
$m_bargain
=
new
OBargainModel
();
$m_pay
=
new
OPayLogModel
();
$m_bargain
=
new
OBargainModel
();
$pay_fields
=
'id,order_id,agent_name,create_time,income_time,house_number,type,real_money,income_time,
transfer_name,bargain_id,agent_id,transaction_fee,is_dividend,receipt_number,source,pay_type,last_transfer_time,
money,industry_type,received_money,type_ext,is_open,open_time'
;
$pay_data
=
$m_pay
->
selectReceiptImgList
(
$pay_fields
,
[
'id'
=>
$pay_id
]);
$pay_data
=
$pay_data
[
0
];
$pay_data
=
$m_pay
->
selectReceiptImgList
(
$pay_fields
,
[
'id'
=>
$pay_id
]);
$pay_data
=
$pay_data
[
0
];
//成交报告id
if
(
empty
(
$pay_data
[
'bargain_id'
]))
{
$pay_data
[
'bargain_id'
]
=
""
;
$pay_data
[
'is_open'
]
=
0
;
$pay_data
[
'price'
]
=
0
;
$pay_data
[
'is_open'
]
=
0
;
$pay_data
[
'price'
]
=
0
;
}
else
{
$bargain_where
[
'father_id'
]
=
0
;
$bargain_where
[
'id'
]
=
$pay_data
[
'bargain_id'
];
$price
=
$m_bargain
->
getFieldValue
(
'price'
,
$bargain_where
);
$pay_data
[
'price'
]
=
empty
(
$price
)
?
0
:
$price
;
$bargain_where
[
'id'
]
=
$pay_data
[
'bargain_id'
];
$price
=
$m_bargain
->
getFieldValue
(
'price'
,
$bargain_where
);
$pay_data
[
'price'
]
=
empty
(
$price
)
?
0
:
$price
;
$m_order
=
new
OrderModel
();
$house_data
=
$m_order
->
selectOrderByOrderId
(
'b.id,b.internal_address,a.f_id'
,
[
'order_id'
=>
$pay_data
[
'order_id'
]]);
$m_order
=
new
OrderModel
();
$house_data
=
$m_order
->
selectOrderByOrderId
(
'b.id,b.internal_address,a.f_id'
,
[
'order_id'
=>
$pay_data
[
'order_id'
]]);
$pay_data
[
'house_id'
]
=
empty
(
$house_data
[
0
][
'id'
])
?
''
:
$house_data
[
0
][
'id'
];
$pay_data
[
'address'
]
=
empty
(
$house_data
[
0
][
'internal_address'
])
?
''
:
$house_data
[
0
][
'internal_address'
];
$pay_data
[
'house_id'
]
=
empty
(
$house_data
[
0
][
'id'
])
?
''
:
$house_data
[
0
][
'id'
];
$pay_data
[
'address'
]
=
empty
(
$house_data
[
0
][
'internal_address'
])
?
''
:
$house_data
[
0
][
'internal_address'
];
}
$m_pay_adjustment
=
new
OPayLogAdjustment
();
$source_id
=
$m_pay_adjustment
->
getFieldColumn
(
'id'
,
[
'paylog_id'
=>
$pay_data
[
'id'
]]);
$m_pay_adjustment
=
new
OPayLogAdjustment
();
$source_id
=
$m_pay_adjustment
->
getFieldColumn
(
'id'
,
[
'paylog_id'
=>
$pay_data
[
'id'
]]);
$pay_data
[
'source_id'
]
=
empty
(
$source_id
)
?
0
:
implode
(
','
,
$source_id
);
$m_refund
=
new
ORefundModel
();
$num
=
$m_refund
->
getFind
(
'id'
,[
'pay_log_id'
=>
$pay_data
[
'id'
],
'is_del'
=>
0
]);
$num
=
$m_refund
->
getFind
(
'id'
,
[
'pay_log_id'
=>
$pay_data
[
'id'
],
'is_del'
=>
0
]);
if
(
$num
[
'id'
]
>
0
)
{
$pay_data
[
'is_refund'
]
=
1
;
}
else
{
$pay_data
[
'is_refund'
]
=
0
;
}
$m_report
=
new
OReportModel
();
$m_report
=
new
OReportModel
();
$pay_data
[
'current_agent_name'
]
=
$pay_data
[
'store_name'
]
=
""
;
if
((
$pay_data
[
'type'
]
==
92
||
$pay_data
[
'type'
]
==
91
)
&&
$pay_data
[
'bargain_id'
]
>
0
)
{
$where
[]
=
[
'EXP'
,
'a.id ='
.
$pay_data
[
'bargain_id'
]
.
' or father_id='
.
$pay_data
[
'bargain_id'
]];
$where
[
'a.status'
]
=
[
'in'
,
'10,11,13'
];
$where
[
'a.role'
]
=
[
'in'
,
'3,4,5'
];
$bargain_data
=
$m_bargain
->
agentBargainAll
(
'a.role,a.scale,b.name'
,
$where
);
$role_arr
=
[
1
=>
'盘方'
,
2
=>
'客方'
,
3
=>
'反签'
,
4
=>
'独家'
,
5
=>
'合作方'
,
6
=>
'APP盘下载方'
,
7
=>
'APP客下载方'
];
$name
=
''
;
foreach
(
$bargain_data
as
$k
=>
$v
)
{
$name
.=
$v
[
'name'
]
.
'('
.
$role_arr
[
$v
[
'role'
]]
.
$v
[
'scale'
]
.
'%),'
;
$where
[]
=
[
'EXP'
,
'a.id ='
.
$pay_data
[
'bargain_id'
]
.
' or father_id='
.
$pay_data
[
'bargain_id'
]];
$where
[
'a.status'
]
=
[
'in'
,
'10,11,13'
];
$where
[
'a.role'
]
=
[
'in'
,
'3,4,5'
];
$bargain_data
=
$m_bargain
->
agentBargainAll
(
'a.role,a.scale,b.name'
,
$where
);
$role_arr
=
[
1
=>
'盘方'
,
2
=>
'客方'
,
3
=>
'反签'
,
4
=>
'独家'
,
5
=>
'合作方'
,
6
=>
'APP盘下载方'
,
7
=>
'APP客下载方'
];
$name
=
''
;
foreach
(
$bargain_data
as
$k
=>
$v
)
{
$name
.=
$v
[
'name'
]
.
'('
.
$role_arr
[
$v
[
'role'
]]
.
$v
[
'scale'
]
.
'%),'
;
}
$pay_data
[
'current_agent_name'
]
=
rtrim
(
$name
,
','
);
$pay_data
[
'current_agent_name'
]
=
rtrim
(
$name
,
','
);
}
if
((
$pay_data
[
'type'
]
==
10
||
$pay_data
[
'type'
]
==
30
)
&&
isset
(
$house_data
[
0
][
'f_id'
]))
{
$current_agent_name
=
$m_report
->
selectReportById
(
'report_agent_name,report_store_id'
,
[
'id'
=>
$house_data
[
0
][
'f_id'
]]);
$current_agent_name
=
$m_report
->
selectReportById
(
'report_agent_name,report_store_id'
,
[
'id'
=>
$house_data
[
0
][
'f_id'
]]);
$pay_data
[
'current_agent_name'
]
=
empty
(
$current_agent_name
[
0
][
'report_agent_name'
])
?
""
:
$current_agent_name
[
0
][
'report_agent_name'
];
}
$pay_data
[
'site_id'
]
=
''
;
$pay_data
[
'site_id'
]
=
''
;
if
(
$pay_data
[
'agent_id'
])
{
$redis_service
=
new
RedisCacheService
();
$agent_data
=
$redis_service
->
getRedisCache
(
2
,
$pay_data
[
'agent_id'
]);
$redis_service
=
new
RedisCacheService
();
$agent_data
=
$redis_service
->
getRedisCache
(
2
,
$pay_data
[
'agent_id'
]);
$pay_data
[
'site_id'
]
=
$agent_data
[
'site_id'
];
}
$pay_data
[
"img_path"
]
=
CHAT_IMG_URL
;
$pay_data
[
"img_arr"
]
=
$this
->
getOImg
(
$pay_id
,
3
);
$pay_data
[
'open_time'
]
=
empty
(
$pay_data
[
'open_time'
])
?
''
:
$pay_data
[
'open_time'
];
$pay_data
[
'open_time'
]
=
empty
(
$pay_data
[
'open_time'
])
?
''
:
$pay_data
[
'open_time'
];
}
catch
(
\Exception
$e
)
{
return
null
;
return
null
;
}
return
$pay_data
;
return
$pay_data
;
}
}
\ 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