| 2 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
namespace App\Models;
|
|
|
4 |
|
|
|
5 |
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
6 |
use Illuminate\Database\Eloquent\Model;
|
|
|
7 |
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
8 |
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|
|
9 |
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
10 |
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
|
11 |
|
| 415 |
lars |
12 |
/**
|
|
|
13 |
* App\Models\Order
|
|
|
14 |
*
|
|
|
15 |
* @property int $id
|
|
|
16 |
* @property int|null $shop_id
|
|
|
17 |
* @property int|null $user_id
|
|
|
18 |
* @property int|null $order_type_id
|
|
|
19 |
* @property int|null $shipping_group_id
|
|
|
20 |
* @property int|null $payment_method_id
|
|
|
21 |
* @property int|null $bill_addr_id
|
|
|
22 |
* @property int|null $ship_addr_id
|
|
|
23 |
* @property int $paid
|
|
|
24 |
* @property string|null $paid_at
|
|
|
25 |
* @property string|null $paid_comment
|
|
|
26 |
* @property string $foreign_id
|
|
|
27 |
* @property string $foreign_payment_id
|
|
|
28 |
* @property string $status
|
|
|
29 |
* @property string $total_amount_buffer
|
|
|
30 |
* @property string $item_status_buffer
|
|
|
31 |
* @property string $invoice_status_buffer
|
|
|
32 |
* @property string $delivery_note_status_buffer
|
|
|
33 |
* @property int $tax
|
|
|
34 |
* @property string $comment
|
|
|
35 |
* @property string $external_comment
|
|
|
36 |
* @property string $note
|
|
|
37 |
* @property string $additional_info
|
|
|
38 |
* @property string $kk_info
|
|
|
39 |
* @property string $created_by
|
|
|
40 |
* @property string $updated_by
|
|
|
41 |
* @property \Illuminate\Support\Carbon|null $created_at
|
|
|
42 |
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
|
43 |
* @property-read \App\Models\OrderAddress|null $billAddr
|
|
|
44 |
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\OrderItem> $orderItem
|
|
|
45 |
* @property-read int|null $order_item_count
|
|
|
46 |
* @property-read \App\Models\OrderType|null $orderType
|
|
|
47 |
* @property-read \App\Models\OrderAddress|null $shipAddr
|
|
|
48 |
* @property-read \App\Models\Shop|null $shop
|
|
|
49 |
* @method static \Database\Factories\OrderFactory factory($count = null, $state = [])
|
|
|
50 |
* @method static \Illuminate\Database\Eloquent\Builder|Order newModelQuery()
|
|
|
51 |
* @method static \Illuminate\Database\Eloquent\Builder|Order newQuery()
|
|
|
52 |
* @method static \Illuminate\Database\Eloquent\Builder|Order query()
|
|
|
53 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereAdditionalInfo($value)
|
|
|
54 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereBillAddrId($value)
|
|
|
55 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereComment($value)
|
|
|
56 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereCreatedAt($value)
|
|
|
57 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereCreatedBy($value)
|
|
|
58 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereDeliveryNoteStatusBuffer($value)
|
|
|
59 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereExternalComment($value)
|
|
|
60 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereForeignId($value)
|
|
|
61 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereForeignPaymentId($value)
|
|
|
62 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereId($value)
|
|
|
63 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereInvoiceStatusBuffer($value)
|
|
|
64 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereItemStatusBuffer($value)
|
|
|
65 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereKkInfo($value)
|
|
|
66 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereNote($value)
|
|
|
67 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereOrderTypeId($value)
|
|
|
68 |
* @method static \Illuminate\Database\Eloquent\Builder|Order wherePaid($value)
|
|
|
69 |
* @method static \Illuminate\Database\Eloquent\Builder|Order wherePaidAt($value)
|
|
|
70 |
* @method static \Illuminate\Database\Eloquent\Builder|Order wherePaidComment($value)
|
|
|
71 |
* @method static \Illuminate\Database\Eloquent\Builder|Order wherePaymentMethodId($value)
|
|
|
72 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereShipAddrId($value)
|
|
|
73 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereShippingGroupId($value)
|
|
|
74 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereShopId($value)
|
|
|
75 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereStatus($value)
|
|
|
76 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereTax($value)
|
|
|
77 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereTotalAmountBuffer($value)
|
|
|
78 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereUpdatedAt($value)
|
|
|
79 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereUpdatedBy($value)
|
|
|
80 |
* @method static \Illuminate\Database\Eloquent\Builder|Order whereUserId($value)
|
|
|
81 |
* @mixin \Eloquent
|
|
|
82 |
*/
|
|
|
83 |
class Order extends Model
|
| 2 |
lars |
84 |
{
|
|
|
85 |
use HasFactory;
|
|
|
86 |
|
|
|
87 |
public function orderItem(): HasMany
|
|
|
88 |
{
|
|
|
89 |
return $this->hasMany( OrderItem::class )->orderBy( 'rank' );
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
public function orderType(): BelongsTo
|
|
|
93 |
{
|
|
|
94 |
return $this->belongsTo( OrderType::class );
|
|
|
95 |
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
public function billAddr(): BelongsTo
|
|
|
99 |
{
|
|
|
100 |
return $this->belongsTo( OrderAddress::class, 'bill_addr_id' );
|
|
|
101 |
}
|
|
|
102 |
public function shop(): BelongsTo
|
|
|
103 |
{
|
|
|
104 |
return $this->belongsTo( Shop::class );
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
public function shipAddr(): BelongsTo
|
|
|
108 |
{
|
|
|
109 |
return $this->belongsTo( OrderAddress::class, 'ship_addr_id' );
|
|
|
110 |
}
|
|
|
111 |
}
|