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
2bd12b2c
Commit
2bd12b2c
authored
Jun 27, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改收佣日期更新业绩
parent
724554cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
28 deletions
+78
-28
Finance.php
application/index/controller/Finance.php
+44
-14
OfficeBargain.php
application/index/controller/OfficeBargain.php
+14
-14
ORealIncome.php
application/model/ORealIncome.php
+20
-0
No files found.
application/index/controller/Finance.php
View file @
2bd12b2c
...
@@ -494,31 +494,47 @@ class Finance extends Basic
...
@@ -494,31 +494,47 @@ class Finance extends Basic
//新增实收佣金 array 5 todo feel_id 大于0 的表示新增 否则修改
//新增实收佣金 array 5 todo feel_id 大于0 的表示新增 否则修改
// $m_real->addRealIncome($this->params['practical_fee'], $this->params['id'], $this->userId);
// $m_real->addRealIncome($this->params['practical_fee'], $this->params['id'], $this->userId);
$practical_fee_arr
=
$this
->
params
[
"practical_fee"
];
$practical_fee_arr
=
$this
->
params
[
"practical_fee"
];
$bargain_id
=
$this
->
params
[
"id"
];
$bargain_id
=
$this
->
params
[
"id"
];
$real_old_data
=
$m_real
->
getBargainTaxesColumn
(
'id,income_time'
,
[
'bargain_id'
=>
$bargain_id
]);
$log_data
=
$add_real_arr
=
$update_real_arr
=
$del_real_id
=
[];
$log_data
=
$add_real_arr
=
$update_real_arr
=
$del_real_id
=
[];
$i
=
$j
=
0
;
$i
=
$j
=
0
;
foreach
(
$practical_fee_arr
as
$item
)
{
foreach
(
$practical_fee_arr
as
$item
)
{
if
(
empty
(
$item
[
'fee'
])
||
empty
(
$item
[
'operation_date'
]))
{
if
(
empty
(
$item
[
'fee'
])
||
empty
(
$item
[
'operation_date'
]))
{
$update_real_arr
[
$i
][
'id'
]
=
$item
[
'fee_id'
];
$update_real_arr
[
$i
][
'id'
]
=
$item
[
'fee_id'
];
$update_real_arr
[
$i
][
'is_del'
]
=
1
;
$update_real_arr
[
$i
][
'is_del'
]
=
1
;
$log_data
[
$i
]
=
'[删除实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
//
$log_data
[
$i
]
=
'[删除实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
//
$del_real_id
[]
=
$item
[
'fee_id'
];
$del_real_id
[]
=
$item
[
'fee_id'
];
$update_total
[]
=
[
'fee_id'
=>
$item
[
'fee_id'
],
'income_time'
=>
$real_old_data
[
$item
[
'fee_id'
]]
];
$i
++
;
$i
++
;
}
elseif
(
$item
[
"fee_id"
]
>
0
)
{
}
elseif
(
$item
[
"fee_id"
]
>
0
)
{
$update_real_arr
[
$i
][
'id'
]
=
$item
[
'fee_id'
];
$update_real_arr
[
$i
][
'id'
]
=
$item
[
'fee_id'
];
$update_real_arr
[
$i
][
'bargain_id'
]
=
$bargain_id
;
$update_real_arr
[
$i
][
'bargain_id'
]
=
$bargain_id
;
$update_real_arr
[
$i
][
'operation_id'
]
=
$this
->
userId
;
$update_real_arr
[
$i
][
'operation_id'
]
=
$this
->
userId
;
$update_real_arr
[
$i
][
'money'
]
=
$item
[
'fee'
];
$update_real_arr
[
$i
][
'money'
]
=
$item
[
'fee'
];
$update_real_arr
[
$i
][
'income_time'
]
=
$item
[
'operation_date'
];
$update_real_arr
[
$i
][
'income_time'
]
=
$item
[
'operation_date'
];
$log_data
[
$i
]
=
'[编辑实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
//
$log_data
[
$i
]
=
'[编辑实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
//
if
(
$item
[
'operation_date'
]
!=
$real_old_data
[
$item
[
'fee_id'
]])
{
$update_total
[]
=
[
'fee_id'
=>
$item
[
'fee_id'
],
'income_time'
=>
$item
[
'operation_date'
]
];
$update_total
[]
=
[
'fee_id'
=>
$item
[
'fee_id'
],
'income_time'
=>
$real_old_data
[
$item
[
'fee_id'
]]
];
}
$i
++
;
$i
++
;
}
else
{
}
else
{
$add_real_arr
[
$j
][
'bargain_id'
]
=
$bargain_id
;
$add_real_arr
[
$j
][
'bargain_id'
]
=
$bargain_id
;
$add_real_arr
[
$j
][
'operation_id'
]
=
$this
->
userId
;
$add_real_arr
[
$j
][
'operation_id'
]
=
$this
->
userId
;
$add_real_arr
[
$j
][
'money'
]
=
$item
[
'fee'
];
$add_real_arr
[
$j
][
'money'
]
=
$item
[
'fee'
];
$add_real_arr
[
$j
][
'income_time'
]
=
$item
[
'operation_date'
];
$add_real_arr
[
$j
][
'income_time'
]
=
$item
[
'operation_date'
];
$log_data
[
$j
]
=
'[新增实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
$log_data
[
$j
]
=
'[新增实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
$j
++
;
$j
++
;
}
}
}
}
...
@@ -538,6 +554,20 @@ class Finance extends Basic
...
@@ -538,6 +554,20 @@ class Finance extends Basic
$m_partial
=
new
OPartialCommission
();
$m_partial
=
new
OPartialCommission
();
$m_partial
->
updateData
([
'real_income_id'
=>
0
],
[
'bargain_id'
=>
$bargain_id
,
'real_income_id'
=>
[
'in'
,
$del_real_id
]]);
$m_partial
->
updateData
([
'real_income_id'
=>
0
],
[
'bargain_id'
=>
$bargain_id
,
'real_income_id'
=>
[
'in'
,
$del_real_id
]]);
}
}
//通过实收日期,更新业绩统计和实收统计。
if
(
isset
(
$update_total
))
{
foreach
(
$update_total
as
$v
)
{
if
(
empty
(
$v
[
'income_time'
]))
{
continue
;
}
$real_where
[
'a.id'
]
=
$v
[
'fee_id'
];
$real_data
=
$m_real
->
getIncomePartialList
(
'b.agent_id,c.store_id,c.district_id'
,
$real_where
);
foreach
(
$real_data
as
$key
)
{
$this
->
totalOfficialReceipts
(
$key
[
'agent_id'
],
$key
[
'district_id'
],
$key
[
'store_id'
],
$v
[
'income_time'
]);
}
}
}
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,修改成交报告失败!请联系运营。'
);
return
$this
->
response
(
101
,
'内部错误,修改成交报告失败!请联系运营。'
);
}
}
...
...
application/index/controller/OfficeBargain.php
View file @
2bd12b2c
...
@@ -459,20 +459,6 @@ class OfficeBargain extends Basic
...
@@ -459,20 +459,6 @@ class OfficeBargain extends Basic
}
}
}
}
//通过实收日期,更新业绩统计和实收统计。
if
(
isset
(
$update_total
))
{
foreach
(
$update_total
as
$v
)
{
if
(
empty
(
$v
[
'income_time'
]))
{
continue
;
}
$real_where
[
'a.id'
]
=
$v
[
'fee_id'
];
$real_data
=
$m_real
->
getIncomePartialList
(
'b.agent_id,c.store_id,c.district_id'
,
$real_where
);
foreach
(
$real_data
as
$key
)
{
$this
->
totalOfficialReceipts
(
$key
[
'agent_id'
],
$key
[
'district_id'
],
$key
[
'store_id'
],
$v
[
'income_time'
]);
}
}
}
try
{
try
{
if
(
$i
>
0
)
{
if
(
$i
>
0
)
{
$m_real
->
addRealIncome
(
$update_real_arr
);
$m_real
->
addRealIncome
(
$update_real_arr
);
...
@@ -488,6 +474,20 @@ class OfficeBargain extends Basic
...
@@ -488,6 +474,20 @@ class OfficeBargain extends Basic
$m_partial
=
new
OfficeOPartialCommission
();
$m_partial
=
new
OfficeOPartialCommission
();
$m_partial
->
updateData
([
'real_income_id'
=>
0
],
[
'bargain_id'
=>
$bargain_id
,
'real_income_id'
=>
[
'in'
,
$del_real_id
]]);
$m_partial
->
updateData
([
'real_income_id'
=>
0
],
[
'bargain_id'
=>
$bargain_id
,
'real_income_id'
=>
[
'in'
,
$del_real_id
]]);
}
}
//通过实收日期,更新业绩统计和实收统计。
if
(
isset
(
$update_total
))
{
foreach
(
$update_total
as
$v
)
{
if
(
empty
(
$v
[
'income_time'
]))
{
continue
;
}
$real_where
[
'a.id'
]
=
$v
[
'fee_id'
];
$real_data
=
$m_real
->
getIncomePartialList
(
'b.agent_id,c.store_id,c.district_id'
,
$real_where
);
foreach
(
$real_data
as
$key
)
{
$this
->
totalOfficialReceipts
(
$key
[
'agent_id'
],
$key
[
'district_id'
],
$key
[
'store_id'
],
$v
[
'income_time'
]);
}
}
}
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
return
$this
->
response
(
101
,
'内部错误,修改成交报告失败!请联系运营。'
);
return
$this
->
response
(
101
,
'内部错误,修改成交报告失败!请联系运营。'
);
}
}
...
...
application/model/ORealIncome.php
View file @
2bd12b2c
...
@@ -133,4 +133,23 @@ class ORealIncome extends BaseModel
...
@@ -133,4 +133,23 @@ class ORealIncome extends BaseModel
public
function
getFieldValue
(
$field
,
$where
)
{
public
function
getFieldValue
(
$field
,
$where
)
{
return
$this
->
where
(
$where
)
->
value
(
$field
);
return
$this
->
where
(
$where
)
->
value
(
$field
);
}
}
/**
* @param string $field
* @param array $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getIncomePartialList
(
$field
=
''
,
$params
=
[])
{
$params
[
'a.is_del'
]
=
0
;
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'office_o_partial_commission b'
,
'a.id = b.real_income_id'
,
'left'
)
->
join
(
'a_agents c'
,
'b.agent_id = c.id'
,
'left'
)
->
where
(
$params
)
->
select
();
}
}
}
\ 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