first commit
This commit is contained in:
commit
0baac018a2
1011 changed files with 145854 additions and 0 deletions
137
app/Models/UserHistory.php
Normal file
137
app/Models/UserHistory.php
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\User;
|
||||
|
||||
/**
|
||||
* Class UserHistory
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int $shopping_order_id
|
||||
* @property int $product_id
|
||||
* @property string $action
|
||||
* @property int $referenz
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Product $product
|
||||
* @property ShoppingOrder $shopping_order
|
||||
* @property User $user
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereAction($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereProductId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereReferenz($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereShoppingOrderId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereUserId($value)
|
||||
* @mixin \Eloquent
|
||||
* @property string|null $identifier
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereIdentifier($value)
|
||||
* @property int|null $abo_options
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\UserHistory whereAboOptions($value)
|
||||
*/
|
||||
class UserHistory extends Model
|
||||
{
|
||||
protected $table = 'user_histories';
|
||||
|
||||
protected $status_types = [
|
||||
0 => 'info',
|
||||
1 => 'store_payment',
|
||||
2 => 'checkout_payment',
|
||||
3 => 'payment_error',
|
||||
4 => 'payment_redirect',
|
||||
5 => 'payment_approved',
|
||||
6 => 'txaction_failed',
|
||||
7 => 'txaction_appointed',
|
||||
8 => 'txaction_paid',
|
||||
9 => 'success_payment',
|
||||
10 => 'success',
|
||||
21 => 'payment_not_found',
|
||||
22 => 'checkout_cancel',
|
||||
23 => 'checkout_error',
|
||||
31 => 'reminder_first',
|
||||
32 => 'reminder_first_sepa',
|
||||
33 => 'reminder_sec',
|
||||
34 => 'reminder_last',
|
||||
35 => 'reminder_deaktiv',
|
||||
36 => 'reminder_deaktiv_sepa',
|
||||
37 => 'reminder_collect_sepa',
|
||||
|
||||
50 => 'delete_membership'
|
||||
];
|
||||
protected $status_colors = [
|
||||
0 => 'info',
|
||||
1 => 'warning',
|
||||
2 => 'warning',
|
||||
3 => 'danger',
|
||||
4 => 'warning',
|
||||
5 => 'warning',
|
||||
6 => 'danger',
|
||||
7 => 'warning',
|
||||
8 => 'success',
|
||||
9 => 'secondary',
|
||||
10 => 'success',
|
||||
21 => 'danger',
|
||||
22 => 'danger',
|
||||
23 => 'danger',
|
||||
];
|
||||
protected $casts = [
|
||||
'user_id' => 'int',
|
||||
'shopping_order_id' => 'int',
|
||||
'product_id' => 'int',
|
||||
'referenz' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'shopping_order_id',
|
||||
'product_id',
|
||||
'action',
|
||||
'referenz',
|
||||
'identifier',
|
||||
'abo_options',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function product()
|
||||
{
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
|
||||
public function shopping_order()
|
||||
{
|
||||
return $this->belongsTo(ShoppingOrder::class);
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function getStatusType(){
|
||||
if(isset($this->status_types[$this->status])){
|
||||
return $this->status_types[$this->status];
|
||||
}
|
||||
}
|
||||
public function getStatusColor(){
|
||||
if(isset($this->status_colors[$this->status])){
|
||||
return $this->status_colors[$this->status];
|
||||
}
|
||||
return 'default';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue