mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-11 18:32:50 +00:00
修复缺少辅助表
This commit is contained in:
parent
965b23d4fc
commit
0718114253
34
src/crmeb/app/dao/other/AuxiliaryDao.php
Normal file
34
src/crmeb/app/dao/other/AuxiliaryDao.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
88
src/crmeb/app/model/other/Auxiliary.php
Normal file
88
src/crmeb/app/model/other/Auxiliary.php
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user