// +---------------------------------------------------------------------- namespace app\dao\store; use app\dao\BaseDao; use app\model\store\StoreConfig; //use crmeb\traits\SearchDaoTrait; /** * Class StoreConfigDao * @package app\dao\store */ class StoreConfigDao extends BaseDao { // use SearchDaoTrait; /** * @return string */ protected function setModel(): string { return StoreConfig::class; } /** * 获取门店配置 * @param array $keys * @param int $type * @param int $relation_id * @param int $printId * @return \crmeb\basic\BaseModel|mixed|\think\Model */ public function searchs(array $keys = [], int $type = 0, int $relation_id = 0, int $printId = 0) { return parent::search()->when($keys, function($query) use($keys) { $query->whereIn('key_name', $keys); })->where('type', $type)->where('relation_id', $relation_id)->where('print_id', $printId); } }