<?php
|
|
namespace app\agent\model;
|
|
use app\common\model\agent\Base_dict as Base_dictModel;
|
|
/**
|
* 数据字典模型
|
*/
|
class Base_dict extends Base_dictModel
|
{
|
/**
|
* 获取字典数据
|
*/
|
public static function getDict($post)
|
{
|
$model = new static;
|
$data = $model->where('is_delete', '=', 0)->where('category', '=', $post)->select();
|
return $data;
|
}
|
|
/**
|
* 新增
|
*/
|
public function add($data)
|
{
|
return $this->save($data);
|
}
|
|
|
/**
|
* 软删除
|
*/
|
public function setDelete()
|
{
|
return $this->save(['is_delete' => 1]);
|
}
|
|
/**
|
* 更新记录
|
*/
|
public function edit($data)
|
{
|
return $this->save($data);
|
}
|
|
}
|