quanwei
2 days ago 73b874c72ad55eb9eef21c36160ac0de58f0189e
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
<?php
 
namespace app\common\model\plus\release;
 
use think\facade\Cache;
use app\common\model\BaseModel;
 
/**
 * 分类模型
 */
class ReleaseCategory extends BaseModel
{
    protected $pk = 'category_id';
    protected $name = 'release_category';
 
 
    /**
     * 详情
     */
    public static function detail($category_id)
    {
        return (new static())->find($category_id);
    }
 
    /**
     * 所有分类
     */
    public static function getALL()
    {
        $model = new static;
        $data = $model->order(['sort' => 'asc', 'create_time' => 'asc'])->select();
        return $data;
    }
 
 
    public function getListByIds($ids)
    {
        return $this->field(['category_id', 'name'])->where('category_id', 'in', $ids)->select();
    }
 
}