quanwei
2025-12-19 408c463c5b66bba2aa1c81d8dca23e04c1608e24
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
48
49
50
51
52
53
54
55
<?php
namespace app\common\model\admin;
 
use app\common\model\BaseModel;
 
/**
 * 数据字典
 */
class Client_applic extends BaseModel
{
    protected $name = 'dlclient_applic';
    protected $pk = 'id';
    
    /**
     * 模板详情
     */
    public static function detail($id)
    {
        return self::find($id);
    }
    public static function getListByApplicId($client_id,$applic_id)
    {
        $model = new static();
        return $model::withoutGlobalScope()->where('client_id', '=', $client_id)
            ->where('applic_id', '=', $applic_id)
            ->where('is_delete','=','0')
            ->select();
    }
    /**
     * 通过插件分类id查询
     */
    public static function getListByClientId($client_id){
        $model = new static();
        return $model::withoutGlobalScope()->where('client_id', '=', $client_id)
            ->where('is_delete','=','0')
            ->order('create_time','asc')
            ->select();
    }
    /**
     * 软删除
     */
    public function setDelete()
    {
        return $this->save(['is_delete' => 1]);
    }
    
    public static function addApplication($data){
        return $this->save([
            'client_id' => $data['client_id'],
            'applic_id' => $data['applic_id'],
            'agent_id' => $data['agent_id']
        ]);
    }
    
}