liyaozhi
2025-10-28 1320688354fd168c51cf2e05f29a2253f4ed9c00
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
<?php
 
namespace app\common\model\branch;
 
use app\common\model\BaseModel;
 
/**
 * 广告分类模型
 */
class Category extends BaseModel
{
    protected $name = 'branch_category';
    protected $pk = 'category_id';
 
    /**
     * 所有分类
     * @return \think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function getALL()
    {
        $model = new static;
        return $model->order(['sort' => 'asc', 'create_time' => 'asc'])->select();
    }
    /**
     * 详情
     */
    public static function detail($category_id)
    {
       return (new static())->find($category_id);
    }
 
}