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')]); // }