2023-09-11 11:35:16 +08:00
|
|
|
|
<?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;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-11 14:52:24 +08:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-11 15:27:11 +08:00
|
|
|
|
public function delete($id)
|
|
|
|
|
{
|
|
|
|
|
$res = $this->dao->delete($id);
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-11 11:35:16 +08:00
|
|
|
|
}
|