芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/app/Models/Expense.php
bill) ? asset_url_local_s3(Expense::FILE_PATH . '/' . $this->bill) : ''; } public function currency(): BelongsTo { return $this->belongsTo(Currency::class, 'currency_id'); } public function project(): BelongsTo { return $this->belongsTo(Project::class, 'project_id'); } public function category(): BelongsTo { return $this->belongsTo(ExpensesCategory::class, 'category_id'); } public function user(): BelongsTo { return $this->belongsTo(User::class, 'user_id')->withoutGlobalScope(ActiveScope::class); } public function approver(): BelongsTo { return $this->belongsTo(User::class, 'approver_id')->withoutGlobalScope(ActiveScope::class); } public function recurrings(): HasMany { return $this->hasMany(Expense::class, 'parent_id'); } public function getTotalAmountAttribute() { if (!is_null($this->price) && !is_null($this->currency_id)) { return currency_formatter($this->price, $this->currency->currency_symbol); } return ''; } public function getPurchaseOnAttribute() { if (is_null($this->purchase_date)) { return ''; } return $this->purchase_date->format($this->company ? $this->company->date_format : company()->date_format); } }