优化代码
This commit is contained in:
parent
3133463254
commit
3791eddce2
@ -4,13 +4,13 @@
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Module;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
//
|
||||
|
||||
public function index() {
|
||||
public function index()
|
||||
{
|
||||
$modules = Module::paginate(10);
|
||||
|
||||
return view('admin.index', compact('modules'));
|
||||
|
@ -3,9 +3,7 @@
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Transaction;
|
||||
use Illuminate\Http\Request;
|
||||
use function config;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
|
@ -10,8 +10,8 @@ class JsonResponse
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
*
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
|
@ -12,9 +12,9 @@ class RedirectIfAuthenticated
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param string|null ...$guards
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param string|null ...$guards
|
||||
*
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
|
@ -10,8 +10,8 @@ class ValidateUserIfBanned
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
*
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
|
@ -8,10 +8,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 \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Admin newModelQuery()
|
||||
|
@ -11,17 +11,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 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 \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \App\Models\User|null $user
|
||||
* @property-read \App\Models\User|null $user
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance all($columns = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance avg($column)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance cache(array $tags = [])
|
||||
@ -31,7 +31,8 @@
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance disableModelCaching()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance exists()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance flushCache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance
|
||||
* getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance inRandomOrder($seed = '')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance insert(array $values)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Balance isCachable()
|
||||
|
@ -14,8 +14,8 @@
|
||||
/**
|
||||
* App\Models\Module
|
||||
*
|
||||
* @property string $id
|
||||
* @property string $name
|
||||
* @property string $id
|
||||
* @property string $name
|
||||
* @property string|null $api_token
|
||||
* @property string|null $url
|
||||
* @property string|null $wecom_key 企业微信机器人 key
|
||||
@ -28,7 +28,8 @@
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module disableModelCaching()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module exists()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module flushCache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module
|
||||
* getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module inRandomOrder($seed = '')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module insert(array $values)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Module isCachable()
|
||||
|
@ -8,27 +8,29 @@
|
||||
/**
|
||||
* 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 \Illuminate\Support\Carbon|null $last_used_at
|
||||
* @property \Illuminate\Support\Carbon|null $expires_at
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\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 \Illuminate\Support\Carbon|null $last_used_at
|
||||
* @property \Illuminate\Support\Carbon|null $expires_at
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $tokenable
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken all($columns = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken avg($column)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken cache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken cachedValue(array $arguments, string $cacheKey)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken cachedValue(array $arguments, string
|
||||
* $cacheKey)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken count($columns = '*')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken disableCache()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken disableModelCaching()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken exists()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken flushCache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken
|
||||
* getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken inRandomOrder($seed = '')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken insert(array $values)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken isCachable()
|
||||
@ -49,7 +51,8 @@
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken whereTokenableId($value)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken whereTokenableType($value)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken whereUpdatedAt($value)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken withCacheCooldownSeconds(?int $seconds = null)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|PersonalAccessToken withCacheCooldownSeconds(?int
|
||||
* $seconds = null)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class PersonalAccessToken extends SanctumPersonalAccessToken
|
||||
|
@ -15,15 +15,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 \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \App\Models\Host $host
|
||||
* @property-read \App\Models\Host $host
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task all($columns = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task avg($column)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task cache(array $tags = [])
|
||||
@ -33,7 +33,8 @@
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task disableModelCaching()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task exists()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task flushCache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task
|
||||
* getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task inRandomOrder($seed = '')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task insert(array $values)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Task isCachable()
|
||||
|
@ -6,34 +6,49 @@
|
||||
use App\Exceptions\CommonException;
|
||||
use App\Exceptions\User\BalanceNotEnoughException;
|
||||
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
||||
use Illuminate\Contracts\Cache\LockTimeoutException;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
/**
|
||||
* App\Models\User
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $email
|
||||
* @property \Illuminate\Support\Carbon|null $email_verified_at
|
||||
* @property string|null $password
|
||||
* @property float $balance
|
||||
* @property \Illuminate\Support\Carbon|null $banned_at 封禁时间
|
||||
* @property string|null $banned_reason
|
||||
* @property string|null $remember_token
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Host[] $hosts
|
||||
* @property-read int|null $hosts_count
|
||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
|
||||
* @property-read int|null $notifications_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\PersonalAccessToken[] $tokens
|
||||
* @property-read int|null $tokens_count
|
||||
* @property int
|
||||
* $id
|
||||
* @property string
|
||||
* $name
|
||||
* @property string
|
||||
* $email
|
||||
* @property \Illuminate\Support\Carbon|null
|
||||
* $email_verified_at
|
||||
* @property string|null
|
||||
* $password
|
||||
* @property float
|
||||
* $balance
|
||||
* @property \Illuminate\Support\Carbon|null
|
||||
* $banned_at 封禁时间
|
||||
* @property string|null
|
||||
* $banned_reason
|
||||
* @property string|null
|
||||
* $remember_token
|
||||
* @property \Illuminate\Support\Carbon|null
|
||||
* $created_at
|
||||
* @property \Illuminate\Support\Carbon|null
|
||||
* $updated_at
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Host[]
|
||||
* $hosts
|
||||
* @property-read int|null
|
||||
* $hosts_count
|
||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[]
|
||||
* $notifications
|
||||
* @property-read int|null
|
||||
* $notifications_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\PersonalAccessToken[]
|
||||
* $tokens
|
||||
* @property-read int|null
|
||||
* $tokens_count
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User all($columns = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User avg($column)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User cache(array $tags = [])
|
||||
@ -44,7 +59,8 @@
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User exists()
|
||||
* @method static \Database\Factories\UserFactory factory(...$parameters)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User flushCache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User
|
||||
* getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User inRandomOrder($seed = '')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User insert(array $values)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|User isCachable()
|
||||
@ -109,7 +125,7 @@ protected static function boot()
|
||||
// balance 四舍五入
|
||||
|
||||
if ($model->isDirty('balance')) {
|
||||
$model->balance = round($model->balance, 2);
|
||||
$model->balance = round($model->balance, 2, PHP_ROUND_HALF_DOWN);
|
||||
}
|
||||
|
||||
if ($model->isDirty('banned_at')) {
|
||||
@ -132,57 +148,57 @@ public function hosts(): HasMany
|
||||
* @throws CommonException
|
||||
* @throws BalanceNotEnoughException
|
||||
*/
|
||||
public function toDrops($amount = 1)
|
||||
{
|
||||
|
||||
$cache_key = 'user_drops_' . $this->id;
|
||||
|
||||
if ($amount === 0 || $amount === null) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$rate = config('drops.rate');
|
||||
|
||||
|
||||
$transactions = new Transaction();
|
||||
|
||||
$drops = $transactions->getDrops($this->id);
|
||||
|
||||
$total = 0;
|
||||
|
||||
if ($drops < 0) {
|
||||
$amount += abs($drops) / $rate;
|
||||
}
|
||||
|
||||
$total += $amount * $rate;
|
||||
|
||||
|
||||
// amount 保留两位小数
|
||||
$amount = round($amount, 2);
|
||||
|
||||
$lock = Cache::lock("lock_" . $cache_key, 5);
|
||||
try {
|
||||
$lock->block(5);
|
||||
|
||||
$this->balance -= $amount;
|
||||
$this->save();
|
||||
|
||||
$transactions->increaseDrops($this->id, $total);
|
||||
|
||||
// $transactions
|
||||
|
||||
$transactions->addPayoutBalance($this->id, $amount, '自动转换为 Drops');
|
||||
|
||||
// if user balance <= 0
|
||||
if ($this->balance < $amount) {
|
||||
throw new BalanceNotEnoughException('余额不足');
|
||||
}
|
||||
} catch (LockTimeoutException) {
|
||||
throw new CommonException('暂时无法处理此请求,请稍后再试。');
|
||||
} finally {
|
||||
optional($lock)->release();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
// public function toDrops($amount = 1)
|
||||
// {
|
||||
//
|
||||
// $cache_key = 'user_drops_' . $this->id;
|
||||
//
|
||||
// if ($amount === 0 || $amount === null) {
|
||||
// return $this;
|
||||
// }
|
||||
//
|
||||
// $rate = config('drops.rate');
|
||||
//
|
||||
//
|
||||
// $transactions = new Transaction();
|
||||
//
|
||||
// $drops = $transactions->getDrops($this->id);
|
||||
//
|
||||
// $total = 0;
|
||||
//
|
||||
// if ($drops < 0) {
|
||||
// $amount += abs($drops) / $rate;
|
||||
// }
|
||||
//
|
||||
// $total += $amount * $rate;
|
||||
//
|
||||
//
|
||||
// // amount 保留两位小数
|
||||
// $amount = round($amount, 2);
|
||||
//
|
||||
// $lock = Cache::lock("lock_" . $cache_key, 5);
|
||||
// try {
|
||||
// $lock->block(5);
|
||||
//
|
||||
// $this->balance -= $amount;
|
||||
// $this->save();
|
||||
//
|
||||
// $transactions->increaseDrops($this->id, $total);
|
||||
//
|
||||
// // $transactions
|
||||
//
|
||||
// $transactions->addPayoutBalance($this->id, $amount, '自动转换为 Drops');
|
||||
//
|
||||
// // if user balance <= 0
|
||||
// if ($this->balance < $amount) {
|
||||
// throw new BalanceNotEnoughException('余额不足');
|
||||
// }
|
||||
// } catch (LockTimeoutException) {
|
||||
// throw new CommonException('暂时无法处理此请求,请稍后再试。');
|
||||
// } finally {
|
||||
// optional($lock)->release();
|
||||
// }
|
||||
//
|
||||
// return $this;
|
||||
// }
|
||||
}
|
||||
|
@ -12,14 +12,14 @@
|
||||
/**
|
||||
* 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 \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read User|null $user
|
||||
* @property int $id
|
||||
* @property string $content
|
||||
* @property int $work_order_id
|
||||
* @property int|null $user_id
|
||||
* @property int $is_pending
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read User|null $user
|
||||
* @property-read \App\Models\WorkOrder\WorkOrder $workOrder
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply all($columns = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply avg($column)
|
||||
@ -30,7 +30,8 @@
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply disableModelCaching()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply exists()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply flushCache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply
|
||||
* getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply inRandomOrder($seed = '')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply insert(array $values)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|Reply isCachable()
|
||||
|
@ -14,30 +14,32 @@
|
||||
/**
|
||||
* 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 \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\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 \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read Host|null $host
|
||||
* @property-read Module $module
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\WorkOrder\Reply[] $replies
|
||||
* @property-read int|null $replies_count
|
||||
* @property-read User $user
|
||||
* @property-read int|null $replies_count
|
||||
* @property-read User $user
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder all($columns = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder avg($column)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder cache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder cachedValue(array $arguments, string $cacheKey)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder cachedValue(array $arguments, string
|
||||
* $cacheKey)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder count($columns = '*')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder disableCache()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder disableModelCaching()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder exists()
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder flushCache(array $tags = [])
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder
|
||||
* getModelCacheCooldown(\Illuminate\Database\Eloquent\Model $instance)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder inRandomOrder($seed = '')
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder insert(array $values)
|
||||
* @method static \GeneaLabs\LaravelModelCaching\CachedBuilder|WorkOrder isCachable()
|
||||
|
@ -8,6 +8,7 @@
|
||||
class ModuleEarning extends Component
|
||||
{
|
||||
private Module $module;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user