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
0c91faa2
Commit
0c91faa2
authored
Sep 06, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改成交报告分佣方-方法优化
parent
d7843f65
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
122 additions
and
1 deletion
+122
-1
Finance.php
application/index/controller/Finance.php
+92
-0
OBargainModel.php
application/model/OBargainModel.php
+29
-0
route.php
application/route.php
+1
-1
No files found.
application/index/controller/Finance.php
View file @
0c91faa2
...
@@ -2705,6 +2705,98 @@ class Finance extends Basic
...
@@ -2705,6 +2705,98 @@ class Finance extends Basic
return
$this
->
response
(
200
,
'修改成功'
,
$data
);
return
$this
->
response
(
200
,
'修改成功'
,
$data
);
}
}
/**
* 成交报告分佣方详情
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getBargainCommissionV2
()
{
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
return
$this
->
response
(
101
,
'成交报告id为空'
);
}
$field
=
'a.id,a.scale,a.agent_id,a.role,a.scale_fee,b.scale as new_scale,b.should_commission,a.father_id,a.create_time,c.income_time'
;
$data
=
$this
->
m_bargain
->
getBargainPartialRealDetail
(
$field
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]]);
if
(
empty
(
$data
))
{
return
$this
->
response
(
101
,
'没有记录'
);
}
if
(
$this
->
request
->
isGet
())
{
$data
[
'scale'
]
=
empty
(
$data
[
'new_scale'
])
?
$data
[
'scale'
]
:
$data
[
'new_scale'
];
$data
[
'scale_fee'
]
=
empty
(
$data
[
'should_commission'
])
?
$data
[
'scale_fee'
]
:
$data
[
'should_commission'
];
$s_redis
=
new
RedisCacheService
();
$agent_data
=
$s_redis
->
getRedisCache
(
2
,
$data
[
'agent_id'
]);
$data
[
'district_name'
]
=
$agent_data
[
'district_name'
];
$data
[
'store_name'
]
=
$agent_data
[
'store_name'
];
$data
[
'name'
]
=
$agent_data
[
'name'
];
$data
[
'phone'
]
=
$agent_data
[
'phone'
];
$data
[
'store_id'
]
=
$agent_data
[
'store_id'
];
$data
[
'district_id'
]
=
$agent_data
[
'district_id'
];
return
$this
->
response
(
200
,
''
,
$data
);
}
if
(
empty
(
$this
->
params
[
'agent_id'
]))
{
return
$this
->
response
(
101
,
'经纪人id为空'
);
}
if
(
empty
(
$this
->
params
[
'scale'
]))
{
return
$this
->
response
(
101
,
'分佣比例为空'
);
}
$update
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$update
[
'scale'
]
=
$this
->
params
[
'scale'
];
$update
[
'role'
]
=
$this
->
params
[
'role'
];
$update
[
'scale_fee'
]
=
$this
->
params
[
'scale_fee'
];
$num
=
$this
->
m_bargain
->
updateBargainById
(
$this
->
params
[
'bargain_id'
],
$update
);
//更改分佣方
if
(
!
$num
)
{
return
$this
->
response
(
101
,
'修改失败'
);
}
$comm
=
new
OPartialCommission
();
$partial_data
[
'scale'
]
=
$this
->
params
[
'scale'
];
$partial_data
[
'role'
]
=
$this
->
params
[
'role'
];
$partial_data
[
'should_commission'
]
=
$this
->
params
[
'scale_fee'
];
$partial_data
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$comm
->
editData
(
$partial_data
,
$this
->
params
[
'bargain_id'
],
'bargain_id'
);
/*记录日志 start*/
$father_id
=
$this
->
params
[
'bargain_id'
];
if
(
$data
[
'father_id'
]
==
0
)
{
$father_id
=
$data
[
'father_id'
];
}
$content
=
''
;
if
(
$data
[
'agent_id'
]
!=
$this
->
params
[
'agent_id'
])
{
$redis
=
new
RedisCacheService
();
$old_agent
=
$redis
->
getRedisCache
(
2
,
$data
[
'agent_id'
]);
$this
->
totalOfficialReceiptsV2
(
$old_agent
[
'id'
],
$old_agent
[
'district_id'
],
$old_agent
[
'store_id'
],
$data
[
'create_time'
],
$data
[
'income_time'
]);
$content
.=
'【分佣方:'
.
$old_agent
[
'name'
]
.
'-'
.
$old_agent
[
'phone'
]
.
'】'
;
$new_agent
=
$redis
->
getRedisCache
(
2
,
$this
->
params
[
'agent_id'
]);
$this
->
totalOfficialReceiptsV2
(
$new_agent
[
'id'
],
$new_agent
[
'district_id'
],
$new_agent
[
'store_id'
],
$data
[
'create_time'
],
$data
[
'income_time'
]);
$content
.=
'【修改为:'
.
$new_agent
[
'name'
]
.
'-'
.
$new_agent
[
'phone'
]
.
'】'
;
}
if
(
$this
->
params
[
'scale'
]
!=
$data
[
'scale'
])
{
$content
.=
'【分佣比例修改为:'
.
$this
->
params
[
'scale'
]
.
'】'
;
}
if
(
$this
->
params
[
'scale_fee'
]
!=
$data
[
'scale_fee'
])
{
$content
.=
'【应分佣金修改为:'
.
$this
->
params
[
'scale_fee'
]
.
'】'
;
}
if
(
!
empty
(
$content
))
{
$this
->
editRecordLog
(
$father_id
,
'【编号:'
.
$father_id
.
'】'
.
$content
);
}
/*记录日志 end*/
return
$this
->
response
(
200
,
'修改成功'
);
}
/**
/**
* 撤销成交报告
* 撤销成交报告
*
*
...
...
application/model/OBargainModel.php
View file @
0c91faa2
...
@@ -1729,4 +1729,32 @@ class OBargainModel extends Model
...
@@ -1729,4 +1729,32 @@ class OBargainModel extends Model
->
where
(
$where
)
->
where
(
$where
)
->
select
();
->
select
();
}
}
/**
* @param $filed
* @param $params
* @return array|false|\PDOStatement|string|Model
*/
public
function
getBargainPartialRealDetail
(
$filed
,
$params
)
{
$where_
=
$whereOr_
=
[];
if
(
isset
(
$params
[
"bargain_id"
]))
{
$where_
[
"a.id"
]
=
$params
[
"bargain_id"
];
$whereOr_
[
"a.father_id"
]
=
$params
[
"bargain_id"
];
}
if
(
isset
(
$params
[
'id'
]))
{
$where_
[
'a.id'
]
=
$params
[
'id'
];
}
return
$this
->
db_
->
field
(
$filed
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id = b.bargain_id"
,
"left"
)
->
join
(
"o_real_income c"
,
"b.real_income_id = c.id"
,
"left"
)
->
where
(
$where_
)
->
whereOr
(
$whereOr_
)
->
order
(
"a.id asc"
)
->
find
();
}
}
}
\ No newline at end of file
application/route.php
View file @
0c91faa2
...
@@ -283,7 +283,7 @@ Route::group('index', [
...
@@ -283,7 +283,7 @@ Route::group('index', [
'checkOver'
=>
[
'index/Finance/checkOver'
,
[
'method'
=>
'POST'
]],
//财务结单
'checkOver'
=>
[
'index/Finance/checkOver'
,
[
'method'
=>
'POST'
]],
//财务结单
'delPartialCommission'
=>
[
'index/Finance/delPartialCommission'
,
[
'method'
=>
'POST'
]],
//删除分佣方
'delPartialCommission'
=>
[
'index/Finance/delPartialCommission'
,
[
'method'
=>
'POST'
]],
//删除分佣方
'delTaxes'
=>
[
'index/Finance/delTaxes'
,
[
'method'
=>
'POST'
]],
//删除开票税费
'delTaxes'
=>
[
'index/Finance/delTaxes'
,
[
'method'
=>
'POST'
]],
//删除开票税费
'getBargainCommission'
=>
[
'index/Finance/getBargainCommission'
,
[
'method'
=>
'GET|POST'
]],
//获取成交报告分佣方佣金和修改
'getBargainCommission'
=>
[
'index/Finance/getBargainCommission
V2
'
,
[
'method'
=>
'GET|POST'
]],
//获取成交报告分佣方佣金和修改
'dailyList'
=>
[
'index/Finance/dailyList'
,
[
'method'
=>
'GET'
]],
//财务日报列表
'dailyList'
=>
[
'index/Finance/dailyList'
,
[
'method'
=>
'GET'
]],
//财务日报列表
'dailyDetailsFinance'
=>
[
'index/Finance/dailyDetails'
,
[
'method'
=>
'GET|POST'
]],
//财务日报详情
'dailyDetailsFinance'
=>
[
'index/Finance/dailyDetails'
,
[
'method'
=>
'GET|POST'
]],
//财务日报详情
'addReceiptImg'
=>
[
'index/Finance/addReceiptImg'
,
[
'method'
=>
'post|get'
]],
//收款图片信息保存
'addReceiptImg'
=>
[
'index/Finance/addReceiptImg'
,
[
'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