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
c89a065b
Commit
c89a065b
authored
Jun 19, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
办公楼成功报告
parent
c8e25c62
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
247 additions
and
18 deletions
+247
-18
OfficeBargain.php
application/index/controller/OfficeBargain.php
+0
-0
OfficeOBargainLogModel.php
application/model/OfficeOBargainLogModel.php
+87
-0
OfficeOBargainModel.php
application/model/OfficeOBargainModel.php
+0
-18
OfficeOFinancialAudit.php
application/model/OfficeOFinancialAudit.php
+137
-0
OfficeOReportModel.php
application/model/OfficeOReportModel.php
+10
-0
route.php
application/route.php
+13
-0
No files found.
application/index/controller/OfficeBargain.php
View file @
c89a065b
This diff is collapsed.
Click to expand it.
application/model/OfficeOBargainLogModel.php
0 → 100644
View file @
c89a065b
<?php
namespace
app\model
;
use
think\Db
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/2/1
* Time : 17:15
* Intro:
*/
class
OfficeOBargainLogModel
extends
BaseModel
{
protected
$table
=
"office_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
;
}
}
/**
* 查询列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getLogAgent
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.operation_id = b.id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
* 查询列表
*
* @param $params
* @return int|string
*/
public
function
getLogAgentTotal
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.operation_id = b.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
}
\ No newline at end of file
application/model/OfficeOBargainModel.php
View file @
c89a065b
...
...
@@ -1330,7 +1330,6 @@ class OfficeOBargainModel extends Model
$where_
[
'a.id'
]
=
$params
[
'id'
];
}
try
{
$result
=
$this
->
db_
->
field
(
$filed
)
->
alias
(
"a"
)
...
...
@@ -1339,23 +1338,6 @@ class OfficeOBargainModel extends Model
->
whereOr
(
$whereOr_
)
->
order
(
"a.id asc"
)
->
find
();
$result
[
'scale'
]
=
empty
(
$result
[
'new_scale'
])
?
$result
[
'scale'
]
:
$result
[
'new_scale'
];
$result
[
'scale_fee'
]
=
empty
(
$result
[
'should_commission'
])
?
$result
[
'scale_fee'
]
:
$result
[
'should_commission'
];
$m_agent
=
new
AAgents
();
$filed_agent
=
'a.id,a.name,a.phone,b.store_name,c.district_name,a.store_id,a.district_id'
;
$agent_info
=
$m_agent
->
getStoreDistrict
(
$filed_agent
,
[
'a.id'
=>
$result
[
'agent_id'
]
]);
$result
[
'district_name'
]
=
$agent_info
[
'district_name'
];
$result
[
'store_name'
]
=
$agent_info
[
'store_name'
];
$result
[
'name'
]
=
$agent_info
[
'name'
];
$result
[
'phone'
]
=
$agent_info
[
'phone'
];
$result
[
'store_id'
]
=
$agent_info
[
'store_id'
];
$result
[
'district_id'
]
=
$agent_info
[
'district_id'
];
}
catch
(
\Exception
$ex
)
{
$result
=
$ex
->
getMessage
();
}
return
$result
;
}
...
...
application/model/OfficeOFinancialAudit.php
0 → 100644
View file @
c89a065b
<?php
/**
* Created by PhpStorm.
* User: hujun
* Date: 2018/3/22
* Time: 15:25
*/
namespace
app\model
;
class
OfficeOFinancialAudit
extends
BaseModel
{
/**
* 添加审核通过记录
*
* @param $data
* @return false|int
*/
public
function
addAudit
(
$data
)
{
$save_data
[
'bargain_id'
]
=
$data
[
'bargain_id'
];
$save_data
[
'agent_id'
]
=
$data
[
'agent_id'
];
$save_data
[
'order_no'
]
=
$data
[
'order_no'
];
$save_data
[
'order_id'
]
=
$data
[
'order_id'
];
$save_data
[
'source'
]
=
$data
[
'source'
];
$save_data
[
'status'
]
=
$data
[
'status'
];
$save_data
[
'remark'
]
=
$data
[
'remark'
];
$save_data
[
'audit_level'
]
=
$data
[
'audit_level'
];
$save_data
[
'audit_id'
]
=
$data
[
'audit_id'
];
$save_data
[
'audit_name'
]
=
$data
[
'audit_name'
];
return
$this
->
save
(
$save_data
);
}
/**
* 获取最新审核
*
* @param $bargain_id
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getLastStep
(
$bargain_id
,
$source
)
{
return
$this
->
field
(
'id,audit_level'
)
->
where
([
'bargain_id'
=>
$bargain_id
,
'status'
=>
1
,
'source'
=>
$source
,
'is_del'
=>
0
])
->
order
(
'id desc'
)
->
find
();
}
/**
* @param $id
* @param $params
* @return int
* @throws \think\exception\PDOException
*/
public
function
updateBargainById
(
$id
,
$params
)
{
$params
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$this
->
startTrans
();
try
{
$this
->
where
(
'id'
,
$id
)
->
update
(
$params
);
$this
->
commit
();
return
1
;
}
catch
(
\Exception
$e
)
{
$this
->
rollback
();
return
0
;
}
}
/**
* 撤销数据
*
* @param int $bargain_id
* @param array $params
* @return bool
* @throws \think\exception\PDOException
*/
public
function
backOutUpdate
(
int
$bargain_id
,
array
$params
=
[])
:
bool
{
if
(
empty
(
$bargain_id
))
{
return
false
;
}
$this
->
startTrans
();
// $data['is_del'] = 1; //去除之前的审核记录
// $this->editData($data, $bargain_id, 'bargain_id');
$m_bargain
=
new
OBargainModel
();
$update_data
[
'status'
]
=
20
;
$update_data
[
'audit_level'
]
=
0
;
$update_data
[
'content'
]
=
$params
[
'content'
];
//撤销原因
// $result_bargain = $m_bargain->updateBargain($bargain_id, $update_data);
$where
[]
=
[
'EXP'
,
'id='
.
$bargain_id
.
' or father_id='
.
$bargain_id
];
$where
[
'status'
]
=
[
'in'
,
'10,11,12,13'
];
$result_bargain
=
$m_bargain
->
updateBargainByWhere
(
$update_data
,
$where
);
if
(
$result_bargain
)
{
$this
->
commit
();
$result
=
true
;
}
else
{
$this
->
rollback
();
$result
=
false
;
}
return
$result
;
}
/**
* 查询成交报告记录
*
* @param $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectFinancialByOrderNo
(
$filed
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"order_id"
]))
{
$where_
[
"order_id"
]
=
$params
[
"order_id"
];
}
$where_
[
"is_del"
]
=
0
;
$where_
[
"source"
]
=
3
;
$data
=
$this
->
field
(
$filed
)
->
where
(
$where_
)
->
select
();
return
$data
;
}
}
\ No newline at end of file
application/model/OfficeOReportModel.php
View file @
c89a065b
...
...
@@ -786,6 +786,16 @@ class OfficeOReportModel extends Model
->
count
(
'a.id'
);
return
$result
;
}
/**
* @param $field
* @param $where
* @return mixed
*/
public
function
getFieldValue
(
$field
,
$where
)
{
return
$this
->
db
->
where
(
$where
)
->
value
(
$field
);
}
}
...
...
application/route.php
View file @
c89a065b
...
...
@@ -1076,6 +1076,19 @@ Route::group('office_index', [
'reportListThree/:check_status'
=>
[
'index/OfficeBargain/reportList'
,
[
'method'
=>
'get'
],
[
'check_status'
=>
3
]],
//财务 成交报告-未结单-第三级审核
'reportListStatement/:check_status'
=>
[
'index/OfficeBargain/reportList'
,
[
'method'
=>
'get'
],
[
'check_status'
=>
4
]],
//财务 成交报告-已结单
'reportListAll/:check_status'
=>
[
'index/OfficeBargain/reportList'
,
[
'method'
=>
'get'
],
[
'check_status'
=>
10
]],
//财务 成交报告-全部
'editBargainInfo'
=>
[
'index/OfficeBargain/editBargainInfo'
,
[
'method'
=>
'post'
]],
//修改成交报告佣金
'checkReferrer'
=>
[
'index/OfficeBargain/checkReferrer'
,
[
'method'
=>
'get'
]],
//检查是否有邀请人(客户邀请客户)
'searchOrderAgents'
=>
[
'index/OfficeBargain/searchOrderAgents'
,
[
'method'
=>
'GET'
]],
//order_id获取盘方,客方,反签,独家,合作方
'addBargain'
=>
[
'index/OfficeBargain/addBargain'
,
[
'method'
=>
'post'
]],
//新增成交报告佣金(分佣提成)
'getBargainCommission'
=>
[
'index/OfficeBargain/getBargainCommission'
,
[
'method'
=>
'GET|POST'
]],
//获取成交报告分佣方佣金和修改
'delPartialCommission'
=>
[
'index/OfficeBargain/delPartialCommission'
,
[
'method'
=>
'POST'
]],
//删除分佣方
'getRealIncome'
=>
[
'index/OfficeBargain/getRealIncome'
,
[
'method'
=>
'GET'
]],
//获取实收日期
'addRealIncome'
=>
[
'index/OfficeBargain/addRealIncome'
,
[
'method'
=>
'POST'
]],
//增加和编辑实收佣金
'addTallAge'
=>
[
'index/OfficeBargain/addTallAge'
,
[
'method'
=>
'POST'
]],
//新增和编辑开票税费
'getTaxesById'
=>
[
'index/OfficeBargain/getTaxesById'
,
[
'method'
=>
'POST|GET'
]],
//财务结单
'delTaxes'
=>
[
'index/OfficeBargain/delTaxes'
,
[
'method'
=>
'POST'
]],
//删除开票税费
'backOutToOne'
=>
[
'index/OfficeBargain/backOutToOne'
,
[
'method'
=>
'POST'
]],
//财务 成交报告-撤销成交报告
]);
Route
::
group
(
'office_api'
,
[
...
...
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