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
604e0106
Commit
604e0106
authored
May 31, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
成交报告修改日志
parent
3158e0c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
2 deletions
+85
-2
Finance.php
application/index/controller/Finance.php
+35
-2
OBargainLogModel.php
application/model/OBargainLogModel.php
+50
-0
No files found.
application/index/controller/Finance.php
View file @
604e0106
...
...
@@ -14,6 +14,7 @@ use app\index\extend\Basic;
use
app\index\untils\ExportExcelUntil
;
use
app\model\AAgents
;
use
app\model\AStore
;
use
app\model\OBargainLogModel
;
use
app\model\OBargainModel
;
use
app\model\ORealIncome
;
use
app\model\OTaxes
;
...
...
@@ -263,7 +264,7 @@ class Finance extends Basic
$practical_fee_arr
=
$this
->
params
[
"practical_fee"
];
$bargain_id
=
$this
->
params
[
"id"
];
$add_real_arr
=
$update_real_arr
=
[];
$
log_data
=
$
add_real_arr
=
$update_real_arr
=
[];
$i
=
$j
=
0
;
foreach
(
$practical_fee_arr
as
$item
)
{
if
(
!
$item
[
'fee'
]
||
!
$item
[
'operation_date'
])
{
...
...
@@ -275,12 +276,14 @@ class Finance extends Basic
$update_real_arr
[
$i
][
'operation_id'
]
=
$this
->
userId
;
$update_real_arr
[
$i
][
'money'
]
=
$item
[
'fee'
];
$update_real_arr
[
$i
][
'income_time'
]
=
$item
[
'operation_date'
];
$log_data
[
$i
]
=
'[编辑实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
//
$i
++
;
}
else
{
$add_real_arr
[
$j
][
'bargain_id'
]
=
$bargain_id
;
$add_real_arr
[
$j
][
'operation_id'
]
=
$this
->
userId
;
$add_real_arr
[
$j
][
'money'
]
=
$item
[
'fee'
];
$add_real_arr
[
$j
][
'income_time'
]
=
$item
[
'operation_date'
];
$log_data
[
$j
]
=
'[新增实收佣金:'
.
$item
[
'fee'
]
.
',收佣日期'
.
$item
[
'operation_date'
]
.
']'
;
$j
++
;
}
}
...
...
@@ -291,6 +294,9 @@ class Finance extends Basic
if
(
$j
>
0
)
{
$m_real
->
addRealIncome
(
$add_real_arr
);
}
$content
=
'[应收总佣金:'
.
$update_data
[
'commission'
]
.
']'
.
implode
(
' '
,
$log_data
);
$this
->
editRecordLog
((
int
)
$this
->
params
[
"id"
],
$content
,
1
,
''
,
$update_data
[
'is_open'
]);
}
else
{
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Modify the failure.'
;
...
...
@@ -1185,6 +1191,33 @@ class Finance extends Basic
}
public
function
financeUpdateLog
(){
return
view
(
'finance/finance_update_log'
);
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
'finance/finance_update_log'
);
}
}
/**
* 记录财务修改日志
*
* @param int $bargain_id
* @param string $step_content
* @param int $type
* @param string $house_number
* @param int $is_open
* @return int
*/
public
function
editRecordLog
(
int
$bargain_id
,
string
$step_content
=
''
,
int
$type
=
1
,
string
$house_number
=
''
,
int
$is_open
=
0
)
{
$insert_data
[
0
][
'bargain_id'
]
=
$bargain_id
;
$insert_data
[
0
][
'step_content'
]
=
$step_content
;
$insert_data
[
0
][
'type'
]
=
$type
;
$insert_data
[
0
][
'operation_id'
]
=
$this
->
userId
;
$insert_data
[
0
][
'operation_name'
]
=
$this
->
userName
;
$insert_data
[
0
][
'house_number'
]
=
$house_number
;
$insert_data
[
0
][
'is_open'
]
=
$is_open
;
$insert_data
[
0
][
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
$m_bargain
=
new
OBargainLogModel
();
return
$m_bargain
->
addLog
(
$insert_data
);
}
}
application/model/OBargainLogModel.php
0 → 100644
View file @
604e0106
<?php
namespace
app\model
;
use
think\Db
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/2/1
* Time : 17:15
* Intro:
*/
class
OBargainLogModel
extends
BaseModel
{
protected
$table
=
"o_bargain_log"
;
private
$db_
;
function
__construct
()
{
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
public
function
addLog
(
$params
)
{
Db
::
startTrans
();
try
{
$this
->
db_
->
insertAll
(
$params
);
Db
::
commit
();
return
1
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
}
}
public
function
insertLog
(
$params
)
{
Db
::
startTrans
();
try
{
$id
=
$this
->
db_
->
insertGetId
(
$params
);
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
}
}
}
\ 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