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
29c5412a
Commit
29c5412a
authored
Mar 13, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
852edad6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
156 additions
and
1 deletion
+156
-1
AccountBalanceService.php
application/api/service/AccountBalanceService.php
+45
-0
ConvertCouponService.php
application/api/service/ConvertCouponService.php
+1
-1
UserAccountBalance.php
application/index/controller/UserAccountBalance.php
+59
-0
UAccountBalance.php
application/model/UAccountBalance.php
+51
-0
No files found.
application/api/service/AccountBalanceService.php
0 → 100644
View file @
29c5412a
<?php
namespace
app\api\service
;
use
app\model\UAccountBalance
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-03-13
* Time: 14:05:36
*/
class
AccountBalanceService
{
private
$m_account_balance
;
public
function
__construct
()
{
$this
->
m_account_balance
=
new
UAccountBalance
();
}
public
function
addUserBalance
(
$user_id
,
$money
){
if
(
!
$user_id
or
!
$money
){
return
false
;
}
}
//todo 获取用户账户余额
public
function
getUserBalance
(){
}
//todo 获取用户账户明细
public
function
getBalanceList
(
$pageNo
,
$pageSize
,
$params
){
$field
=
''
;
$this
->
m_account_balance
->
getBalanceList
(
$pageNo
,
$pageSize
,
$field
,
$params
);
}
//todo 后台账户明细表
}
\ No newline at end of file
application/api/service/ConvertCouponService.php
View file @
29c5412a
...
@@ -165,7 +165,7 @@ class ConvertCouponService
...
@@ -165,7 +165,7 @@ class ConvertCouponService
// $params['b.return_action'] = array("in","0,1");
// $params['b.return_action'] = array("in","0,1");
$params
[
'b.return_action'
]
=
1
;
$params
[
'b.return_action'
]
=
1
;
}
}
$params
[
'a.status'
]
=
1
;
$params
[
'a.status'
]
=
0
;
return
$this
->
m_coupon
->
getCouponJoinActivity
(
$field
,
$params
);
return
$this
->
m_coupon
->
getCouponJoinActivity
(
$field
,
$params
);
}
}
...
...
application/index/controller/UserAccountBalance.php
0 → 100644
View file @
29c5412a
<?php
namespace
app\index\controller
;
use
app\api\service\AccountBalanceService
;
use
app\index\extend\Basic
;
use
think\Request
;
class
UserAccountBalance
extends
Basic
{
private
$s_account_balance
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
s_account_balance
=
new
AccountBalanceService
();
}
public
function
userAccountBalanceList
()
{
$params
=
$this
->
params
;
$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"
]);
}
}
\ No newline at end of file
application/model/UAccountBalance.php
0 → 100755
View file @
29c5412a
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
UAccountBalance
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'u_account_balance'
;
public
function
getBalanceList
(
$pageNo
,
$pageSize
,
$field
,
$params
)
{
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'"
;
}
if
(
!
empty
(
$params
[
'user_phone'
]))
{
$conditions
[]
=
"aaa.user_phone LIKE '%"
.
$params
[
'user_phone'
]
.
"%'"
;
}
if
(
!
empty
(
$params
[
'user_id'
]))
{
$conditions
[]
=
"aaa.user_id =
{
$params
[
'user_phone'
]
}
"
;
}
#组装搜索where条件
if
(
$conditions
)
{
$where_params
=
'WHERE '
.
implode
(
" AND "
,
$conditions
);
}
$sql
=
"SELECT * FROM
(
(SELECT
$field
FROM `u_account_balance` `a` WHERE `a`.`status` = 0)
UNION
(SELECT
$field
FROM `u_account_check` `a` WHERE `a`.`status` = 0)
) as aaa
$where_params
ORDER BY `create_time` DESC limit
$pageNo
,
$pageSize
"
;
$result
=
$this
->
db
->
query
(
$sql
);
// echo $this->getLastSql();
return
$result
;
}
}
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