quanwei
2025-11-26 6ae85f8ddbae19f5586f4b0c37680fe21889ef14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
 
namespace app\admin\model;
 
use app\common\model\base_dict\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);
    }
 
}