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
700c9398
Commit
700c9398
authored
Apr 11, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整出账导出
parent
586e3740
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
22 deletions
+63
-22
Finance.php
application/index/controller/Finance.php
+63
-22
No files found.
application/index/controller/Finance.php
View file @
700c9398
...
...
@@ -13,6 +13,7 @@ use app\api\service\ConvertCouponService;
use
app\api\service\CouponService
;
use
app\api_broker\service\OrderLogService
;
use
app\api_broker\service\PayLogService
;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\VipService
;
use
app\index\extend\Basic
;
use
app\index\untils\ExportExcelUntil
;
...
...
@@ -3767,7 +3768,7 @@ class Finance extends Basic
*/
public
function
adjustment
()
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
"adjustment"
);
//
return view("adjustment");
}
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
...
...
@@ -3896,33 +3897,73 @@ class Finance extends Basic
$where
[
'b.order_id'
]
=
$this
->
params
[
'march_id'
];
}
$field
=
'a.create_time,a.id,b.order_id,a.paylog_id,a.money,b.income_time,a.type,a.new_paylog_id,a.operation_id,b.order_id,e.house_id'
;
$list
=
$m_paylog
->
getAdjustmentListLimit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$m_paylog
->
getAdjustmentListTotal
(
$where
);
$m_agent
=
new
AAgents
();
$field
=
'a.create_time,a.id,b.order_id,e.house_id,a.paylog_id,a.money,b.income_time,a.type,a.new_paylog_id,a.operation_id'
;
$m_house
=
new
GHouses
();
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'name'
]
=
$m_agent
->
getAgentsById
(
$v
[
'operation_id'
],
'name'
);
if
(
$v
[
'house_id'
])
{
$house_data
=
$m_house
->
getHouseDetail
(
'id,internal_address'
,
[
'id'
=>
$v
[
'house_id'
]]);
$list
[
$k
][
'house_id'
]
=
$house_data
[
'id'
];
$list
[
$k
][
'address'
]
=
$house_data
[
'internal_address'
];
$redis_service
=
new
RedisCacheService
();
if
(
empty
(
$this
->
params
[
'excel'
]))
{
$list
=
$m_paylog
->
getAdjustmentListLimit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$m_paylog
->
getAdjustmentListTotal
(
$where
);
//加时间条件
if
(
$is_show
)
{
$data
[
'money_total'
]
=
$m_paylog
->
getMoneyTotal
(
$where
,
'a.money'
);
//总额
}
else
{
$list
[
$k
][
'house_id'
]
=
''
;
$list
[
$k
][
'address'
]
=
''
;
$data
[
'money_total'
]
=
''
;
}
}
//加时间条件
if
(
$is_show
)
{
$data
[
'money_total'
]
=
$m_paylog
->
getMoneyTotal
(
$where
,
'a.money'
);
//总额
foreach
(
$list
as
$k
=>
$v
)
{
if
(
$v
[
'operation_id'
])
{
$agent_data
=
$redis_service
->
getRedisCache
(
2
,
$v
[
'operation_id'
]);
$list
[
$k
][
'name'
]
=
$agent_data
[
'name'
];
}
if
(
$v
[
'house_id'
])
{
$house_data
=
$m_house
->
getHouseDetail
(
'id,internal_address'
,
[
'id'
=>
$v
[
'house_id'
]]);
$list
[
$k
][
'house_id'
]
=
$house_data
[
'id'
];
$list
[
$k
][
'address'
]
=
$house_data
[
'internal_address'
];
}
else
{
$list
[
$k
][
'house_id'
]
=
''
;
$list
[
$k
][
'address'
]
=
''
;
}
}
$data
[
'list'
]
=
$list
;
$data
[
'list'
]
=
$this
->
numberTransitionString
(
$data
[
'list'
]);
}
else
{
$data
[
'money_total'
]
=
''
;
$list
=
$m_paylog
->
getAdjustmentListLimit
(
1
,
40000
,
$order_
=
'a.id desc'
,
$field
,
$where
);
if
(
!
empty
(
$list
))
{
$excel_data
=
[];
foreach
(
$list
as
$k
=>
$v
)
{
$excel_data
[
$k
][
'create_time'
]
=
$v
[
'create_time'
];
$excel_data
[
$k
][
'id'
]
=
$v
[
'id'
];
$excel_data
[
$k
][
'order_id'
]
=
$v
[
'order_id'
];
$excel_data
[
$k
][
'paylog_id'
]
=
$v
[
'paylog_id'
];
if
(
$v
[
'house_id'
])
{
$house_data
=
$m_house
->
getHouseDetail
(
'id,internal_address'
,
[
'id'
=>
$v
[
'house_id'
]]);
$excel_data
[
$k
][
'house_id'
]
=
$house_data
[
'id'
];
$excel_data
[
$k
][
'address'
]
=
$house_data
[
'internal_address'
];
}
else
{
$excel_data
[
$k
][
'house_id'
]
=
''
;
$excel_data
[
$k
][
'address'
]
=
''
;
}
$excel_data
[
$k
][
'money'
]
=
$v
[
'money'
];
$excel_data
[
$k
][
'income_time'
]
=
$v
[
'income_time'
];
$excel_data
[
$k
][
'type'
]
=
$v
[
'type'
];
$excel_data
[
$k
][
'new_paylog_id'
]
=
$v
[
'new_paylog_id'
];
if
(
$v
[
'operation_id'
])
{
$agent_data
=
$redis_service
->
getRedisCache
(
2
,
$v
[
'operation_id'
]);
$excel_data
[
$k
][
'name'
]
=
$agent_data
[
'name'
];
}
}
$export
=
new
ExportExcelUntil
();
$title
=
[
'提交时间'
,
'调整ID'
,
'调整前带看ID'
,
'调整前收款ID'
,
'调整前商铺ID'
,
'调整前商铺地址'
,
'调整金额'
,
'入账日期'
,
'调整类型'
,
'调整后收款ID'
,
'提交人'
];
$export
->
exportTable
(
'调整出账'
,
$excel_data
,
10
,
'调整出账'
,
$title
);
}
}
$data
[
'list'
]
=
$list
;
$data
[
'list'
]
=
$this
->
numberTransitionString
(
$data
[
'list'
]);
}
catch
(
\Exception
$e
)
{
$code
=
101
;
$msg
=
'内部错误:'
.
$e
->
getMessage
();
...
...
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