Browse Source

提现明细 账户收入明细

master
Lemon 5 years ago
parent
commit
eb1e6f23e5
  1. 10
      app/Model/v3/FinancialRecord.php
  2. 8
      app/Model/v3/StoreWithdrawal.php
  3. 3
      app/Service/v3/Implementations/RevenueListService.php

10
app/Model/v3/FinancialRecord.php

@ -107,6 +107,7 @@ class FinancialRecord extends Model
]; ];
protected $appends = [ protected $appends = [
'created_at_text', 'created_at_text',
'money_text'
]; ];
public function getCreatedAtTextAttribute() public function getCreatedAtTextAttribute()
@ -119,4 +120,13 @@ class FinancialRecord extends Model
* @var array * @var array
*/ */
protected $casts = []; protected $casts = [];
public function getMoneyTextAttribute()
{
if($this->attributes['money_type'] >= 100){
return '- ¥ '.$this->attributes['money'];
}else{
return '+ ¥ '.$this->attributes['money'];
}
}
} }

8
app/Model/v3/StoreWithdrawal.php

@ -13,7 +13,8 @@ class StoreWithdrawal extends Model
'state_text', 'state_text',
'check_time_text', 'check_time_text',
'created_at_text', 'created_at_text',
'pay_type_text'
'pay_type_text',
'real_cash_text'
]; ];
public function getStateTextAttribute() public function getStateTextAttribute()
@ -39,4 +40,9 @@ class StoreWithdrawal extends Model
{ {
return '提现到'.WithdrawalType::getMessage($this->attributes['type']); return '提现到'.WithdrawalType::getMessage($this->attributes['type']);
} }
public function getRealCashTextAttribute()
{
return '¥ '.WithdrawalType::getMessage($this->attributes['real_cash']);
}
} }

3
app/Service/v3/Implementations/RevenueListService.php

@ -28,7 +28,8 @@ class RevenueListService implements RevenueListServiceInterface
$financialRecord = new FinancialRecord(); $financialRecord = new FinancialRecord();
$mod = bcmod((string)$userId, '5', 0); $mod = bcmod((string)$userId, '5', 0);
$financialRecord->suffix($mod); $financialRecord->suffix($mod);
$builder = $financialRecord->where('user_id',$userId);
$builder = $financialRecord->where('user_id',$userId)
->where('money_type','<',100);
// if(!empty($startTime) && !empty($endTime)){ // if(!empty($startTime) && !empty($endTime)){
// $builder->whereBetween('created_at',[strtotime($startTime.' 00:00:00'),strtotime($endTime.' 23:59:59')]); // $builder->whereBetween('created_at',[strtotime($startTime.' 00:00:00'),strtotime($endTime.' 23:59:59')]);
// } // }

Loading…
Cancel
Save