mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-01-23 02:28:11 +00:00
27 lines
597 B
PHP
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;
|
|
}
|
|
} |