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
95fd7830
Commit
95fd7830
authored
May 24, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑获取盘方,客方,反签,独家,合作方
parent
c6974b3f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
OBargainModel.php
application/model/OBargainModel.php
+7
-1
OPartialCommission.php
application/model/OPartialCommission.php
+19
-1
No files found.
application/model/OBargainModel.php
View file @
95fd7830
...
@@ -675,10 +675,15 @@ class OBargainModel extends Model
...
@@ -675,10 +675,15 @@ class OBargainModel extends Model
*/
*/
public
function
getAgentTypeByBargainId
(
int
$bargain_id
)
:
array
{
public
function
getAgentTypeByBargainId
(
int
$bargain_id
)
:
array
{
$data
=
$this
->
field
(
'role,agent_id'
)
$m_partial
=
new
OPartialCommission
();
$data
=
$m_partial
->
getBragainScale
(
$bargain_id
);
if
(
empty
(
$data
))
{
$data
=
$this
->
field
(
'role,agent_id,scale'
)
->
where
(
'id'
,
$bargain_id
)
->
where
(
'id'
,
$bargain_id
)
->
whereOr
(
'father_id'
,
$bargain_id
)
->
whereOr
(
'father_id'
,
$bargain_id
)
->
select
();
->
select
();
}
$m_agent
=
new
AAgents
();
$m_agent
=
new
AAgents
();
$result
=
[];
$result
=
[];
...
@@ -690,6 +695,7 @@ class OBargainModel extends Model
...
@@ -690,6 +695,7 @@ class OBargainModel extends Model
$result
[
$k
][
'name'
]
=
$agent_name
[
'name'
];
$result
[
$k
][
'name'
]
=
$agent_name
[
'name'
];
$result
[
$k
][
'phone'
]
=
$agent_name
[
'phone'
];
$result
[
$k
][
'phone'
]
=
$agent_name
[
'phone'
];
$result
[
$k
][
'role'
]
=
$v
[
'role'
];
$result
[
$k
][
'role'
]
=
$v
[
'role'
];
$result
[
$k
][
'scale'
]
=
$v
[
'scale'
];
switch
(
$v
[
'role'
])
{
switch
(
$v
[
'role'
])
{
case
1
:
case
1
:
...
...
application/model/OPartialCommission.php
View file @
95fd7830
...
@@ -170,7 +170,10 @@ class OPartialCommission extends BaseModel
...
@@ -170,7 +170,10 @@ class OPartialCommission extends BaseModel
*
*
* @param $field
* @param $field
* @param $params
* @param $params
* @return mixed
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
getCommissionListByBargainId
(
$field
,
$params
){
public
function
getCommissionListByBargainId
(
$field
,
$params
){
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.is_del"
]
=
0
;
...
@@ -184,4 +187,18 @@ class OPartialCommission extends BaseModel
...
@@ -184,4 +187,18 @@ class OPartialCommission extends BaseModel
return
$result
;
return
$result
;
}
}
/**
*获取最后一次分佣比例用到新增税费开票
*
* @param int $bargain_id
* @return mixed
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public
function
getBragainScale
(
int
$bargain_id
)
{
$sql
=
'SELECT scale,agent_id,role,substring_index(group_concat(id ORDER BY id DESC),",",1) as id
FROM o_partial_commission WHERE bargain_id = '
.
$bargain_id
.
' GROUP BY role'
;
return
$this
->
query
(
$sql
);
}
}
}
\ No newline at end of file
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