65 lines
1.7 KiB
PHP
Executable File
65 lines
1.7 KiB
PHP
Executable File
<?php
|
||
|
||
// +----------------------------------------------------------------------
|
||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||
// +----------------------------------------------------------------------
|
||
// | Author: CRMEB Team <admin@crmeb.com>
|
||
// +----------------------------------------------------------------------
|
||
|
||
|
||
namespace app\common\repositories\system;
|
||
|
||
|
||
use app\common\dao\system\AppUpdateDao;
|
||
use app\common\repositories\BaseRepository;
|
||
use think\db\exception\DbException;
|
||
use think\exception\ValidateException;
|
||
use think\facade\Cache;
|
||
|
||
/**
|
||
* Class LhappRepository
|
||
* @package app\common\repositories\system
|
||
* @author xaboy
|
||
* @day 2020-04-24
|
||
* @mixin CacheDao
|
||
*/
|
||
class LhappRepository extends BaseRepository
|
||
{
|
||
|
||
|
||
/**
|
||
* CacheRepository constructor.
|
||
* @param CacheDao $dao
|
||
*/
|
||
public function __construct(AppUpdateDao $dao)
|
||
{
|
||
$this->dao = $dao;
|
||
}
|
||
|
||
public function getList($where, $page, $limit)
|
||
{
|
||
$query = $this->dao->search($where);
|
||
$count = $query->count();
|
||
$list = $query->page($page, $limit)->order('id DESC')->select();
|
||
return compact('count', 'list');
|
||
}
|
||
|
||
public function detail($id)
|
||
{
|
||
$find = $this->dao->search(['id' => $id])->find();
|
||
if (!$find) throw new ValidateException('数据不存在');
|
||
return $find;
|
||
}
|
||
|
||
public function delete($id)
|
||
{
|
||
$res = $this->dao->delete($id);
|
||
return $res;
|
||
}
|
||
|
||
}
|