From bdf5f1f0c19753124bb2a9698ac8024b8cda1f50 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Wed, 28 Dec 2022 21:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/HostController.php | 3 +- app/Models/Admin.php | 10 +++--- app/Models/Balance.php | 22 ++++++------ app/Models/Host.php | 39 +++++++++++---------- app/Models/PersonalAccessToken.php | 20 +++++------ app/Models/Task.php | 16 ++++----- app/Models/WorkOrder/Reply.php | 18 +++++----- app/Models/WorkOrder/WorkOrder.php | 26 +++++++------- 8 files changed, 77 insertions(+), 77 deletions(-) diff --git a/app/Http/Controllers/Api/HostController.php b/app/Http/Controllers/Api/HostController.php index a956d2e..be0d9b5 100644 --- a/app/Http/Controllers/Api/HostController.php +++ b/app/Http/Controllers/Api/HostController.php @@ -4,6 +4,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\User\HostRequest; +use App\Jobs\Module\HostJob; use App\Models\Host; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Cache; @@ -60,7 +61,7 @@ public function destroy(HostRequest $request, Host $host): JsonResponse $host->cost(); } - dispatch(new \App\Jobs\Module\HostJob($host, 'delete')); + dispatch(new HostJob($host, 'delete')); return $this->deleted($host); } diff --git a/app/Models/Admin.php b/app/Models/Admin.php index 686f4f3..175e3e7 100644 --- a/app/Models/Admin.php +++ b/app/Models/Admin.php @@ -12,10 +12,10 @@ /** * App\Models\Admin * - * @property int $id - * @property string $email - * @property string $password - * @property string|null $remember_token + * @property int $id + * @property string $email + * @property string $password + * @property string|null $remember_token * @property Carbon|null $created_at * @property Carbon|null $updated_at * @method static Builder|Admin newModelQuery() @@ -31,7 +31,7 @@ */ class Admin extends Authenticatable { - use HasFactory, Cachable; + use Cachable; protected $table = 'admins'; diff --git a/app/Models/Balance.php b/app/Models/Balance.php index 0294b02..e60e17a 100644 --- a/app/Models/Balance.php +++ b/app/Models/Balance.php @@ -13,17 +13,17 @@ /** * App\Models\Balance * - * @property int $id - * @property string|null $order_id - * @property string|null $trade_id - * @property string|null $payment - * @property string $amount - * @property string $remaining_amount - * @property string|null $paid_at - * @property int|null $user_id - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property-read User|null $user + * @property int $id + * @property string|null $order_id + * @property string|null $trade_id + * @property string|null $payment + * @property string $amount + * @property string $remaining_amount + * @property string|null $paid_at + * @property int|null $user_id + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property-read User|null $user * @method static CachedBuilder|Balance all($columns = []) * @method static CachedBuilder|Balance avg($column) * @method static CachedBuilder|Balance cache(array $tags = []) diff --git a/app/Models/Host.php b/app/Models/Host.php index 4a6ab55..a99b4e1 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -3,6 +3,7 @@ namespace App\Models; use App\Events\UserEvent; +use App\Jobs\Module\HostJob; use App\Models\WorkOrder\WorkOrder; use GeneaLabs\LaravelModelCaching\CachedBuilder; use GeneaLabs\LaravelModelCaching\Traits\Cachable; @@ -15,23 +16,23 @@ /** * App\Models\Host * - * @property int $id - * @property string $name - * @property string $module_id - * @property int $user_id - * @property float $price - * @property float|null $managed_price - * @property mixed|null $configuration - * @property string $status - * @property int|null $hour - * @property Carbon|null $suspended_at - * @property string|null $deleted_at - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property-read Module $module - * @property-read User $user - * @property-read Collection|WorkOrder[] $workOrders - * @property-read int|null $work_orders_count + * @property int $id + * @property string $name + * @property string $module_id + * @property int $user_id + * @property float $price + * @property float|null $managed_price + * @property mixed|null $configuration + * @property string $status + * @property int|null $hour + * @property Carbon|null $suspended_at + * @property string|null $deleted_at + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property-read Module $module + * @property-read User $user + * @property-read Collection|WorkOrder[] $workOrders + * @property-read int|null $work_orders_count * @method static CachedBuilder|Host active() * @method static CachedBuilder|Host all($columns = []) * @method static CachedBuilder|Host avg($column) @@ -137,7 +138,7 @@ protected static function boot() // when Updated static::updated(function ($model) { - dispatch(new \App\Jobs\Module\HostJob($model, 'patch')); + dispatch(new HostJob($model, 'patch')); Cache::forget('user_hosts_' . $model->user_id); Cache::forget('user_tasks_' . $model->user_id); @@ -213,7 +214,7 @@ public function safeDelete(): bool } } - dispatch(new \App\Jobs\Module\HostJob($this, 'delete')); + dispatch(new HostJob($this, 'delete')); return true; } diff --git a/app/Models/PersonalAccessToken.php b/app/Models/PersonalAccessToken.php index 339ec7c..a619879 100644 --- a/app/Models/PersonalAccessToken.php +++ b/app/Models/PersonalAccessToken.php @@ -12,16 +12,16 @@ /** * App\Models\PersonalAccessToken * - * @property int $id - * @property string $tokenable_type - * @property int $tokenable_id - * @property string $name - * @property string $token - * @property array|null $abilities - * @property Carbon|null $last_used_at - * @property Carbon|null $expires_at - * @property Carbon|null $created_at - * @property Carbon|null $updated_at + * @property int $id + * @property string $tokenable_type + * @property int $tokenable_id + * @property string $name + * @property string $token + * @property array|null $abilities + * @property Carbon|null $last_used_at + * @property Carbon|null $expires_at + * @property Carbon|null $created_at + * @property Carbon|null $updated_at * @property-read Model|Eloquent $tokenable * @method static CachedBuilder|PersonalAccessToken all($columns = []) * @method static CachedBuilder|PersonalAccessToken avg($column) diff --git a/app/Models/Task.php b/app/Models/Task.php index 1b1be0d..f41406c 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -18,15 +18,15 @@ /** * App\Models\Task * - * @property string $id - * @property string $title - * @property int $progress - * @property string $status - * @property int $user_id - * @property int $host_id + * @property string $id + * @property string $title + * @property int $progress + * @property string $status + * @property int $user_id + * @property int $host_id * @property Carbon|null $created_at * @property Carbon|null $updated_at - * @property-read Host $host + * @property-read Host $host * @method static CachedBuilder|Task all($columns = []) * @method static CachedBuilder|Task avg($column) * @method static CachedBuilder|Task cache(array $tags = []) @@ -62,8 +62,6 @@ */ class Task extends Model { - use HasFactory; - public $incrementing = false; protected $fillable = [ 'host_id', diff --git a/app/Models/WorkOrder/Reply.php b/app/Models/WorkOrder/Reply.php index 53ead6b..0d5c631 100644 --- a/app/Models/WorkOrder/Reply.php +++ b/app/Models/WorkOrder/Reply.php @@ -15,15 +15,15 @@ /** * App\Models\WorkOrder\Reply * - * @property int $id - * @property string $content - * @property int $work_order_id - * @property int|null $user_id - * @property int $is_pending - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property-read User|null $user - * @property-read WorkOrder $workOrder + * @property int $id + * @property string $content + * @property int $work_order_id + * @property int|null $user_id + * @property int $is_pending + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property-read User|null $user + * @property-read WorkOrder $workOrder * @method static CachedBuilder|Reply all($columns = []) * @method static CachedBuilder|Reply avg($column) * @method static CachedBuilder|Reply cache(array $tags = []) diff --git a/app/Models/WorkOrder/WorkOrder.php b/app/Models/WorkOrder/WorkOrder.php index 2769ca8..dff80b0 100644 --- a/app/Models/WorkOrder/WorkOrder.php +++ b/app/Models/WorkOrder/WorkOrder.php @@ -19,20 +19,20 @@ /** * App\Models\WorkOrder\WorkOrder * - * @property int $id - * @property string $title - * @property string $content - * @property int $user_id - * @property string $module_id - * @property int|null $host_id - * @property string $status - * @property Carbon|null $created_at - * @property Carbon|null $updated_at - * @property-read Host|null $host - * @property-read Module $module + * @property int $id + * @property string $title + * @property string $content + * @property int $user_id + * @property string $module_id + * @property int|null $host_id + * @property string $status + * @property Carbon|null $created_at + * @property Carbon|null $updated_at + * @property-read Host|null $host + * @property-read Module $module * @property-read Collection|Reply[] $replies - * @property-read int|null $replies_count - * @property-read User $user + * @property-read int|null $replies_count + * @property-read User $user * @method static CachedBuilder|WorkOrder all($columns = []) * @method static CachedBuilder|WorkOrder avg($column) * @method static CachedBuilder|WorkOrder cache(array $tags = [])