shop-php/app/common/dao/system/AppUpdateDao.php

57 lines
1.6 KiB
PHP
Raw Normal View History

2023-09-11 11:26:33 +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\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']);
});
}
2023-09-11 15:27:11 +08:00
public function delete(int $id)
{
return ($this->getModel()::getDB())->where('id', $id)->delete();
}
2023-09-11 11:26:33 +08:00
}