You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ymww_backend/application/admin/model/shopro/dispatch/DispatchAutosend.php

36 lines
735 B

1 year ago
<?php
namespace app\admin\model\shopro\dispatch;
use app\admin\model\shopro\Common;
class DispatchAutosend extends Common
{
protected $name = 'shopro_dispatch_autosend';
protected $append = [
];
public function getContentAttr($value, $data)
{
$value = $value ?: ($data['content'] ?? '');
$type = $data['type'] ?? 'text';
if ($type === 'params') {
$value = json_decode($value, true);
}
return $value;
}
public function setContentAttr($value, $data)
{
$type = $data['type'] ?? 'text';
if ($type == 'params') {
$value = json_encode($value);
}
return $value;
}
}