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
713faeb4
Commit
713faeb4
authored
Dec 17, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
财务日报
parent
34f3f489
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
13 deletions
+121
-13
DailyPaper.php
application/api_broker/controller/DailyPaper.php
+2
-2
DailyPaperService.php
application/api_broker/service/DailyPaperService.php
+94
-11
OPayLogModel.php
application/model/OPayLogModel.php
+25
-0
No files found.
application/api_broker/controller/DailyPaper.php
View file @
713faeb4
...
@@ -31,12 +31,12 @@ class DailyPaper extends Basic
...
@@ -31,12 +31,12 @@ class DailyPaper extends Basic
*/
*/
public
function
dailyDetail
(){
public
function
dailyDetail
(){
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"store_id" => 73,//门店id
"store_id" => 73,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2018-12-01"
"daily_data" => "2018-12-01"
);
);
$this
->
agentId
=
74
;
$this->agentId = 74;
*/
if
(
!
isset
(
$params
[
"store_id"
])
||
!
isset
(
$params
[
"is_store"
])
||
!
isset
(
$params
[
"daily_data"
])){
if
(
!
isset
(
$params
[
"store_id"
])
||
!
isset
(
$params
[
"is_store"
])
||
!
isset
(
$params
[
"daily_data"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
...
...
application/api_broker/service/DailyPaperService.php
View file @
713faeb4
...
@@ -70,9 +70,10 @@ class DailyPaperService
...
@@ -70,9 +70,10 @@ class DailyPaperService
$result
[
"commit_info"
]
=
$daily_info
[
0
];
$result
[
"commit_info"
]
=
$daily_info
[
0
];
}
else
{
}
else
{
$result
[
"is_commit"
]
=
0
;
$result
[
"is_commit"
]
=
0
;
//todo 统计各金额
//todo 直接返回数据,没提交的没有财务审核无需向后走
//todo 直接返回数据,没提交的没有财务审核无需向后走
//todo 统计各金额
$result
[
"total_info"
]
=
$this
->
getTotal
(
$store_id
,
$daily_data
);
return
[
"code"
=>
200
,
"data"
=>
$result
];
}
}
break
;
break
;
case
1
:
case
1
:
...
@@ -89,22 +90,101 @@ class DailyPaperService
...
@@ -89,22 +90,101 @@ class DailyPaperService
if
(
count
(
$checkList
)
>
0
)
{
if
(
count
(
$checkList
)
>
0
)
{
$result
[
"check_list"
]
=
$checkList
;
$result
[
"check_list"
]
=
$checkList
;
}
}
//todo 获取各个list
//todo 获取各个list
$result
[
"list"
]
=
$this
->
getPayLogList
(
$store_id
);
$result
[
"list"
]
=
$this
->
getPayLogList
(
$store_id
,
$daily_data
);
//todo 统计各金额
$result
[
"total_info"
]
=
$this
->
getTotal
(
$store_id
,
$daily_data
);
return
[
"code"
=>
200
,
"data"
=>
$result
];
return
[
"code"
=>
200
,
"data"
=>
$result
];
}
}
/**
* 获取总数
* @param $store_id
* @return array|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private
function
getTotal
(
$store_id
,
$daily_data
)
{
$ids
=
$this
->
getAgentsByStoreId
(
$store_id
);
if
(
!
$ids
)
{
return
null
;
}
//中介费入账
$field
=
"sum(money) as money,pay_type"
;
$params
[
"agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"is_del"
]
=
0
;
$params
[
"create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$payLogModel
=
new
OPayLogModel
();
$total_arr
=
$payLogModel
->
getTotal
(
$field
,
$params
,
"pay_type"
);
$total
[
"alipay"
]
=
0
;
$total
[
"tenpay"
]
=
0
;
$total
[
"pos"
]
=
0
;
$total
[
"realty_pay"
]
=
0
;
$total
[
"family_pay"
]
=
0
;
$total
[
"private_bank"
]
=
0
;
$total
[
"cash"
]
=
0
;
$total
[
"other_bank"
]
=
0
;
if
(
count
(
$total_arr
)
<=
0
)
{
return
$total
;
}
foreach
(
$total_arr
as
$item
)
{
switch
(
$item
[
"pay_type"
])
{
case
10
:
$total
[
"alipay1"
]
=
$item
[
"money"
];
break
;
case
11
:
$total
[
"alipay2"
]
=
$item
[
"money"
];
break
;
case
20
:
$total
[
"tenpay1"
]
=
$item
[
"money"
];
break
;
case
21
:
$total
[
"tenpay2"
]
=
$item
[
"money"
];
break
;
case
30
:
$total
[
"pos"
]
=
$item
[
"money"
];
break
;
case
40
:
$total
[
"realty_pay"
]
=
$item
[
"money"
];
break
;
case
41
:
$total
[
"family_pay"
]
=
$item
[
"money"
];
break
;
case
42
:
$total
[
"private_bank"
]
=
$item
[
"money"
];
break
;
case
50
:
$total
[
"cash"
]
=
$item
[
"money"
];
break
;
case
60
:
$total
[
"other_bank"
]
=
$item
[
"money"
];
break
;
}
}
$total
[
"alipay"
]
=
$total
[
"alipay1"
]
+
$total
[
"alipay2"
];
$total
[
"tenpay"
]
=
$total
[
"tenpay1"
]
+
$total
[
"tenpay2"
];
unset
(
$total
[
"alipay1"
]);
unset
(
$total
[
"alipay2"
]);
unset
(
$total
[
"tenpay1"
]);
unset
(
$total
[
"tenpay2"
]);
return
$total
;
}
/**
/**
* 获取各个状态的记录
* 获取各个状态的记录
* @param $store_id
* @param $store_id
* @param $daily_data
* @return null
* @return null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
private
function
getPayLogList
(
$store_id
)
private
function
getPayLogList
(
$store_id
,
$daily_data
)
{
{
$ids
=
$this
->
getAgentsByStoreId
(
$store_id
);
$ids
=
$this
->
getAgentsByStoreId
(
$store_id
);
if
(
!
$ids
)
{
if
(
!
$ids
)
{
...
@@ -115,6 +195,7 @@ class DailyPaperService
...
@@ -115,6 +195,7 @@ class DailyPaperService
$field
=
"a.id,c.id as bargain_id,b.house_id,c.price,a.money,a.pay_type,a.transfer_name,
$field
=
"a.id,c.id as bargain_id,b.house_id,c.price,a.money,a.pay_type,a.transfer_name,
d.report_agent_id as agent_id,c.is_open,a.is_dividend,a.receipt_number,a.create_time"
;
d.report_agent_id as agent_id,c.is_open,a.is_dividend,a.receipt_number,a.create_time"
;
$params
[
"a.agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"a.agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"a.create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.type"
]
=
91
;
$params
[
"a.type"
]
=
91
;
$params
[
"c.father_id"
]
=
0
;
$params
[
"c.father_id"
]
=
0
;
...
@@ -199,9 +280,10 @@ class DailyPaperService
...
@@ -199,9 +280,10 @@ class DailyPaperService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
private
function
agentInfo
(
$agent_id_str
){
private
function
agentInfo
(
$agent_id_str
)
$params
[
"a.id"
]
=
array
(
"in"
,(
$agent_id_str
));
{
return
$this
->
aAgentsModel
->
getAgentsInfoByAgentId
(
"a.id,a.name,b.store_name"
,
$params
);
$params
[
"a.id"
]
=
array
(
"in"
,
(
$agent_id_str
));
return
$this
->
aAgentsModel
->
getAgentsInfoByAgentId
(
"a.id,a.name,b.store_name"
,
$params
);
}
}
/**
/**
...
@@ -211,10 +293,11 @@ class DailyPaperService
...
@@ -211,10 +293,11 @@ class DailyPaperService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
private
function
houseInfo
(
$house_id_str
){
private
function
houseInfo
(
$house_id_str
)
{
$houseModel
=
new
GHouses
();
$houseModel
=
new
GHouses
();
$params
[
"id"
]
=
array
(
"in"
,(
$house_id_str
));
$params
[
"id"
]
=
array
(
"in"
,
(
$house_id_str
));
return
$houseModel
->
getHouseInfo
(
"id,internal_address"
,
$params
);
return
$houseModel
->
getHouseInfo
(
"id,internal_address"
,
$params
);
}
}
/**
/**
...
...
application/model/OPayLogModel.php
View file @
713faeb4
...
@@ -494,6 +494,14 @@ class OPayLogModel extends Model
...
@@ -494,6 +494,14 @@ class OPayLogModel extends Model
}
}
/**
* @param $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectAdjustmentList
(
$filed
,
$params
)
public
function
selectAdjustmentList
(
$filed
,
$params
)
{
{
return
$this
->
db_
->
field
(
$filed
)
return
$this
->
db_
->
field
(
$filed
)
...
@@ -504,6 +512,23 @@ class OPayLogModel extends Model
...
@@ -504,6 +512,23 @@ class OPayLogModel extends Model
->
select
();
->
select
();
}
}
/**
* @param $filed
* @param $params
* @param $group
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getTotal
(
$filed
,
$params
,
$group
){
return
$this
->
db_
->
field
(
$filed
)
->
where
(
$params
)
->
group
(
$group
)
->
select
();
}
/**
/**
* @param $field
* @param $field
* @param $where
* @param $where
...
...
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