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
4cafd394
Commit
4cafd394
authored
Mar 14, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
account
parent
f1f5e02b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
+19
-15
AccountBalance.php
application/api/controller/AccountBalance.php
+1
-1
AccountBalance.php
application/index/controller/AccountBalance.php
+7
-1
UAccountBalance.php
application/model/UAccountBalance.php
+10
-12
route.php
application/route.php
+1
-1
No files found.
application/api/controller/
User
AccountBalance.php
→
application/api/controller/AccountBalance.php
View file @
4cafd394
...
...
@@ -10,7 +10,7 @@ use think\Request;
* Date: 2019/3/13
* Time: 10:17
*/
class
User
AccountBalance
extends
Basic
{
class
AccountBalance
extends
Basic
{
private
$s_account_balance
;
public
function
__construct
(
Request
$request
=
null
)
...
...
application/index/controller/
User
AccountBalance.php
→
application/index/controller/AccountBalance.php
View file @
4cafd394
...
...
@@ -6,7 +6,7 @@ use think\Request;
class
User
AccountBalance
extends
Basic
{
class
AccountBalance
extends
Basic
{
private
$s_account_balance
;
public
function
__construct
(
Request
$request
=
null
)
...
...
@@ -19,6 +19,12 @@ class UserAccountBalance 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'
,
);
$result
[
"list"
]
=
$this
->
s_account_balance
->
getBalanceList
(
$params
);
return
$this
->
response
(
"200"
,
"success!"
,
$result
);
}
...
...
application/model/UAccountBalance.php
View file @
4cafd394
...
...
@@ -24,40 +24,38 @@ class UAccountBalance extends Model
{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
0
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
10
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$where_str
=
""
;
if
(
!
empty
(
$params
[
'create_time_start'
])
&&
!
empty
(
$params
[
'create_time_end'
]))
{
$
conditions
[]
=
"aaa.
create_time BETWEEN '"
.
$params
[
'create_time_start'
]
.
" 00:00:00' AND '"
.
$params
[
'create_time_end'
]
.
" 23:59:59'"
;
$
where_str
.=
" and
create_time BETWEEN '"
.
$params
[
'create_time_start'
]
.
" 00:00:00' AND '"
.
$params
[
'create_time_end'
]
.
" 23:59:59'"
;
}
if
(
!
empty
(
$params
[
'user_phone'
]))
{
$
conditions
[]
=
"aaa.
user_phone LIKE '%"
.
$params
[
'user_phone'
]
.
"%'"
;
$
where_str
.=
" and
user_phone LIKE '%"
.
$params
[
'user_phone'
]
.
"%'"
;
}
if
(
!
empty
(
$params
[
'user_id'
]))
{
$
conditions
[]
=
"aaa.
user_id =
{
$params
[
'user_phone'
]
}
"
;
$
where_str
.=
" and
user_id =
{
$params
[
'user_phone'
]
}
"
;
}
#组装搜索where条件
if
(
$conditions
)
{
$where_params
=
'WHERE '
.
implode
(
" AND "
,
$conditions
);
}
$sql
=
"SELECT
*
FROM
(
( SELECT id, user_id,source_id , money, user_name,create_time, 1 AS
aa FROM `u_account_balance` `a` WHERE `a`.`status` = 0
) UNION
( SELECT id, user_id,0 as source_id ,money, user_name,create_time, 2 AS
aa FROM `u_account_check` `a` WHERE `a`.`status` IN ( 0, 1, 2 )
)
) AS aaa
$where_params
( SELECT id, user_id,source_id , money, user_name,create_time, 1 AS
is_essay FROM `u_account_balance` WHERE `status` = 0
$where_str
) UNION
( SELECT id, user_id,0 as source_id ,money, user_name,create_time, 2 AS
is_essay FROM `u_account_check` WHERE `status` IN ( 0, 1, 2 )
$where_str
)
) AS aaa
ORDER BY
`create_time` DESC
LIMIT
{
$pageNo
}
,
{
$pageSize
}
"
;
$result
=
$this
->
query
(
$sql
);
//
echo $this->getLastSql();
echo
$this
->
getLastSql
();
return
$result
;
}
...
...
application/route.php
View file @
4cafd394
...
...
@@ -430,7 +430,7 @@ Route::group('index', [
'couponList'
=>
[
'index/Coupon/couponList'
,
[
'method'
=>
'GET'
]],
//获取活动
'userAccountBalanceList'
=>
[
'index/
User
AccountBalance/userAccountBalanceList'
,
[
'method'
=>
'get|post'
]],
//
'userAccountBalanceList'
=>
[
'index/AccountBalance/userAccountBalanceList'
,
[
'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