57 lines
1.6 KiB
PHP
57 lines
1.6 KiB
PHP
<?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\dao\system;
|
||
|
||
|
||
use app\common\dao\BaseDao;
|
||
use app\common\model\BaseModel;
|
||
use app\common\model\system\AppUpdate;
|
||
use think\db\exception\DbException;
|
||
|
||
/**
|
||
* Class AppUpdateDao
|
||
* @package app\common\dao\system
|
||
* @author xaboy
|
||
* @day 2020-04-24
|
||
*/
|
||
class AppUpdateDao extends BaseDao
|
||
{
|
||
|
||
/**
|
||
* @return BaseModel
|
||
* @author xaboy
|
||
* @day 2020-03-30
|
||
*/
|
||
protected function getModel(): string
|
||
{
|
||
return AppUpdate::class;
|
||
}
|
||
|
||
public function search(array $where = [])
|
||
{
|
||
return AppUpdate::getDB()
|
||
->when(isset($where['id']) && $where['id'] !== '',function($query) use($where){
|
||
$query->where('id',$where['id']);
|
||
})
|
||
->when(isset($where['type']) && $where['type'] !== '',function($query) use($where){
|
||
$query->where('type',$where['type']);
|
||
});
|
||
}
|
||
public function delete(int $id)
|
||
{
|
||
return ($this->getModel()::getDB())->where('id', $id)->delete();
|
||
}
|
||
|
||
}
|