商户订单

This commit is contained in:
liu
2026-06-17 10:52:47 +08:00
parent 8d52e863b9
commit 845bea4b81
35 changed files with 1716 additions and 0 deletions
@@ -0,0 +1,29 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class MerchantWithdrawalModel extends Model
{
protected $table = 'merchant_withdrawals';
protected $fillable = [
'withdraw_no',
'merchant_id',
'amount',
'channel',
'account_info',
'status',
'remark',
'processed_at',
];
protected $casts = [
'merchant_id' => 'integer',
'amount' => 'decimal:2',
'account_info' => 'array',
'status' => 'integer',
'processed_at' => 'datetime',
];
}
@@ -0,0 +1,28 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class OrderItemModel extends Model
{
protected $table = 'order_items';
protected $fillable = [
'order_id',
'product_id',
'product_name',
'product_image',
'price',
'quantity',
'subtotal',
];
protected $casts = [
'order_id' => 'integer',
'product_id' => 'integer',
'price' => 'decimal:2',
'quantity' => 'integer',
'subtotal' => 'decimal:2',
];
}
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class OrderModel extends Model
{
protected $table = 'orders';
protected $fillable = [
'order_no',
'user_id',
'merchant_id',
'address_id',
'total_amount',
'discount_amount',
'delivery_fee',
'payment_amount',
'pay_type',
'pay_status',
'paid_at',
'status',
'cancel_reason',
'remark',
'completed_at',
];
protected $casts = [
'total_amount' => 'decimal:2',
'discount_amount' => 'decimal:2',
'delivery_fee' => 'decimal:2',
'payment_amount' => 'decimal:2',
'pay_type' => 'integer',
'pay_status' => 'integer',
'status' => 'integer',
'user_id' => 'integer',
'merchant_id' => 'integer',
'address_id' => 'integer',
'paid_at' => 'datetime',
'completed_at' => 'datetime',
];
}
@@ -0,0 +1,33 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class OrderPaymentModel extends Model
{
protected $table = 'order_payments';
protected $fillable = [
'payment_no',
'order_id',
'user_id',
'payment_transaction_id',
'amount',
'pay_type',
'status',
'paid_at',
'refund_at',
];
protected $casts = [
'order_id' => 'integer',
'user_id' => 'integer',
'payment_transaction_id' => 'integer',
'amount' => 'decimal:2',
'pay_type' => 'integer',
'status' => 'integer',
'paid_at' => 'datetime',
'refund_at' => 'datetime',
];
}
@@ -0,0 +1,35 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class OrderRefundModel extends Model
{
protected $table = 'order_refunds';
protected $fillable = [
'refund_no',
'order_id',
'order_item_id',
'user_id',
'merchant_id',
'amount',
'reason',
'images',
'status',
'reply',
'processed_at',
];
protected $casts = [
'order_id' => 'integer',
'order_item_id' => 'integer',
'user_id' => 'integer',
'merchant_id' => 'integer',
'amount' => 'decimal:2',
'images' => 'array',
'status' => 'integer',
'processed_at' => 'datetime',
];
}