// +---------------------------------------------------------------------- namespace app\common\model\user; use app\common\model\BaseModel; class UserAssetsLog extends BaseModel { // 设置json类型字段 protected $json = ['ext']; // 设置JSON数据返回数组 protected $jsonAssoc = true; public static function tablePk(): ?string { return 'id'; } public static function tableName(): string { return 'user_assets_log'; } public function user() { return $this->hasOne(User::class, 'uid', 'uid'); } }