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
fc44a179
Commit
fc44a179
authored
May 23, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增成交报告门牌号和是否开业
parent
3efd1f16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
57 deletions
+72
-57
OrderLog.php
application/api_broker/controller/OrderLog.php
+62
-53
OrderLogService.php
application/api_broker/service/OrderLogService.php
+10
-4
No files found.
application/api_broker/controller/OrderLog.php
View file @
fc44a179
...
...
@@ -107,12 +107,12 @@ class OrderLog extends Basic
$remark
=
isset
(
$params
[
"remark"
])
?
$params
[
"remark"
]
:
""
;
$transfer_img
=
isset
(
$params
[
"transfer_img"
])
?
$params
[
"transfer_img"
]
:
""
;
$source
=
$params
[
"source"
]
?
$params
[
"source"
]
:
0
;
$is_ok
=
$this
->
service_
->
addCollectingBill
(
$params
[
"agent_id"
],
$params
[
"agent_name"
],
$params
[
"report_id"
],
$params
[
"order_id"
],
$params
[
"order_no"
],
$params
[
"collecting_bill"
],
$params
[
"house_number"
],
$params
[
"industry_type"
],
$remark
,
$transfer_img
,
$source
);
$source
=
$params
[
"source"
]
?
$params
[
"source"
]
:
0
;
$is_ok
=
$this
->
service_
->
addCollectingBill
(
$params
[
"agent_id"
],
$params
[
"agent_name"
],
$params
[
"report_id"
],
$params
[
"order_id"
],
$params
[
"order_no"
],
$params
[
"collecting_bill"
],
$params
[
"house_number"
],
$params
[
"industry_type"
],
$remark
,
$transfer_img
,
$source
);
if
(
$is_ok
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[
"bill_id"
=>
$is_ok
]);
return
$this
->
response
(
"200"
,
"request success"
,
[
"bill_id"
=>
$is_ok
]);
}
return
$this
->
response
(
"101"
,
"request faild"
);
}
...
...
@@ -121,20 +121,21 @@ class OrderLog extends Basic
* 获取上次提交付款的门牌号业态等
* @return \think\Response
*/
public
function
getBeforeBillInfo
(){
public
function
getBeforeBillInfo
()
{
$params
=
$this
->
params
;
/* $params = array(
"order_id" => 15523, //关联order表id
);*/
if
(
!
isset
(
$params
[
"order_id"
]))
{
/* $params = array(
"order_id" => 15523, //关联order表id
);*/
if
(
!
isset
(
$params
[
"order_id"
]))
{
return
$this
->
response
(
"101"
,
"订单编号不能为空"
);
}
$billInfo
=
$this
->
service_
->
getBillInfo
(
$params
[
"order_id"
]);
if
(
count
(
$billInfo
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$billInfo
[
0
]);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
if
(
count
(
$billInfo
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$billInfo
[
0
]);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
...
...
@@ -142,23 +143,24 @@ class OrderLog extends Basic
* 保存pos机收款记录
* @return \think\Response
*/
public
function
savePosBillMessage
(){
public
function
savePosBillMessage
()
{
$params
=
$this
->
params
;
/* $params = array(
"p_id" => 50,
"trade_no" =>00012,
"pay_time"=>time(),
"real_money" => 11.12
);*/
if
(
!
isset
(
$params
[
"p_id"
])
||
!
isset
(
$params
[
"trade_no"
])
||
!
isset
(
$params
[
"pay_time"
])
||
!
isset
(
$params
[
"real_money"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
/* $params = array(
"p_id" => 50,
"trade_no" =>00012,
"pay_time"=>time(),
"real_money" => 11.12
);*/
if
(
!
isset
(
$params
[
"p_id"
])
||
!
isset
(
$params
[
"trade_no"
])
||
!
isset
(
$params
[
"pay_time"
])
||
!
isset
(
$params
[
"real_money"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$is_ok
=
$this
->
service_
->
updateBillInfo
(
$params
[
"p_id"
],
$params
[
"trade_no"
],
$params
[
"pay_time"
],
$params
[
"real_money"
]);
if
(
$is_ok
>
0
)
{
return
$this
->
response
(
"200"
,
"支付成功!"
);
}
else
{
return
$this
->
response
(
"101"
,
"支付失败!"
);
$is_ok
=
$this
->
service_
->
updateBillInfo
(
$params
[
"p_id"
],
$params
[
"trade_no"
],
$params
[
"pay_time"
],
$params
[
"real_money"
]);
if
(
$is_ok
>
0
)
{
return
$this
->
response
(
"200"
,
"支付成功!"
);
}
else
{
return
$this
->
response
(
"101"
,
"支付失败!"
);
}
}
...
...
@@ -208,6 +210,7 @@ class OrderLog extends Basic
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"submit_agent_name"
])
||
!
isset
(
$params
[
"report_id"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
||
!
isset
(
$params
[
"trade_type"
])
||
!
isset
(
$params
[
"house_number"
])
||
!
isset
(
$params
[
"is_open"
])
||
!
isset
(
$params
[
"price"
])
||
!
isset
(
$params
[
"commission"
])
||
!
isset
(
$params
[
"commission_arr"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -217,7 +220,8 @@ class OrderLog extends Basic
"report_id" => 1,//报备id
"order_id" => 1, //关联order表id
"order_no" => "123123123", //订单no
"house_number" =>"门牌号",
"is_open" => 0,//是否开业,0未开业 1开业
"trade_type" => 10, //成交类型 10出租 20 增佣 30 代理 40 好处费
"price" => 112131, //成交价格 存分
"commission" => 111, //佣金 存分
...
...
@@ -234,7 +238,7 @@ class OrderLog extends Basic
$params
[
"commission_arr"
]
=
json_decode
(
$params
[
"commission_arr"
],
true
);
$is_ok
=
$this
->
service_
->
addBargain
(
$params
[
"submit_agent_id"
],
$params
[
"submit_agent_name"
],
$params
[
"report_id"
],
$params
[
"order_id"
],
$params
[
"order_no"
],
$params
[
"trade_type"
],
$params
[
"price"
],
$params
[
"commission"
],
$params
[
"commission_arr"
]);
$params
[
"trade_type"
],
$params
[
"price"
],
$params
[
"commission"
],
$params
[
"commission_arr"
]
,
$params
[
"house_number"
],
$params
[
"is_open"
]
);
if
(
$is_ok
>
0
)
{
//todo 更改用户信息 求租->已租
...
...
@@ -309,9 +313,9 @@ class OrderLog extends Basic
public
function
selectReportAll
()
{
$params
=
$this
->
params
;
/* $params = array(
"order_id" => 2,
);*/
/* $params = array(
"order_id" => 2,
);*/
if
(
!
isset
(
$params
[
"order_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -360,11 +364,11 @@ class OrderLog extends Basic
public
function
searchOrder
()
{
$params
=
$this
->
params
;
/* $params = array(
"type" => 1, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
"agent_id" => 4022,
"search_keyword" => "程"
);*/
/* $params = array(
"type" => 1, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
"agent_id" => 4022,
"search_keyword" => "程"
);*/
if
(
!
isset
(
$params
[
"type"
])
||
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"search_keyword"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -521,7 +525,7 @@ class OrderLog extends Basic
$data
[
'msg'
]
=
""
;
$data
[
'data'
]
=
[];
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'agent_id'
])
||
empty
(
$this
->
params
[
'source'
])
)
{
if
(
empty
(
$this
->
params
[
'id'
])
||
empty
(
$this
->
params
[
'agent_id'
])
||
empty
(
$this
->
params
[
'source'
]))
{
return
$this
->
response
(
101
,
'Id or agent_id or source is null.'
);
}
...
...
@@ -603,24 +607,28 @@ class OrderLog extends Basic
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getIsAccountStatement
(){
public
function
getIsAccountStatement
()
{
$params
=
$this
->
params
;
/* $params = array(
"order_id" => 7353,
);*/
if
(
!
isset
(
$params
[
"order_id"
]))
{
/* $params = array(
"order_id" => 7353,
);*/
if
(
!
isset
(
$params
[
"order_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$field
=
"id,order_id,account_statement"
;
$where_
[
"order_id"
]
=
$params
[
"order_id"
];
$where_
[
"father_id"
]
=
0
;
$field
=
"id,order_id,account_statement"
;
$where_
[
"order_id"
]
=
$params
[
"order_id"
];
$where_
[
"father_id"
]
=
0
;
$where_
[
"account_statement"
]
=
0
;
$oBargainModel
=
new
OBargainModel
();
$data
=
$oBargainModel
->
selectBargainByOrderNo
(
$field
,
$where_
,
"id desc"
);
if
(
count
(
$data
)
>
0
){
return
$this
->
response
(
"200"
,
"request success"
,[
"bargain_id"
=>
$data
[
0
][
"id"
]]);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
$oBargainModel
=
new
OBargainModel
();
$data
=
$oBargainModel
->
selectBargainByOrderNo
(
$field
,
$where_
,
"id desc"
);
if
(
count
(
$data
)
>
0
)
{
$list
[
"bargain_id"
]
=
$data
[
0
][
"id"
];
$list
[
"house_number"
]
=
$data
[
0
][
"house_number"
];
$list
[
"is_open"
]
=
$data
[
0
][
"is_open"
];
return
$this
->
response
(
"200"
,
"request success"
,
$list
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
}
\ No newline at end of file
application/api_broker/service/OrderLogService.php
View file @
fc44a179
...
...
@@ -117,12 +117,15 @@ class OrderLogService
* @param $price
* @param $commission
* @param $commission_arr
* @param $house_number
* @param $is_open
* @return int|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
addBargain
(
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$commission_arr
)
public
function
addBargain
(
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$commission_arr
,
$house_number
,
$is_open
)
{
$bargain_arr
=
[];
$father_id
=
0
;
...
...
@@ -132,11 +135,11 @@ class OrderLogService
&&
isset
(
$commission_val
[
"scale_fee"
]))
{
if
(
$father_id
==
0
)
{
$params
=
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
);
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
);
$father_id
=
$this
->
bargainModel
->
insertBargain
(
$params
);
}
else
{
array_push
(
$bargain_arr
,
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
));
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
));
}
}
array_push
(
$agent_arr
,
[
$commission_val
[
"agent_id"
]
]);
...
...
@@ -157,7 +160,8 @@ class OrderLogService
return
$father_id
;
}
private
function
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
)
private
function
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$submit_agent_name
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
,
$house_number
,
$is_open
)
{
$arr
[
"report_id"
]
=
$report_id
;
$arr
[
"father_id"
]
=
$father_id
;
...
...
@@ -172,6 +176,8 @@ class OrderLogService
$arr
[
"agent_id"
]
=
$commission_val
[
"agent_id"
];
$arr
[
"scale"
]
=
$commission_val
[
"scale"
];
$arr
[
"scale_fee"
]
=
$commission_val
[
"scale_fee"
];
$arr
[
"house_number"
]
=
$house_number
;
$arr
[
"is_open"
]
=
$is_open
;
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$arr
;
...
...
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