liyaozhi
2025-10-29 52b7c373601edbc5010471082eb88dadf70e382d
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
<?php
 
namespace app\admin\model;
 
use app\common\model\admin\Application_category as Application_categoryModel;
use app\admin\model\Application as ApplicationModel;
 
/**
 * 应用分类模型
 */
class Application_category extends Application_categoryModel
{
    /**
     * 获取分类数据以及分类下的应用数据
     */
    public static function getAll()
    {
        $model = new static;
        $list = $model->where('is_delete', '=', 0)->select();
        // 查询分类下的应用
        foreach ($list as $category){
            //$category['children'] = $category['id'];
            $category['children'] = ApplicationModel::getListByPlusCategoryId($category['id']);
        }
        return $list;
    }
 
    /**
     * 新增
     */
    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);
    }
 
}