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
9720a4ca
Commit
9720a4ca
authored
Dec 17, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
e3e20554
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
DailyPaperService.php
application/api_broker/service/DailyPaperService.php
+35
-0
DailyPaper.php
application/index/controller/DailyPaper.php
+1
-1
OPayLogModel.php
application/model/OPayLogModel.php
+24
-0
No files found.
application/api_broker/service/DailyPaperService.php
View file @
9720a4ca
...
...
@@ -63,6 +63,11 @@ class DailyPaperService
$daily_info
=
$this
->
getDailyInfo
(
$agent_id
,
$daily_data
);
//todo 获取各个list
$result
[
"list"
]
=
$this
->
getPayLogList
(
$store_id
,
$daily_data
);
//todo 统计入账出账等
$sum_info
=
$this
->
getSum
(
$store_id
,
$daily_data
);
$result
[
"recorded_money"
]
=
$sum_info
[
"sum_arr"
];
$result
[
"adjustment_money"
]
=
$sum_info
[
"adjustment_arr"
];
$result
[
"remittance_money"
]
=
$result
[
"recorded_money"
]
-
$result
[
"adjustment_money"
];
$result
[
"is_commit"
]
=
1
;
switch
(
$is_store
)
{
...
...
@@ -104,6 +109,36 @@ class DailyPaperService
}
/**
* @param $store_id
* @param $daily_data
* @return null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private
function
getSum
(
$store_id
,
$daily_data
)
{
$ids
=
$this
->
getAgentsByStoreId
(
$store_id
);
if
(
!
$ids
)
{
return
null
;
}
//中介费入账
$field
=
"money"
;
$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
();
$info
[
"sum_arr"
]
=
$payLogModel
->
getSum
(
$field
,
$params
);
$field_adjustment
=
"b.money"
;
$params_adjustment
[
"a.agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params_adjustment
[
"b.is_del"
]
=
0
;
$params_adjustment
[
"b.create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$info
[
"adjustment_arr"
]
=
$payLogModel
->
getAdjustmentSum
(
$field_adjustment
,
$params_adjustment
);
return
$info
;
}
/**
* 获取总数
* @param $store_id
...
...
application/index/controller/DailyPaper.php
View file @
9720a4ca
...
...
@@ -33,7 +33,7 @@ class DailyPaper extends Basic
public
function
dailyDetail
()
{
$params
=
$this
->
params
;
/*
$params = array(
/*
$params = array(
"store_id" => 730,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2018-12-01"
...
...
application/model/OPayLogModel.php
View file @
9720a4ca
...
...
@@ -483,6 +483,30 @@ class OPayLogModel extends Model
->
select
();
}
/**
* @param $filed
* @param $params
* @return float|int
*/
public
function
getSum
(
$filed
,
$params
){
return
$this
->
db_
->
where
(
$params
)
->
sum
(
$filed
);
}
/**
* @param $filed
* @param $params
* @return float|int
*/
public
function
getAdjustmentSum
(
$filed
,
$params
){
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
'o_paylog_adjustment b'
,
'a.id=b.new_paylog_id'
)
->
where
(
$params
)
->
sum
(
$filed
);
}
/**
* @param $field
* @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