34 lines
933 B
PHP
34 lines
933 B
PHP
<?php
|
|
|
|
namespace App\Models\Business;
|
|
|
|
use App\Abstracts\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/** 快递资料操作日志(财务系统侧):编辑、打款信息新增/变更。 */
|
|
class CourierProfileEvent extends Model
|
|
{
|
|
public const ACTIONS = [
|
|
'edit' => '编辑快递资料',
|
|
'dingtalk_sync' => '钉钉审批回填',
|
|
'account_add' => '打款信息新增',
|
|
'account_change' => '打款信息变更',
|
|
];
|
|
|
|
protected $table = 'business_courier_profile_events';
|
|
|
|
protected $fillable = ['company_id', 'expcode', 'action', 'summary', 'changes', 'created_by'];
|
|
|
|
protected $casts = ['changes' => 'array'];
|
|
|
|
public function creator(): BelongsTo
|
|
{
|
|
return $this->belongsTo(\App\Models\Auth\User::class, 'created_by');
|
|
}
|
|
|
|
public function actionLabel(): string
|
|
{
|
|
return self::ACTIONS[$this->action] ?? $this->action;
|
|
}
|
|
}
|