This commit is contained in:
Kevin Adametz 2024-08-05 12:05:24 +02:00
parent 04d677d37a
commit bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions

View file

@ -6,6 +6,7 @@
namespace App\Models;
use App\Services\HTMLHelper;
use App\User;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
@ -46,11 +47,11 @@ class UserCreditItem extends Model
public static $statusTypes = [
1 => 'Provision Shop',
2 => 'Provision Payline',
3 => 'Guthaben hinzugefügt',
4 => 'commission ...',
5 => 'Provision Wachstumsbonus',
1 => 'commission_shop',
2 => 'commission_payline',
3 => 'credit_added',
4 => 'commission',
5 => 'commission_growth_bonus',
];
@ -73,6 +74,8 @@ class UserCreditItem extends Model
'user_business_id' => 'int',
'credit' => 'float',
'status' => 'int',
'from_month' => 'int',
'from_year' => 'int',
'paid' => 'bool'
];
@ -83,6 +86,8 @@ class UserCreditItem extends Model
'credit',
'message',
'status',
'from_month',
'from_year',
'paid'
];
@ -106,12 +111,28 @@ class UserCreditItem extends Model
}
public function getStatusType(){
return isset(self::$statusTypes[$this->status]) ? self::$statusTypes[$this->status] : "";
return isset(self::$statusTypes[$this->status]) ? __('payment.'.self::$statusTypes[$this->status]) : "";
}
public function getStatusColor(){
return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default";
}
public function getTransMessage(){
$ret = "";
if(strpos($this->message, '#')){
$em = explode("#", $this->message);
if(isset($em[0])){ //Provision
$ret .= trans($em[0])." ";
}
if(isset($em[1])){ //month
$ret .= HTMLHelper::getMonth($em[1])." ";
}
if(isset($em[2])){ //year
$ret .= $em[2];
}
}
return $ret;
}
}