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;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-11 14:52:24 +08:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
}
|