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
08ca4cd0
Commit
08ca4cd0
authored
Feb 05, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跟进报备
parent
43fd6fb9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
294 additions
and
11 deletions
+294
-11
OrderLog.php
application/api_broker/controller/OrderLog.php
+14
-0
OrderLogService.php
application/api_broker/service/OrderLogService.php
+87
-1
ReportService.php
application/api_broker/service/ReportService.php
+3
-3
FollowUpLogModel.php
application/model/FollowUpLogModel.php
+23
-0
OBargainModel.php
application/model/OBargainModel.php
+26
-0
OMarchInModel.php
application/model/OMarchInModel.php
+31
-0
OPayLogModel.php
application/model/OPayLogModel.php
+25
-0
ORefundModel.php
application/model/ORefundModel.php
+26
-0
OReportModel.php
application/model/OReportModel.php
+33
-3
OrderModel.php
application/model/OrderModel.php
+26
-4
No files found.
application/api_broker/controller/OrderLog.php
View file @
08ca4cd0
...
...
@@ -122,6 +122,7 @@ class OrderLog extends Basic
"remark" => "没什么备注",
"remark_img" => "12312312312"
);*/
//todo 判断此单是否有付款
$is_ok
=
$this
->
o_refund_model
->
addRefund
(
$params
);
if
(
$is_ok
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[]);
...
...
@@ -171,4 +172,16 @@ class OrderLog extends Basic
return
$this
->
response
(
"101"
,
"request faild"
);
}
public
function
selectReportAll
(){
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"order_no"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$params
=
array
(
"order_no"
=>
"1212312312"
,
);
$data
=
$this
->
service_
->
selectListByOrderNo
(
$params
[
"order_no"
]);
}
}
\ No newline at end of file
application/api_broker/service/OrderLogService.php
View file @
08ca4cd0
...
...
@@ -2,8 +2,13 @@
namespace
app\api_broker\service
;
use
app\model\FollowUpLogModel
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OPayLogModel
;
use
app\model\OrderModel
;
use
app\model\ORefundModel
;
use
app\model\OReportModel
;
/**
...
...
@@ -20,7 +25,7 @@ class OrderLogService
function
__construct
()
{
$this
->
payLogModel
=
new
OPayLogModel
();
$this
->
payLogModel
=
new
OPayLogModel
();
$this
->
bargainModel
=
new
OBargainModel
();
}
...
...
@@ -121,4 +126,84 @@ class OrderLogService
return
$arr
;
}
/**
* 查询流程
* @param $order_no
* @return array
*/
public
function
selectListByOrderNo
(
$order_no
)
{
$result
=
[];
//todo 1.验证订单是否存在
$orderModel
=
new
OrderModel
();
$oReportModel
=
new
OReportModel
();
$oMarchInModel
=
new
OMarchInModel
();
$followUpLogModel
=
new
FollowUpLogModel
();
$oPayLogModel
=
new
OPayLogModel
();
$oRefundModel
=
new
ORefundModel
();
$oBargainModel
=
new
OBargainModel
();
$orderData
=
$orderModel
->
selectOrderByOrderNO
(
"f_id,house_title"
,
[
"order_no"
=>
$order_no
]);
if
(
count
(
$orderData
)
==
0
)
{
return
[
"101"
,
"找不到此订单编号"
];
}
$report_id
=
$orderData
[
0
][
"f_id"
];
$field_report
=
"id,report_agent_id,report_agent_name,report_store_id,user_id,user_phone,user_name,vehicle,intro,predict_see_time,create_time"
;
$reportData
=
$oReportModel
->
selectReportById
(
$field_report
,
[
"id"
=>
$report_id
]);
if
(
count
(
$reportData
)
==
0
)
{
return
[
"101"
,
"报备记录未找到"
];
}
//报备
$result
[
"report"
]
=
$reportData
[
0
];
$result
[
"report"
][
"house_title"
]
=
$orderData
[
0
][
"house_title"
];
//进场 march in
$field_march_in
=
"id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time"
;
$marchInData
=
$oMarchInModel
->
selectMarchInByOrderNo
(
$field_march_in
,
[
"order_no"
=>
$order_no
]);
if
(
count
(
$marchInData
)
>
0
)
{
$result
[
"march_in"
]
=
$reportData
;
}
//跟进
$field_follow_up
=
""
;
$followUpLogData
=
$followUpLogModel
->
selectFollowUpListByReportId
(
$field_follow_up
,
[
"order_no"
=>
$order_no
]);
if
(
count
(
$marchInData
)
>
0
)
{
$result
[
"follow_up_log"
]
=
$reportData
;
}
//收款
$field_pay_log
=
""
;
$payLogData
=
$oPayLogModel
->
selectPayLogByOrderNo
(
$field_pay_log
,
[
"order_no"
=>
$order_no
]);
if
(
count
(
$payLogData
)
>
0
)
{
$result
[
"pay_log"
]
=
$payLogData
;
}
//退款
$field_refund
=
""
;
$refundData
=
$oRefundModel
->
selectRefundByOrderNo
(
$field_refund
,
[
"order_no"
=>
$order_no
]);
if
(
count
(
$refundData
)
>
0
)
{
$result
[
"refund"
]
=
$refundData
;
}
//成交报告
$field_bargain
=
""
;
$bargainData
=
$oBargainModel
->
selectBargainByOrderNo
(
$field_bargain
,
[
"order_no"
=>
$order_no
]);
if
(
count
(
$bargainData
)
>
0
)
{
$result
[
"bargain"
]
=
$bargainData
;
}
//todo 财务审核
return
$this
->
sortByTime
(
$result
);
}
private
function
sortByTime
(
$result
)
{
//todo 根据时间排序
return
array
();
}
}
\ No newline at end of file
application/api_broker/service/ReportService.php
View file @
08ca4cd0
...
...
@@ -3,7 +3,7 @@
namespace
app\api_broker\service
;
use
app\model\OrderModel
;
use
app\model\
r
eportModel
;
use
app\model\
OR
eportModel
;
/**
* Created by PhpStorm.
...
...
@@ -20,8 +20,8 @@ class ReportService
function
__construct
()
{
$this
->
reportModel
=
new
ReportModel
();
$this
->
orderModel
=
new
OrderModel
();
$this
->
reportModel
=
new
O
ReportModel
();
$this
->
orderModel
=
new
OrderModel
();
}
/**
...
...
application/model/FollowUpLogModel.php
View file @
08ca4cd0
...
...
@@ -72,4 +72,26 @@ class FollowUpLogModel extends Model
}
/**
* 查询跟进记录
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectFollowUpListByReportId
(
$field
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"report_id"
]))
{
$where_
[
"report_id"
]
=
$params
[
"report_id"
];
}
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
return
$this
->
db_
->
field
(
$field
)
->
where
(
$where_
)
->
select
();
}
}
\ No newline at end of file
application/model/OBargainModel.php
View file @
08ca4cd0
...
...
@@ -34,4 +34,29 @@ class OBargainModel extends Model
return
0
;
}
}
/**
* 查询成交报告记录
* @param string $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectBargainByOrderNo
(
$filed
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"report_id"
]))
{
$where_
[
"report_id"
]
=
$params
[
"report_id"
];
}
if
(
isset
(
$params
[
"order_no"
]))
{
$where_
[
"order_no"
]
=
$params
[
"order_no"
];
}
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
return
$this
->
db
->
field
(
$filed
)
->
where
(
$where_
)
->
select
();
}
}
\ No newline at end of file
application/model/OMarchInModel.php
View file @
08ca4cd0
...
...
@@ -42,4 +42,34 @@ class OMarchInModel extends Model
}
}
/**
* @param $filed
* @param $params
* @return mixed
*/
public
function
selectMarchInByOrderNo
(
$filed
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"id"
]))
{
$where_
[
"id"
]
=
$params
[
"id"
];
}
if
(
isset
(
$params
[
"reception_id"
]))
{
$where_
[
"reception_id"
]
=
$params
[
"reception_id"
];
}
if
(
isset
(
$params
[
"reception_name"
]))
{
$where_
[
"reception_name"
]
=
$params
[
"reception_name"
];
}
if
(
isset
(
$params
[
"report_id"
]))
{
$where_
[
"report_id"
]
=
$params
[
"report_id"
];
}
if
(
isset
(
$params
[
"order_no"
]))
{
$where_
[
"order_no"
]
=
$params
[
"order_no"
];
}
return
$this
->
db
->
field
(
$filed
)
->
where
(
$where_
)
->
select
();
}
}
\ No newline at end of file
application/model/OPayLogModel.php
View file @
08ca4cd0
...
...
@@ -33,6 +33,30 @@ class OPayLogModel extends Model
Db
::
rollback
();
return
0
;
}
}
/**
* 查询付款记录
* @param string $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectPayLogByOrderNo
(
$filed
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"report_id"
]))
{
$where_
[
"report_id"
]
=
$params
[
"report_id"
];
}
if
(
isset
(
$params
[
"order_no"
]))
{
$where_
[
"order_no"
]
=
$params
[
"order_no"
];
}
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
return
$this
->
db
->
field
(
$filed
)
->
where
(
$where_
)
->
select
();
}
}
\ No newline at end of file
application/model/ORefundModel.php
View file @
08ca4cd0
...
...
@@ -73,4 +73,29 @@ class ORefundModel extends Model{
return
0
;
}
}
/**
* 查询退款记录
* @param string $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectRefundByOrderNo
(
$filed
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"report_id"
]))
{
$where_
[
"report_id"
]
=
$params
[
"report_id"
];
}
if
(
isset
(
$params
[
"order_no"
]))
{
$where_
[
"order_no"
]
=
$params
[
"order_no"
];
}
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"agent_id"
]
=
$params
[
"agent_id"
];
}
return
$this
->
db
->
field
(
$filed
)
->
where
(
$where_
)
->
select
();
}
}
\ No newline at end of file
application/model/
r
eportModel.php
→
application/model/
OR
eportModel.php
View file @
08ca4cd0
...
...
@@ -14,7 +14,7 @@ use think\Model;
use
think\helper\Time
;
use
think\Db
;
class
r
eportModel
extends
Model
class
OR
eportModel
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'o_report'
;
...
...
@@ -35,12 +35,41 @@ class reportModel extends Model
Db
::
startTrans
();
try
{
$this
->
db
->
insert
(
$params
);
$id
=
$this
->
id
;
$id
=
$this
->
id
;
Db
::
commit
();
return
$id
;
return
$id
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
}
}
/**
* 查询报备信息
* @param string $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
selectReportById
(
$filed
=
"id"
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"id"
]))
{
$where_
[
"id"
]
=
$params
[
"id"
];
}
if
(
isset
(
$params
[
"report_agent_id"
]))
{
$where_
[
"report_agent_id"
]
=
$params
[
"report_agent_id"
];
}
if
(
isset
(
$params
[
"report_store_id"
]))
{
$where_
[
"report_store_id"
]
=
$params
[
"report_store_id"
];
}
if
(
isset
(
$params
[
"user_id"
]))
{
$where_
[
"user_id"
]
=
$params
[
"user_id"
];
}
$where_
[
"status"
]
=
0
;
return
$this
->
db
->
field
(
$filed
)
->
where
(
$where_
)
->
select
();
}
}
\ No newline at end of file
application/model/OrderModel.php
View file @
08ca4cd0
<?php
namespace
app\model
;
use
think\Db
;
...
...
@@ -10,18 +11,19 @@ use think\Model;
* Date: 2018/1/29
* Time: 下午5:47
*/
class
OrderModel
extends
Model
{
class
OrderModel
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'o_order'
;
protected
$db_
;
public
function
__construct
()
{
$this
->
db_
=
Db
::
name
(
$this
->
table
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
public
function
insertOrderByAll
(
$params
){
public
function
insertOrderByAll
(
$params
)
{
Db
::
startTrans
();
try
{
$this
->
db
->
inserAll
(
$params
);
...
...
@@ -33,4 +35,23 @@ class OrderModel extends Model{
}
}
public
function
selectOrderByOrderNO
(
$filed
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"order_no"
]))
{
$where_
[
"order_no"
]
=
$params
[
"order_no"
];
}
if
(
isset
(
$params
[
"f_id"
]))
{
$where_
[
"f_id"
]
=
$params
[
"f_id"
];
}
if
(
isset
(
$params
[
"house_id"
]))
{
$where_
[
"house_id"
]
=
$params
[
"house_id"
];
}
return
$this
->
db_
->
field
(
$filed
)
->
where
(
$where_
)
->
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