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
70167a82
Commit
70167a82
authored
Mar 15, 2019
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
f8ed4631
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
15 deletions
+88
-15
AccountBalanceService.php
application/api/service/AccountBalanceService.php
+17
-1
AccountBalance.php
application/index/controller/AccountBalance.php
+46
-9
UAccountCheck.php
application/model/UAccountCheck.php
+23
-4
route.php
application/route.php
+2
-1
No files found.
application/api/service/AccountBalanceService.php
View file @
70167a82
...
...
@@ -93,11 +93,26 @@ class AccountBalanceService{
"user_phone"
=>
$user_phone
,
"money"
=>
$money
,
"status"
=>
0
,
"user_name"
=>
$user_name
"user_name"
=>
$user_name
,
"create_time"
=>
date
(
"Y-m-d H:i:s"
,
time
()),
"update_time"
=>
date
(
"Y-m-d H:i:s"
,
time
()),
);
$accountCheckModel
=
new
UAccountCheck
();
return
$accountCheckModel
->
addCheck
(
$arr
);
}
public
function
check
(
$id
,
$operator_id
,
$operator_name
,
$transfer_img
,
$status
){
$arr
=
array
(
"operator_id"
=>
$operator_id
,
"operator_name"
=>
$operator_name
,
"status"
=>
$status
,
"transfer_img"
=>
$transfer_img
,
"transfer_time"
=>
date
(
"Y-m-d H:i:s"
,
time
()),
"update_time"
=>
date
(
"Y-m-d H:i:s"
,
time
()),
);
$accountCheckModel
=
new
UAccountCheck
();
return
$accountCheckModel
->
updateCheck
(
$id
,
$arr
);
}
}
\ No newline at end of file
application/index/controller/AccountBalance.php
View file @
70167a82
<?php
namespace
app\index\controller
;
use
app\api\service\AccountBalanceService
;
use
app\index\extend\Basic
;
use
think\Request
;
class
AccountBalance
extends
Basic
{
class
AccountBalance
extends
Basic
{
private
$s_account_balance
;
public
function
__construct
(
Request
$request
=
null
)
...
...
@@ -22,14 +24,14 @@ class AccountBalance extends Basic{
public
function
userAccountBalanceList
()
{
$params
=
$this
->
params
;
/* $params = array(
"create_time_start" => '2019-03-14 11:03:10',
"create_time_end" => '2019-03-15 11:03:10',
"user_phone" => '6471',
"user_id" => '111',
);*/
/* $params = array(
"create_time_start" => '2019-03-14 11:03:10',
"create_time_end" => '2019-03-15 11:03:10',
"user_phone" => '6471',
"user_id" => '111',
);*/
$data
=
$this
->
s_account_balance
->
getBalanceList
(
$params
);
if
(
count
(
$data
)
<=
0
)
{
if
(
count
(
$data
)
<=
0
)
{
return
$this
->
response
(
"200"
,
"null"
);
}
$result
[
"list"
]
=
$data
;
...
...
@@ -38,5 +40,39 @@ class AccountBalance extends Basic{
}
/**
* @return \think\Response
*/
public
function
check
()
{
$params
=
$this
->
params
;
/* $params = array(
"operator_id" => 1,
"operator_name" => "1231",
"transfer_img" => "123123",
"status" => 1,
"id" => 1
);*/
if
(
empty
(
$params
[
"operator_id"
])
||
empty
(
$params
[
"operator_name"
])
||
empty
(
$params
[
"id"
])
||
empty
(
$params
[
"transfer_img"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$id
=
$params
[
"id"
];
$operator_id
=
$params
[
"operator_id"
];
$operator_name
=
$params
[
"operator_name"
];
$transfer_img
=
$params
[
"transfer_img"
];
$status
=
$params
[
"status"
];
if
(
!
$status
&&
(
$status
!=
1
||
$status
!=
2
))
{
return
$this
->
response
(
"101"
,
"审核状态错误"
);
}
$id
=
$this
->
s_account_balance
->
check
(
$id
,
$operator_id
,
$operator_name
,
$transfer_img
,
$status
);
if
(
$id
>
0
){
return
$this
->
response
(
"200"
,
"success"
);
}
else
{
return
$this
->
response
(
"101"
,
"error"
);
}
}
}
\ No newline at end of file
application/model/UAccountCheck.php
View file @
70167a82
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
...
...
@@ -9,7 +11,8 @@ use think\Model;
* Date: 2019/3/14
* Time: 14:13
*/
class
UAccountCheck
extends
Model
{
class
UAccountCheck
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_account_check'
;
private
$db_
;
...
...
@@ -27,10 +30,10 @@ class UAccountCheck extends Model{
public
function
getCheckCount
(
$params
)
{
$where_arr
=
[];
if
(
!
empty
(
$params
[
'create_time_start'
])
&&
!
empty
(
$params
[
'create_time_end'
])){
if
(
!
empty
(
$params
[
'create_time_start'
])
&&
!
empty
(
$params
[
'create_time_end'
]))
{
$where_arr
[
'create_time'
]
=
array
(
'between'
,
array
(
$params
[
'create_time_start'
],
$params
[
'create_time_end'
]));
}
if
(
!
empty
(
$params
[
'user_phone'
])
)
{
if
(
!
empty
(
$params
[
'user_phone'
])
)
{
$where_arr
[
'user_phone'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'user_phone'
])
.
"%"
);
}
if
(
!
empty
(
$params
[
'user_id'
]))
{
...
...
@@ -62,7 +65,8 @@ class UAccountCheck extends Model{
return
$result
;
}
public
function
addCheck
(
$params
){
public
function
addCheck
(
$params
)
{
Db
::
startTrans
();
$id
=
0
;
try
{
...
...
@@ -74,4 +78,18 @@ class UAccountCheck extends Model{
}
return
$id
;
}
public
function
updateCheck
(
$id
,
$params
)
{
Db
::
startTrans
();
try
{
$this
->
db_
->
where
(
'id'
,
$id
)
->
update
(
$params
);
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
}
return
0
;
}
}
\ No newline at end of file
application/route.php
View file @
70167a82
...
...
@@ -430,7 +430,8 @@ Route::group('index', [
'couponList'
=>
[
'index/Coupon/couponList'
,
[
'method'
=>
'GET'
]],
//获取活动
'userAccountBalanceList'
=>
[
'index/AccountBalance/userAccountBalanceList'
,
[
'method'
=>
'get|post'
]],
//
'userAccountBalanceList'
=>
[
'index/AccountBalance/userAccountBalanceList'
,
[
'method'
=>
'get|post'
]],
'check'
=>
[
'index/AccountBalance/check'
,
[
'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