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
f531b820
Commit
f531b820
authored
Jun 27, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改收佣日期更新业绩
parent
666bcde4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
OfficeBargain.php
application/index/controller/OfficeBargain.php
+7
-7
OfficeOBargainModel.php
application/model/OfficeOBargainModel.php
+20
-1
No files found.
application/index/controller/OfficeBargain.php
View file @
f531b820
...
@@ -696,7 +696,7 @@ class OfficeBargain extends Basic
...
@@ -696,7 +696,7 @@ class OfficeBargain extends Basic
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
if
(
empty
(
$this
->
params
[
'bargain_id'
]))
{
return
$this
->
response
(
101
,
'成交报告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.
create_time,a.father_id,a.creat
e_time'
;
$field
=
'a.id,a.scale,a.agent_id,a.role,a.scale_fee,b.scale as new_scale,b.should_commission,a.
father_id,c.incom
e_time'
;
$data
=
$this
->
m_bargain
->
getBargainPartialDetail
(
$field
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
$data
=
$this
->
m_bargain
->
getBargainPartialDetail
(
$field
,
[
'id'
=>
$this
->
params
[
'bargain_id'
]
]);
//检查成交报告是否存在
//检查成交报告是否存在
...
@@ -757,12 +757,12 @@ class OfficeBargain extends Basic
...
@@ -757,12 +757,12 @@ class OfficeBargain extends Basic
foreach
(
$agent_data
as
$v
)
{
foreach
(
$agent_data
as
$v
)
{
if
(
$v
[
'id'
]
==
$data_arr
[
'agent_id'
])
{
if
(
$v
[
'id'
]
==
$data_arr
[
'agent_id'
])
{
$this
->
totalOfficialReceipts
(
$v
[
'id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$data_arr
[
'
creat
e_time'
]);
$this
->
totalOfficialReceipts
(
$v
[
'id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$data_arr
[
'
incom
e_time'
]);
$content
.=
'【分佣方:'
.
$v
[
'name'
]
.
'-'
.
$v
[
'phone'
]
.
'】'
;
$content
.=
'【分佣方:'
.
$v
[
'name'
]
.
'-'
.
$v
[
'phone'
]
.
'】'
;
}
}
if
(
$v
[
'id'
]
==
$this
->
params
[
'agent_id'
])
{
if
(
$v
[
'id'
]
==
$this
->
params
[
'agent_id'
])
{
$this
->
totalOfficialReceipts
(
$v
[
'id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$data_arr
[
'
creat
e_time'
]);
$this
->
totalOfficialReceipts
(
$v
[
'id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$data_arr
[
'
incom
e_time'
]);
$content
.=
'【修改为:'
.
$v
[
'name'
]
.
'-'
.
$v
[
'phone'
]
.
'】'
;
$content
.=
'【修改为:'
.
$v
[
'name'
]
.
'-'
.
$v
[
'phone'
]
.
'】'
;
}
}
}
}
...
@@ -863,8 +863,8 @@ class OfficeBargain extends Basic
...
@@ -863,8 +863,8 @@ class OfficeBargain extends Basic
$m_agent
=
new
AAgents
();
$m_agent
=
new
AAgents
();
$agent_data
=
$m_agent
->
agentBargainOfficeAll
(
'a.id,a.store_id,a.district_id,d.income_time'
,
$where
);
$agent_data
=
$m_agent
->
agentBargainOfficeAll
(
'a.id,a.store_id,a.district_id,d.income_time'
,
$where
);
foreach
(
$agent_data
as
$k
=>
$v
)
{
foreach
(
$agent_data
as
$k
=>
$v
)
{
$
creat
e_time
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'income_time'
]));
$
incom
e_time
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'income_time'
]));
$this
->
totalOfficialReceipts
(
$v
[
'id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$
creat
e_time
);
$this
->
totalOfficialReceipts
(
$v
[
'id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$
incom
e_time
);
}
}
$data
[
'status'
]
=
'successful'
;
$data
[
'status'
]
=
'successful'
;
}
}
...
@@ -1315,7 +1315,7 @@ class OfficeBargain extends Basic
...
@@ -1315,7 +1315,7 @@ class OfficeBargain extends Basic
$msg
=
''
;
$msg
=
''
;
$where
[
'a.status'
]
=
[
'in'
,
'20,21'
];
$where
[
'a.status'
]
=
[
'in'
,
'20,21'
];
$where
[]
=
[
'EXP'
,
'a.id ='
.
$this
->
params
[
'id'
]
.
' OR a.father_id='
.
$this
->
params
[
'id'
]];
$where
[]
=
[
'EXP'
,
'a.id ='
.
$this
->
params
[
'id'
]
.
' OR a.father_id='
.
$this
->
params
[
'id'
]];
$agent_arr
=
$this
->
m_bargain
->
agentBargain
All
(
'a.create_time,a.agent_id,b.store_id,b.district_id
'
,
$where
);
$agent_arr
=
$this
->
m_bargain
->
agentBargain
Income
(
'a.agent_id,b.store_id,b.district_id,d.income_time
'
,
$where
);
if
(
empty
(
$agent_arr
))
{
if
(
empty
(
$agent_arr
))
{
return
$this
->
response
(
$code
,
'没有该记录'
);
return
$this
->
response
(
$code
,
'没有该记录'
);
...
@@ -1329,7 +1329,7 @@ class OfficeBargain extends Basic
...
@@ -1329,7 +1329,7 @@ class OfficeBargain extends Basic
if
(
$is_ok
)
{
if
(
$is_ok
)
{
foreach
(
$agent_arr
as
$k
=>
$v
)
{
foreach
(
$agent_arr
as
$k
=>
$v
)
{
try
{
try
{
$this
->
totalOfficialReceipts
(
$v
[
'agent_id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$v
[
'
creat
e_time'
]);
$this
->
totalOfficialReceipts
(
$v
[
'agent_id'
],
$v
[
'district_id'
],
$v
[
'store_id'
],
$v
[
'
incom
e_time'
]);
$code
=
200
;
$code
=
200
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$msg
=
'恢复失败:'
.
$e
->
getMessage
();
$msg
=
'恢复失败:'
.
$e
->
getMessage
();
...
...
application/model/OfficeOBargainModel.php
View file @
f531b820
...
@@ -1326,7 +1326,8 @@ class OfficeOBargainModel extends Model
...
@@ -1326,7 +1326,8 @@ class OfficeOBargainModel extends Model
$result
=
$this
->
db_
$result
=
$this
->
db_
->
field
(
$filed
)
->
field
(
$filed
)
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
"o_partial_commission b"
,
"a.id = b.bargain_id"
,
"left"
)
->
join
(
"o_office_o_partial_commission b"
,
"a.id = b.bargain_id"
,
"left"
)
->
join
(
"o_office_o_real_income c"
,
"b.real_income_id = c.id"
,
"left"
)
->
where
(
$where_
)
->
where
(
$where_
)
->
whereOr
(
$whereOr_
)
->
whereOr
(
$whereOr_
)
->
order
(
"a.id asc"
)
->
order
(
"a.id asc"
)
...
@@ -1580,6 +1581,24 @@ class OfficeOBargainModel extends Model
...
@@ -1580,6 +1581,24 @@ class OfficeOBargainModel extends Model
->
select
();
->
select
();
}
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentBargainIncome
(
$field
,
$where
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'a_agents b'
,
'a.agent_id = b.id'
,
'left'
)
->
join
(
'office_o_partial_commission c'
,
'a.id = c.bargain_id'
,
'left'
)
->
join
(
'office_o_real_income d'
,
'c.real_income_id = d.id'
,
'left'
)
->
where
(
$where
)
->
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