zhangwei #9

Merged
weiz merged 2 commits from zhangwei into dev 2023-09-21 18:10:21 +08:00
1 changed files with 6 additions and 5 deletions
Showing only changes of commit 3e4cf909b8 - Show all commits

View File

@ -39,13 +39,13 @@ class UserLogic extends BaseLogic
public static function balanceList($params): array
{
$search = [];
if(isset($params['record_id'])){
if(isset($params['record_id']) && !empty($params['record_id'])){
$search[] = ['record_id','=',$params['record_id']];
}
if(isset($params['mark'])){
if(isset($params['mark']) && !empty($params['mark'])){
$search[] = ['mark','like','%'.$params['mark'].'%'];
}
if(isset($params['appid'])){
if(isset($params['appid']) && !empty($params['appid'])){
$app = System::field('app_id')->where('id',$params['appid'])->findOrEmpty();
if(!$app->isEmpty()){
$search[] = ['appid','=',$app['app_id']];
@ -54,6 +54,7 @@ class UserLogic extends BaseLogic
if(isset($params['pay_type']) && in_array($params['pay_type'],[0,1,2,3,4])){
$search[] = ['pay_type','=',$params['pay_type']];
}
dump($search);
//获取用户余额列表
$fields = 'id,record_id,amount,total_amount,type,pay_type,mark,appid,create_time';
$lists = UserBalance::field($fields)->where('user_id',$params['uid'])->where($search)->page($params['page_no'],$params['page_size'])->order('create_time desc')->select()->each(function($item){
@ -75,10 +76,10 @@ class UserLogic extends BaseLogic
public static function integralList($params): array
{
$search = [];
if(isset($params['mark'])){
if(isset($params['mark']) && !empty($params['mark'])){
$search[] = ['mark','like','%'.$params['mark'].'%'];
}
if(isset($params['appid'])){
if(isset($params['appid']) && !empty($params['appid'])){
$app = System::field('app_id')->where('id',$params['appid'])->findOrEmpty();
if(!$app->isEmpty()){
$search[] = ['appid','=',$app['app_id']];