接单员与财务管理

This commit is contained in:
liu
2026-06-17 10:35:13 +08:00
parent 254823e308
commit 8d52e863b9
110 changed files with 6054 additions and 570 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Modules\Task\Models;
use Illuminate\Database\Eloquent\Model;
class TaskBidModel extends Model
{
protected $table = 'task_bids';
protected $fillable = [
'task_id',
'user_id',
'price',
'message',
'status',
'accepted_at',
];
protected $casts = [
'price' => 'decimal:2',
'status' => 'integer',
'task_id' => 'integer',
'user_id' => 'integer',
'accepted_at' => 'datetime',
];
}
+26
View File
@@ -0,0 +1,26 @@
<?php
namespace Modules\Task\Models;
use Illuminate\Database\Eloquent\Model;
class TaskCategoryModel extends Model
{
protected $table = 'task_categories';
protected $fillable = [
'name',
'slug',
'description',
'icon',
'form_schema',
'sort',
'status',
];
protected $casts = [
'sort' => 'integer',
'status' => 'integer',
'form_schema' => 'array',
];
}
+67
View File
@@ -0,0 +1,67 @@
<?php
namespace Modules\Task\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class TaskOrderModel extends Model
{
protected $table = 'task_orders';
protected $fillable = [
'order_no',
'user_id',
'runner_id',
'category_id',
'title',
'description',
'images',
'extra',
'price',
'address',
'contact_name',
'contact_mobile',
'deadline',
'pay_type',
'pay_status',
'paid_at',
'status',
'cancel_reason',
'remark',
'accepted_at',
'completed_at',
'cancelled_at',
];
protected $casts = [
'images' => 'array',
'extra' => 'array',
'price' => 'decimal:2',
'pay_type' => 'integer',
'pay_status' => 'integer',
'status' => 'integer',
'user_id' => 'integer',
'runner_id' => 'integer',
'category_id' => 'integer',
'deadline' => 'datetime',
'paid_at' => 'datetime',
'accepted_at' => 'datetime',
'completed_at' => 'datetime',
'cancelled_at' => 'datetime',
];
protected $with = ['category'];
protected $appends = ['category_slug'];
public function category(): BelongsTo
{
return $this->belongsTo(TaskCategoryModel::class, 'category_id');
}
public function getCategorySlugAttribute(): ?string
{
return $this->category?->slug;
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace Modules\Task\Models;
use Illuminate\Database\Eloquent\Model;
class TaskPaymentModel extends Model
{
protected $table = 'task_payments';
protected $fillable = [
'payment_no',
'order_id',
'user_id',
'payment_transaction_id',
'amount',
'pay_type',
'status',
'paid_at',
'refund_at',
];
protected $casts = [
'amount' => 'decimal:2',
'pay_type' => 'integer',
'status' => 'integer',
'order_id' => 'integer',
'user_id' => 'integer',
'payment_transaction_id' => 'integer',
'paid_at' => 'datetime',
'refund_at' => 'datetime',
];
}