// +---------------------------------------------------------------------- namespace app\services\other; use app\dao\other\CategoryDao; use app\services\BaseServices; use crmeb\traits\ServicesTrait; /** * Class CategoryServices * @package app\services\other * @mixin CategoryDao */ class CategoryServices extends BaseServices { use ServicesTrait; protected $cacheName = 'crmeb_cate'; /** * CategoryServices constructor. * @param CategoryDao $dao */ public function __construct(CategoryDao $dao) { $this->dao = $dao; } /** * 获取分类列表 * @param array $where * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getCateList(array $where = [], array $field = ['*'], array $with = []) { [$page, $limit] = $this->getPageValue(); $data = $this->dao->getCateList($where, $page, $limit, $field, $with); $count = $this->dao->count($where); return compact('data', 'count'); } /**桌码管理 * @param array $where * @param array $field * @param array $with * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getTableCodeCateList(array $where = [], array $field = ['*'], array $with = []) { $data = $this->dao->getCateList($where, 0, 0, $field, $with); return $data; } }