You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
shipin/app/dao/crud/UserComplaintDao.php

61 lines
1.7 KiB

<?php
/**
* +----------------------------------------------------------------------
* | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
* +----------------------------------------------------------------------
* | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
* +----------------------------------------------------------------------
* | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
* +----------------------------------------------------------------------
* | Author: CRMEB Team <admin@crmeb.com>
* +----------------------------------------------------------------------
*/
/**
* 投诉管理
* @author crud自动生成代码
* @date 2023/10/16 15:26:40
*/
namespace app\dao\crud;
use app\dao\BaseDao;
use app\model\crud\UserComplaint;
/**
* Class UserComplaintDao
* @date 2023/10/16
* @package app\dao\crud
*/
class UserComplaintDao extends BaseDao
{
/**
* 设置模型
* @return string
* @date 2023/10/16
*/
protected function setModel(): string
{
return UserComplaint::class;
}
/**
* 搜索
* @param array $where
* @return \crmeb\basic\BaseModel
* @throws \ReflectionException
* @date {%DATE%}
*/
public function searchCrudModel(array $where = [], $field = ['*'], string $order = '', array $with = [])
{
return $this->getModel()->field($field)->when($order !== '', function ($query) use ($order) {
$query->order($order);
})->when($with, function ($query) use ($with) {
$query->with($with);
})->when(!empty($where['school_name']), function($query) use ($where) {
$query->whereLike('school_name', '%'.$where['school_name'].'%');
});
}
}