first commit
This commit is contained in:
78
app/api/lists/finance/RechargeRecordLists.php
Normal file
78
app/api/lists/finance/RechargeRecordLists.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\lists\finance;
|
||||
|
||||
use app\api\lists\BaseApiDataLists;
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\model\finance\RechargeRecord;
|
||||
use app\common\model\setting\Language;
|
||||
|
||||
/**
|
||||
* 充值记录列表
|
||||
* Class RechargeRecordLists
|
||||
* @package app\api\lists\finance
|
||||
*/
|
||||
class RechargeRecordLists extends BaseApiDataLists
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取充值记录列表
|
||||
* @return array
|
||||
*@author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
|
||||
$field = 'id,sn,method_id,amount,amount_act,rate,symbol,status,create_time';
|
||||
$lists = RechargeRecord::field($field)
|
||||
->append(['method_name'])
|
||||
->where([
|
||||
'user_id' => $this->userId,
|
||||
])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['create_time' => 'desc','id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
//查询语言
|
||||
$timeFormat = 'Y-m-d H:i:s';
|
||||
$language = Language::where(['symbol' => $this->params['lang']])->findOrEmpty();
|
||||
if (!$language->isEmpty()) {
|
||||
$timeFormat = $language['time_format'];
|
||||
}
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['create_time'] = date($timeFormat, strtotime($item['create_time']));
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取充值记录数量
|
||||
* @return int
|
||||
* @author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return RechargeRecord::where([
|
||||
'user_id' => $this->userId,
|
||||
])
|
||||
->count();
|
||||
}
|
||||
}
|
||||
89
app/api/lists/finance/UserFinanceLists.php
Normal file
89
app/api/lists/finance/UserFinanceLists.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\lists\finance;
|
||||
|
||||
use app\api\lists\BaseApiDataLists;
|
||||
use app\common\model\finance\UserFinance;
|
||||
use app\common\model\setting\Language;
|
||||
|
||||
/**
|
||||
* 充值记录列表
|
||||
* Class UserFinanceLists
|
||||
* @package app\api\lists\finance
|
||||
*/
|
||||
class UserFinanceLists extends BaseApiDataLists
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取充值记录列表
|
||||
* @return array
|
||||
*@author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
|
||||
$where = '1 = 1';
|
||||
|
||||
if( $this->params['action'] == 1){
|
||||
$where = ' action = 1 ';
|
||||
}else if( $this->params['action'] == 2){
|
||||
$where = ' action = 2 ';
|
||||
}
|
||||
|
||||
if( $this->params['frozen'] == 1){
|
||||
$where .= ' AND frozen = 1 ';
|
||||
}
|
||||
|
||||
$field = 'id,sn,change_type as type,change_amount as amount,remark,action,create_time';
|
||||
$lists = UserFinance::field($field)
|
||||
->where($where)
|
||||
->where([
|
||||
'user_id' => $this->userId,
|
||||
])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['create_time' => 'desc','id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
//查询语言
|
||||
$timeFormat = 'Y-m-d H:i:s';
|
||||
$language = Language::where(['symbol' => $this->params['lang']])->findOrEmpty();
|
||||
if (!$language->isEmpty()) {
|
||||
$timeFormat = $language['time_format'];
|
||||
}
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['create_time'] = date($timeFormat, strtotime($item['create_time']));
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取充值记录数量
|
||||
* @return int
|
||||
* @author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return UserFinance::where([
|
||||
'user_id' => $this->userId,
|
||||
])
|
||||
->count();
|
||||
}
|
||||
}
|
||||
74
app/api/lists/finance/UserTransferRecordLists.php
Normal file
74
app/api/lists/finance/UserTransferRecordLists.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\lists\finance;
|
||||
|
||||
use app\api\lists\BaseApiDataLists;
|
||||
|
||||
use app\common\service\{UtilsService,FileService};
|
||||
use app\common\model\finance\UserTransferRecord;
|
||||
use app\common\model\setting\Language;
|
||||
|
||||
/**
|
||||
* 转账记录列表
|
||||
* Class UserTransferRecordLists
|
||||
* @package app\api\lists\finance
|
||||
*/
|
||||
class UserTransferRecordLists extends BaseApiDataLists
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取转账记录列表
|
||||
* @return array
|
||||
*@author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
|
||||
$field = 'id,sn,user_id,user_id_from,user_id_to,amount,type,create_time';
|
||||
$lists = UserTransferRecord::field($field)
|
||||
->append(['users_info'])
|
||||
->where(['user_id' => $this->userId])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['create_time' => 'desc','id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
//查询语言
|
||||
$timeFormat = 'Y-m-d H:i:s';
|
||||
$language = Language::where(['symbol' => $this->params['lang']])->findOrEmpty();
|
||||
if (!$language->isEmpty()) {
|
||||
$timeFormat = $language['time_format'];
|
||||
}
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['create_time'] = date($timeFormat, strtotime($item['create_time']));
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取转账记录数量
|
||||
* @return int
|
||||
* @author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return UserTransferRecord::where(['user_id' => $this->userId])->count();
|
||||
}
|
||||
}
|
||||
84
app/api/lists/finance/WithdrawRecordLists.php
Normal file
84
app/api/lists/finance/WithdrawRecordLists.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\lists\finance;
|
||||
|
||||
use app\api\lists\BaseApiDataLists;
|
||||
use app\common\enum\YesNoEnum;
|
||||
use app\common\model\finance\WithdrawRecord;
|
||||
use app\common\model\setting\Language;
|
||||
|
||||
/**
|
||||
* 提现记录列表
|
||||
* Class WithdrawRecordLists
|
||||
* @package app\api\lists\finance
|
||||
*/
|
||||
class WithdrawRecordLists extends BaseApiDataLists
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 获取提现记录列表
|
||||
* @return array
|
||||
*@author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$field = 'id,sn,method_id,amount,amount_act,rate,symbol,status,create_time,account,type,remark,charge';
|
||||
$lists = WithdrawRecord::field($field)
|
||||
->append(['method_name'])
|
||||
->where([
|
||||
'user_id' => $this->userId,
|
||||
])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['create_time' => 'desc','id' => 'desc'])
|
||||
->select()
|
||||
->toArray();
|
||||
//查询语言
|
||||
$timeFormat = 'Y-m-d H:i:s';
|
||||
$language = Language::where(['symbol' => $this->params['lang']])->findOrEmpty();
|
||||
if (!$language->isEmpty()) {
|
||||
$timeFormat = $language['time_format'];
|
||||
}
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['create_time'] = date($timeFormat, strtotime($item['create_time']));
|
||||
|
||||
if($item['type'] == 2){
|
||||
$item['account'] = substr($item['account'],0,3).'******'.substr($item['account'],strlen($item['account'])-3,strlen($item['account']));
|
||||
$item['account'] = $item['method_name'].'('.$item['account'].')';
|
||||
}else{
|
||||
$item['account'] = substr($item['account'],0,4).'******'.substr($item['account'],strlen($item['account'])-4,strlen($item['account']));
|
||||
$item['account'] = $item['method_name'].'('.$item['account'].')';
|
||||
}
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取提现记录数量
|
||||
* @return int
|
||||
* @author bd
|
||||
* @date 2024/01/31 14:07
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return WithdrawRecord::where([
|
||||
'user_id' => $this->userId,
|
||||
])
|
||||
->count();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user