47 lines
939 B
PHP
47 lines
939 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Order extends Model
|
|
{
|
|
public const STATUS_PENDING = 0; // 待付款
|
|
public const STATUS_COMPLETED = 9; // 已完成
|
|
public const STATUS_CANCELLED = 10; // 已取消
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'user_id',
|
|
'sn',
|
|
'coupon_disount_amount',
|
|
'vip_disount_amount',
|
|
'reduced_amount',
|
|
'shipping_fee',
|
|
'products_total_amount',
|
|
'total_amount',
|
|
'weight',
|
|
'note',
|
|
'remark',
|
|
'pay_sn',
|
|
'pay_way',
|
|
'pay_at',
|
|
'consignee_name',
|
|
'consignee_telephone',
|
|
'consignee_zone',
|
|
'consignee_address',
|
|
'status',
|
|
'completed_at',
|
|
];
|
|
|
|
/**
|
|
* 属于此订单的商品
|
|
*/
|
|
public function products()
|
|
{
|
|
return $this->hasMany(OrderProduct::class);
|
|
}
|
|
}
|