diff --git a/src/crmeb/app/dao/other/AuxiliaryDao.php b/src/crmeb/app/dao/other/AuxiliaryDao.php new file mode 100644 index 00000000..e4550714 --- /dev/null +++ b/src/crmeb/app/dao/other/AuxiliaryDao.php @@ -0,0 +1,34 @@ + +// +---------------------------------------------------------------------- + +namespace app\dao\other; + + +use app\dao\BaseDao; +use app\model\other\Auxiliary; + +/** + * 辅助表 + * Class AuxiliaryDao + * @package app\dao\other + */ +class AuxiliaryDao extends BaseDao +{ + + /** + * @return string + */ + protected function setModel(): string + { + return Auxiliary::class; + } + +} diff --git a/src/crmeb/app/model/other/Auxiliary.php b/src/crmeb/app/model/other/Auxiliary.php new file mode 100644 index 00000000..196195b1 --- /dev/null +++ b/src/crmeb/app/model/other/Auxiliary.php @@ -0,0 +1,88 @@ + +// +---------------------------------------------------------------------- + +namespace app\model\other; + + +use crmeb\basic\BaseModel; +use crmeb\traits\ModelTrait; + +/** + * 辅助表 + * Class Auxiliary + * @package app\model\other + */ +class Auxiliary extends BaseModel +{ + + use ModelTrait; + + /** + * 表明 + * @var string + */ + protected $name = 'auxiliary'; + + /** + * @var string[] + */ + protected $insert = ['add_time']; + + /** + * @var bool + */ + protected $autoWriteTimestamp = false; + + /** + * 主键 + * @var string + */ + protected $pk = 'id'; + + /** + * 类型搜索器 + * @param $query + * @param $value + */ + public function searchTypeAttr($query, $value) + { + $query->where('type', $value); + } + + /** + * 类型绑定id搜索器 + * @param $query + * @param $value + */ + public function searchBindingIdAttr($query, $value) + { + $query->where('binding_id', $value); + } + + /** + * 类型状态搜索器 + * @param $query + * @param $value + */ + public function searchStatusAttr($query, $value) + { + $query->whereIn('status', $value); + } + /** + * 类型关联id搜索器 + * @param $query + * @param $value + */ + public function searchRelationIdAttr($query, $value) + { + $query->where('relation_id', $value); + } +}