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
fe46b2f5
Commit
fe46b2f5
authored
May 21, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
税费和实收
parent
5c16e28b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
3 deletions
+69
-3
Finance.php
application/index/controller/Finance.php
+34
-0
OFee.php
application/model/OFee.php
+24
-0
OPartialCommission.php
application/model/OPartialCommission.php
+8
-2
route.php
application/route.php
+3
-1
No files found.
application/index/controller/Finance.php
View file @
fe46b2f5
...
@@ -601,4 +601,38 @@ class Finance extends Basic
...
@@ -601,4 +601,38 @@ class Finance extends Basic
$data
=
$m_partial
->
addCommission
(
$this
->
params
,
$this
->
userId
);
$data
=
$m_partial
->
addCommission
(
$this
->
params
,
$this
->
userId
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
/**
* 开票税费查询
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getTallAge
()
{
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
return
$this
->
response
(
101
,
'查询开票税费参数错误!'
);
}
$m_fee
=
new
OFee
();
$field
=
'a.id,a.fee,a.operation_date,b.scale,c.name,c.phone'
;
$data
=
$m_fee
->
getBargainFeeDetail
(
$this
->
params
[
'bargain_id'
],
1
,
$field
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
/**
* 新增开票
*
* @return \think\Response
* @throws \Exception
*/
public
function
addTallAge
()
{
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
return
$this
->
response
(
101
,
'新增实收参数错误'
);
}
$m_fee
=
new
OFee
();
$data
=
$m_fee
->
addFee
(
$this
->
params
[
'tallage'
],
$this
->
params
[
'bargain_id'
],
1
,
$this
->
userId
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
}
application/model/OFee.php
View file @
fe46b2f5
...
@@ -55,12 +55,35 @@ class OFee extends BaseModel
...
@@ -55,12 +55,35 @@ class OFee extends BaseModel
public
function
addFee
(
$data
,
$bargain_id
,
$type
=
0
,
int
$agent_id
)
{
public
function
addFee
(
$data
,
$bargain_id
,
$type
=
0
,
int
$agent_id
)
{
$insert_data
=
[];
$insert_data
=
[];
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$insert_data
[
$k
][
'id'
]
=
$v
[
'id'
];
$insert_data
[
$k
][
'bargain_id'
]
=
$bargain_id
;
$insert_data
[
$k
][
'bargain_id'
]
=
$bargain_id
;
$insert_data
[
$k
][
'fee'
]
=
$v
[
'fee'
];
$insert_data
[
$k
][
'fee'
]
=
$v
[
'fee'
];
$insert_data
[
$k
][
'agent_id'
]
=
$agent_id
;
$insert_data
[
$k
][
'agent_id'
]
=
$agent_id
;
$insert_data
[
$k
][
'type'
]
=
$type
;
$insert_data
[
$k
][
'type'
]
=
$type
;
$insert_data
[
$k
][
'operation_date'
]
=
$v
[
'operation_date'
];
$insert_data
[
$k
][
'operation_date'
]
=
$v
[
'operation_date'
];
}
}
return
$this
->
saveAll
(
$insert_data
);
return
$this
->
saveAll
(
$insert_data
);
}
}
/**
* 根据成交报告-实收佣金 或 税费开票 查询详情
*
* @param int $bargain_id
* @param int $type
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargainFeeDetail
(
int
$bargain_id
,
int
$type
=
0
,
string
$field
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'o_bargain b'
,
'a.bargain_id = b.id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agent_id = c.id'
,
'left'
)
->
where
(
'bargain_id'
,
$bargain_id
)
->
where
(
'type'
,
$type
)
->
select
();
}
}
}
\ No newline at end of file
application/model/OPartialCommission.php
View file @
fe46b2f5
...
@@ -113,21 +113,26 @@ class OPartialCommission extends BaseModel
...
@@ -113,21 +113,26 @@ class OPartialCommission extends BaseModel
}
}
/**
/**
* 增加实收佣金
* 增加
和编辑
实收佣金
*
*
* @param $data
* @param $data
* @param $agent_id
* @param $agent_id
* @return int|string
* @return int|string
*/
*/
public
function
addCommission
(
$data
,
$agent_id
)
{
public
function
addCommission
(
$data
,
$agent_id
)
{
$insert_data
[
'id'
]
=
$data
[
'id'
];
$insert_data
[
'bargain_id'
]
=
$data
[
'bargain_id'
];
$insert_data
[
'bargain_id'
]
=
$data
[
'bargain_id'
];
$insert_data
[
'practical_fee'
]
=
$data
[
'practical_fee'
];
$insert_data
[
'practical_fee'
]
=
$data
[
'practical_fee'
];
$insert_data
[
'cash'
]
=
$data
[
'cash'
];
$insert_data
[
'cash'
]
=
$data
[
'cash'
];
$insert_data
[
'service_charge'
]
=
$data
[
'service_charge'
];
$insert_data
[
'service_charge'
]
=
$data
[
'service_charge'
];
$insert_data
[
'tallage'
]
=
$data
[
'tallage'
];
$insert_data
[
'charity_fund'
]
=
$data
[
'charity_fund'
];
$insert_data
[
'charity_fund'
]
=
$data
[
'charity_fund'
];
$insert_data
[
'real_fee'
]
=
$data
[
'real_fee'
];
$insert_data
[
'real_fee'
]
=
$data
[
'real_fee'
];
$insert_data
[
'agent_id'
]
=
$agent_id
;
$insert_data
[
'agent_id'
]
=
$agent_id
;
if
(
empty
(
$insert_data
[
'id'
]))
{
return
$this
->
insert
(
$insert_data
);
return
$this
->
insert
(
$insert_data
);
}
else
{
return
$this
->
update
(
$insert_data
);
}
}
}
}
}
\ No newline at end of file
application/route.php
View file @
fe46b2f5
...
@@ -217,7 +217,9 @@ Route::group('index', [
...
@@ -217,7 +217,9 @@ Route::group('index', [
'phone_up_list'
=>
[
'index/remark/phone_up_list'
,
[
'method'
=>
'get|post'
]
],
//电话跟进列表
'phone_up_list'
=>
[
'index/remark/phone_up_list'
,
[
'method'
=>
'get|post'
]
],
//电话跟进列表
'selectReportAll'
=>
[
'index/Finance/selectReportAll'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'selectReportAll'
=>
[
'index/Finance/selectReportAll'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'partialCommissionList'
=>
[
'index/Finance/partialCommissionList'
,
[
'method'
=>
'get'
]
],
//分佣提成明细表
'partialCommissionList'
=>
[
'index/Finance/partialCommissionList'
,
[
'method'
=>
'get'
]
],
//分佣提成明细表
'addRealIncome'
=>
[
'index/Finance/addRealIncome'
,
[
'method'
=>
'POST'
]
],
//增加实收佣金
'addRealIncome'
=>
[
'index/Finance/addRealIncome'
,
[
'method'
=>
'POST'
]
],
//增加和编辑实收佣金
'getTallAge'
=>
[
'index/Finance/getTallAge'
,
[
'method'
=>
'GET'
]
],
//开票税费查询
'addTallAge'
=>
[
'index/Finance/addTallAge'
,
[
'method'
=>
'POST'
]
],
//新增和编辑开票税费
'test123'
=>
[
'index/WatchShop/test123'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'test123'
=>
[
'index/WatchShop/test123'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'agent_zhuan_aagent'
=>
[
'index/agent/agent_zhuan_aagent'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'agent_zhuan_aagent'
=>
[
'index/agent/agent_zhuan_aagent'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
...
...
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