Gutschriften

This commit is contained in:
Kevin Adametz 2021-04-23 14:52:25 +02:00
parent 35ae3da244
commit 6ac9fcc4d2
20 changed files with 510 additions and 63 deletions

View file

@ -0,0 +1,68 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class UserPayCredit
*
* @property int $id
* @property int $user_id
* @property float|null $credit
* @property float|null $old_credit_total
* @property float|null $new_credit_total
* @property string|null $message
* @property int $status
* @property int|null $shopping_order_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*
* @property ShoppingOrder|null $shopping_order
* @property User $user
*
* @package App\Models
*/
class UserPayCredit extends Model
{
public $statusType = [
1 => 'add from payment',
2 => 'deduction from payment',
];
protected $table = 'user_pay_credits';
protected $casts = [
'user_id' => 'int',
'credit' => 'float',
'old_credit_total' => 'float',
'new_credit_total' => 'float',
'status' => 'int',
'shopping_order_id' => 'int'
];
protected $fillable = [
'user_id',
'credit',
'old_credit_total',
'new_credit_total',
'message',
'status',
'shopping_order_id'
];
public function shopping_order()
{
return $this->belongsTo(ShoppingOrder::class);
}
public function user()
{
return $this->belongsTo(User::class);
}
}