<?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();
|
}
|
|
}
|