校园商户

This commit is contained in:
liu
2026-06-17 09:13:49 +08:00
parent 86be1c230e
commit 254823e308
50 changed files with 2186 additions and 40 deletions
@@ -0,0 +1,24 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class MerchantCategoryModel extends Model
{
protected $table = 'merchant_categories';
protected $fillable = [
'name',
'slug',
'description',
'icon',
'sort',
'status',
];
protected $casts = [
'sort' => 'integer',
'status' => 'integer',
];
}
@@ -0,0 +1,42 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class MerchantProductModel extends Model
{
use SoftDeletes;
protected $table = 'merchant_products';
protected $fillable = [
'merchant_id',
'category_id',
'name',
'description',
'images',
'price',
'original_price',
'stock',
'unit',
'sales',
'status',
'is_recommend',
'sort',
];
protected $casts = [
'merchant_id' => 'integer',
'category_id' => 'integer',
'images' => 'array',
'price' => 'decimal:2',
'original_price' => 'decimal:2',
'stock' => 'integer',
'sales' => 'integer',
'status' => 'integer',
'is_recommend' => 'integer',
'sort' => 'integer',
];
}
@@ -0,0 +1,42 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class MerchantStoreModel extends Model
{
protected $table = 'merchants';
protected $fillable = [
'user_id',
'category_id',
'name',
'logo',
'banner',
'description',
'contact_name',
'contact_mobile',
'province',
'city',
'district',
'address',
'latitude',
'longitude',
'business_hours',
'balance',
'total_income',
'min_price',
'status',
'reject_reason',
];
protected $casts = [
'user_id' => 'integer',
'category_id' => 'integer',
'balance' => 'decimal:2',
'total_income' => 'decimal:2',
'min_price' => 'decimal:2',
'status' => 'integer',
];
}
@@ -0,0 +1,28 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class PrintTaskModel extends Model
{
protected $table = 'print_tasks';
protected $fillable = [
'printer_id',
'order_id',
'content',
'copies',
'status',
'error_msg',
'printed_at',
];
protected $casts = [
'printer_id' => 'integer',
'order_id' => 'integer',
'copies' => 'integer',
'status' => 'integer',
'printed_at' => 'datetime',
];
}
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class PrinterModel extends Model
{
protected $table = 'printers';
protected $fillable = [
'merchant_id',
'name',
'brand',
'model',
'device_no',
'secret_key',
'status',
'config',
];
protected $casts = [
'merchant_id' => 'integer',
'status' => 'integer',
'config' => 'array',
];
}
@@ -0,0 +1,28 @@
<?php
namespace Modules\Merchant\Models;
use Illuminate\Database\Eloquent\Model;
class ProductCategoryModel extends Model
{
protected $table = 'product_categories';
protected $fillable = [
'merchant_id',
'parent_id',
'name',
'slug',
'description',
'icon',
'sort',
'status',
];
protected $casts = [
'merchant_id' => 'integer',
'parent_id' => 'integer',
'sort' => 'integer',
'status' => 'integer',
];
}