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
364b4557
Commit
364b4557
authored
Mar 13, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4f4e403d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
47 deletions
+25
-47
AccountBalanceService.php
application/api/service/AccountBalanceService.php
+3
-3
UserAccountBalance.php
application/index/controller/UserAccountBalance.php
+2
-32
UAccountBalance.php
application/model/UAccountBalance.php
+17
-12
route.php
application/route.php
+3
-0
No files found.
application/api/service/AccountBalanceService.php
View file @
364b4557
...
@@ -31,9 +31,9 @@ class AccountBalanceService{
...
@@ -31,9 +31,9 @@ class AccountBalanceService{
}
}
//todo 获取用户账户明细
//todo 获取用户账户明细
public
function
getBalanceList
(
$pa
geNo
,
$pageSize
,
$pa
rams
){
public
function
getBalanceList
(
$params
){
$
field
=
''
;
$
res
=
$this
->
m_account_balance
->
getBalanceList
(
$params
)
;
$this
->
m_account_balance
->
getBalanceList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
;
return
$res
;
}
}
//todo 后台账户明细表
//todo 后台账户明细表
...
...
application/index/controller/UserAccountBalance.php
View file @
364b4557
...
@@ -19,38 +19,8 @@ class UserAccountBalance extends Basic{
...
@@ -19,38 +19,8 @@ class UserAccountBalance extends Basic{
public
function
userAccountBalanceList
()
public
function
userAccountBalanceList
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$result
[
"list"
]
=
$this
->
s_account_balance
->
getBalanceList
(
$params
);
return
$this
->
response
(
"200"
,
"success!"
,
$result
);
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
10
:
$params
[
'pageSize'
];
if
(
!
empty
(
$params
[
'start_date'
])
&&
!
empty
(
$params
[
'end_date'
]))
{
$where
[
'a.call_time'
]
=
[
'between'
,
[
$this
->
params
[
'start_date'
]
.
' 00:00:00'
,
$this
->
params
[
'end_date'
]
.
' 23:59:59'
]
];
}
if
(
!
empty
(
$this
->
params
[
'user_id'
]))
{
$where
[
'a.user_id'
]
=
$this
->
params
[
'user_id'
];
}
if
(
!
empty
(
$this
->
params
[
'user_phone'
]))
{
$where
[
'a.user_id'
]
=
$this
->
params
[
'user_id'
];
}
if
(
!
empty
(
$this
->
params
[
'user_name'
]))
{
$where
[
'a.user_id'
]
=
$this
->
params
[
'user_id'
];
}
$this
->
s_account_balance
->
getBalanceList
(
$pageNo
,
$pageSize
,
$params
);
return
$this
->
response
(
"200"
,
"success!"
,
$result
[
"data"
]);
}
}
...
...
application/model/UAccountBalance.php
View file @
364b4557
...
@@ -11,9 +11,12 @@ class UAccountBalance extends Model
...
@@ -11,9 +11,12 @@ class UAccountBalance extends Model
protected
$table
=
'u_account_balance'
;
protected
$table
=
'u_account_balance'
;
public
function
getBalanceList
(
$pa
geNo
,
$pageSize
,
$field
,
$pa
rams
)
public
function
getBalanceList
(
$params
)
{
{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
0
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
10
:
$params
[
'pageSize'
];
if
(
!
empty
(
$params
[
'create_time_start'
])
&&
!
empty
(
$params
[
'create_time_end'
]))
{
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'"
;
$conditions
[]
=
"aaa.create_time BETWEEN '"
.
$params
[
'create_time_start'
]
.
" 00:00:00' AND '"
.
$params
[
'create_time_end'
]
.
" 23:59:59'"
;
}
}
...
@@ -32,17 +35,19 @@ class UAccountBalance extends Model
...
@@ -32,17 +35,19 @@ class UAccountBalance extends Model
$where_params
=
'WHERE '
.
implode
(
" AND "
,
$conditions
);
$where_params
=
'WHERE '
.
implode
(
" AND "
,
$conditions
);
}
}
$sql
=
"SELECT * FROM
$sql
=
"SELECT
(
*
(SELECT
$field
FROM `u_account_balance` `a` WHERE `a`.`status` = 0)
FROM
UNION
(
(SELECT
$field
FROM `u_account_check` `a` WHERE `a`.`status` = 0)
( SELECT id, user_id,source_id, money, create_time, 1 AS aa FROM `u_account_balance` `a` WHERE `a`.`status` = 0 ) UNION
) as aaa
( SELECT id, user_id,0 as source_id ,money, create_time, 2 AS aa FROM `u_account_check` `a` WHERE `a`.`status` IN ( 0, 1, 2 ) )
) AS aaa
$where_params
$where_params
ORDER BY `create_time` DESC limit
$pageNo
,
$pageSize
"
;
ORDER BY
`create_time` DESC
$result
=
$this
->
db
->
query
(
$sql
);
LIMIT
{
$pageNo
}
,
{
$pageSize
}
"
;
$result
=
$this
->
query
(
$sql
);
// echo $this->getLastSql();
// echo $this->getLastSql();
return
$result
;
return
$result
;
}
}
...
...
application/route.php
View file @
364b4557
...
@@ -428,6 +428,9 @@ Route::group('index', [
...
@@ -428,6 +428,9 @@ Route::group('index', [
'saveActivity'
=>
[
'index/Activity/saveActivity'
,
[
'method'
=>
'POST|GET'
]],
//新增或修改活动
'saveActivity'
=>
[
'index/Activity/saveActivity'
,
[
'method'
=>
'POST|GET'
]],
//新增或修改活动
'getActivityList'
=>
[
'index/Activity/getActivityList'
,
[
'method'
=>
'POST|GET'
]],
//获取活动
'getActivityList'
=>
[
'index/Activity/getActivityList'
,
[
'method'
=>
'POST|GET'
]],
//获取活动
'couponList'
=>
[
'index/Coupon/couponList'
,
[
'method'
=>
'GET'
]],
//获取活动
'couponList'
=>
[
'index/Coupon/couponList'
,
[
'method'
=>
'GET'
]],
//获取活动
'userAccountBalanceList'
=>
[
'index/UserAccountBalance/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