From eb1e6f23e5a960605b5630e0d63ece42d30851e8 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Tue, 15 Sep 2020 17:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=8E=B0=E6=98=8E=E7=BB=86=20?= =?UTF-8?q?=E8=B4=A6=E6=88=B7=E6=94=B6=E5=85=A5=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/v3/FinancialRecord.php | 10 ++++++++++ app/Model/v3/StoreWithdrawal.php | 8 +++++++- app/Service/v3/Implementations/RevenueListService.php | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/Model/v3/FinancialRecord.php b/app/Model/v3/FinancialRecord.php index 90dc0a2..0d56fe7 100644 --- a/app/Model/v3/FinancialRecord.php +++ b/app/Model/v3/FinancialRecord.php @@ -107,6 +107,7 @@ class FinancialRecord extends Model ]; protected $appends = [ 'created_at_text', + 'money_text' ]; public function getCreatedAtTextAttribute() @@ -119,4 +120,13 @@ class FinancialRecord extends Model * @var array */ protected $casts = []; + + public function getMoneyTextAttribute() + { + if($this->attributes['money_type'] >= 100){ + return '- ¥ '.$this->attributes['money']; + }else{ + return '+ ¥ '.$this->attributes['money']; + } + } } \ No newline at end of file diff --git a/app/Model/v3/StoreWithdrawal.php b/app/Model/v3/StoreWithdrawal.php index c2f089f..7ae24a0 100644 --- a/app/Model/v3/StoreWithdrawal.php +++ b/app/Model/v3/StoreWithdrawal.php @@ -13,7 +13,8 @@ class StoreWithdrawal extends Model 'state_text', 'check_time_text', 'created_at_text', - 'pay_type_text' + 'pay_type_text', + 'real_cash_text' ]; public function getStateTextAttribute() @@ -39,4 +40,9 @@ class StoreWithdrawal extends Model { return '提现到'.WithdrawalType::getMessage($this->attributes['type']); } + + public function getRealCashTextAttribute() + { + return '¥ '.WithdrawalType::getMessage($this->attributes['real_cash']); + } } \ No newline at end of file diff --git a/app/Service/v3/Implementations/RevenueListService.php b/app/Service/v3/Implementations/RevenueListService.php index aff796f..60555a8 100644 --- a/app/Service/v3/Implementations/RevenueListService.php +++ b/app/Service/v3/Implementations/RevenueListService.php @@ -28,7 +28,8 @@ class RevenueListService implements RevenueListServiceInterface $financialRecord = new FinancialRecord(); $mod = bcmod((string)$userId, '5', 0); $financialRecord->suffix($mod); - $builder = $financialRecord->where('user_id',$userId); + $builder = $financialRecord->where('user_id',$userId) + ->where('money_type','<',100); // if(!empty($startTime) && !empty($endTime)){ // $builder->whereBetween('created_at',[strtotime($startTime.' 00:00:00'),strtotime($endTime.' 23:59:59')]); // }