123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- declare (strict_types=1);
- namespace app\services\diy;
- use app\services\BaseServices;
- use app\dao\diy\PageLinkDao;
- use crmeb\exceptions\AdminException;
- class PageLinkServices extends BaseServices
- {
-
- public function __construct(PageLinkDao $dao)
- {
- $this->dao = $dao;
- }
-
- public function getLinkList(array $where)
- {
- [$page, $limit] = $this->getPageValue();
- $list = $this->dao->getList($where, '*', $page, $limit);
- $count = $this->dao->count($where);
- return compact('list', 'count');
- }
-
- public function del(int $id)
- {
- $res = $this->dao->delete($id);
- if (!$res) throw new AdminException('删除失败');
- }
- }
|