37 lines
934 B
PHP
37 lines
934 B
PHP
<?php
|
|
namespace app\common\dao\marketing\activity;
|
|
|
|
|
|
use app\common\dao\BaseDao;
|
|
use app\common\model\marketing\activity\Activity;
|
|
|
|
class ActivityDao extends BaseDao{
|
|
|
|
protected function getModel(): string{
|
|
return Activity::class;
|
|
}
|
|
/**
|
|
* Common: 公共搜索模型
|
|
* Author: wu-hui
|
|
* Time: 2024/03/14 15:51
|
|
* @param array $params
|
|
* @return Activity
|
|
*/
|
|
public function searchList(array $params){
|
|
return (new Activity())
|
|
->where('is_del', 0)
|
|
->when(isset($params['id']) && $params['id'] !== '',function($query) use ($params){
|
|
$query->where('id', (int)$params['id']);
|
|
})
|
|
->when(isset($params['title']) && $params['title'] !== '',function($query) use ($params){
|
|
$query->where('title','like',"%{$params['title']}%");
|
|
})
|
|
->order('create_time DESC,id DESC');
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|