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
4b96fa37
Commit
4b96fa37
authored
May 03, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pos收款记录保存
parent
9a9434fd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
0 deletions
+60
-0
OrderLog.php
application/api_broker/controller/OrderLog.php
+24
-0
OrderLogService.php
application/api_broker/service/OrderLogService.php
+19
-0
OPayLogModel.php
application/model/OPayLogModel.php
+16
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/OrderLog.php
View file @
4b96fa37
...
@@ -138,6 +138,30 @@ class OrderLog extends Basic
...
@@ -138,6 +138,30 @@ class OrderLog extends Basic
}
}
}
}
/**
* 保存pos机收款记录
* @return \think\Response
*/
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"
,
"请求参数错误"
);
}
$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"
,
"request update success"
);
}
else
{
return
$this
->
response
(
"101"
,
"update faild"
);
}
}
/**
/**
* 新增退款申请
* 新增退款申请
* @return \think\Response
* @return \think\Response
...
...
application/api_broker/service/OrderLogService.php
View file @
4b96fa37
...
@@ -896,4 +896,22 @@ class OrderLogService
...
@@ -896,4 +896,22 @@ class OrderLogService
return
$this
->
payLogModel
->
getBeforeBillInfo
(
$filed
,[
"order_id"
=>
$order_id
]);
return
$this
->
payLogModel
->
getBeforeBillInfo
(
$filed
,[
"order_id"
=>
$order_id
]);
}
}
/**
* pos机付款成功回调
* @param $id
* @param $trade_no
* @param $pay_time
* @param $real_money
* @return false|int
*/
public
function
updateBillInfo
(
$id
,
$trade_no
,
$pay_time
,
$real_money
){
$params
[
"id"
]
=
$id
;
$params
[
"trade_no"
]
=
$trade_no
;
$params
[
"pay_time"
]
=
date
(
"Y-m-d H:i:s"
,
$pay_time
);
$params
[
"real_money"
]
=
$real_money
;
return
$this
->
payLogModel
->
updatePayLog
(
$params
);
}
}
}
\ No newline at end of file
application/model/OPayLogModel.php
View file @
4b96fa37
...
@@ -45,6 +45,21 @@ class OPayLogModel extends Model
...
@@ -45,6 +45,21 @@ class OPayLogModel extends Model
return
0
;
return
0
;
}
}
}
}
public
function
updatePayLog
(
$params
){
$id
=
$params
[
"id"
];
unset
(
$params
[
"id"
]);
Db
::
startTrans
();
try
{
$id
=
$this
->
where
([
"id"
=>
$id
])
->
update
(
$params
);
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
echo
$this
->
getLastSql
();
dump
(
"error:"
.
$e
);
Db
::
rollback
();
return
0
;
}
}
/**
/**
* 查询付款记录
* 查询付款记录
...
@@ -96,6 +111,7 @@ class OPayLogModel extends Model
...
@@ -96,6 +111,7 @@ class OPayLogModel extends Model
return
$this
->
db_
return
$this
->
db_
->
field
(
$filed
)
->
field
(
$filed
)
->
where
(
$where_
)
->
where
(
$where_
)
->
order
(
"id desc"
)
->
limit
(
1
)
->
limit
(
1
)
->
select
();
->
select
();
}
}
...
...
application/route.php
View file @
4b96fa37
...
@@ -334,6 +334,7 @@ Route::group('broker', [
...
@@ -334,6 +334,7 @@ Route::group('broker', [
'getFollowUpList'
=>
[
'api_broker/Report/getFollowUpList'
,
[
'method'
=>
'get|post'
]
],
'getFollowUpList'
=>
[
'api_broker/Report/getFollowUpList'
,
[
'method'
=>
'get|post'
]
],
'marchIn'
=>
[
'api_broker/OrderLog/marchIn'
,
[
'method'
=>
'get|post'
]
],
'marchIn'
=>
[
'api_broker/OrderLog/marchIn'
,
[
'method'
=>
'get|post'
]
],
'getBeforeBillInfo'
=>
[
'api_broker/OrderLog/getBeforeBillInfo'
,
[
'method'
=>
'get|post'
]
],
'getBeforeBillInfo'
=>
[
'api_broker/OrderLog/getBeforeBillInfo'
,
[
'method'
=>
'get|post'
]
],
'savePosBillMessage'
=>
[
'api_broker/OrderLog/savePosBillMessage'
,
[
'method'
=>
'get|post'
]
],
'collectingBill'
=>
[
'api_broker/OrderLog/collectingBill'
,
[
'method'
=>
'get|post'
]
],
'collectingBill'
=>
[
'api_broker/OrderLog/collectingBill'
,
[
'method'
=>
'get|post'
]
],
'refund'
=>
[
'api_broker/OrderLog/refund'
,
[
'method'
=>
'get|post'
]
],
'refund'
=>
[
'api_broker/OrderLog/refund'
,
[
'method'
=>
'get|post'
]
],
'bargain'
=>
[
'api_broker/OrderLog/bargain'
,
[
'method'
=>
'get|post'
]
],
'bargain'
=>
[
'api_broker/OrderLog/bargain'
,
[
'method'
=>
'get|post'
]
],
...
...
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