From 0718114253ce8d0865305e240e6e7ea2991b138d Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Thu, 21 Jan 2021 14:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=BA=E5=B0=91=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/crmeb/app/dao/other/AuxiliaryDao.php | 34 +++++++++ src/crmeb/app/model/other/Auxiliary.php | 88 ++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 src/crmeb/app/dao/other/AuxiliaryDao.php create mode 100644 src/crmeb/app/model/other/Auxiliary.php 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); + } +}