CRMEB/crmeb/app/dao/system/SystemPemDao.php
2025-06-09 10:32:07 +08:00

27 lines
597 B
PHP

<?php
namespace app\dao\system;
use app\dao\BaseDao;
use app\model\system\SystemPem;
class SystemPemDao extends BaseDao
{
protected function setModel(): string
{
return SystemPem::class;
}
public function savePem($data)
{
$info = $this->getModel()->where('name', $data['name'])->find();
if ($info) {
$info = $info->toArray();
$this->getModel()->where('id', $info['id'])->update($data);
} else {
$data['add_time'] = time();
$this->getModel()->save($data);
}
return true;
}
}