chore: 添加静态资源文件和版本配置文件
添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材 添加系统版本配置文件(.version)和常量定义文件(.constant) 更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件 添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
32
app/model/other/Agreement.php
Normal file
32
app/model/other/Agreement.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\model\other;
|
||||
|
||||
use crmeb\traits\ModelTrait;
|
||||
use crmeb\basic\BaseModel;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 协议Model
|
||||
* Class Cache
|
||||
* @package app\model\other
|
||||
*/
|
||||
class Agreement extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
const EXPIRE = 0;
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'agreement';
|
||||
}
|
||||
43
app/model/other/Cache.php
Normal file
43
app/model/other/Cache.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\model\other;
|
||||
|
||||
use crmeb\traits\ModelTrait;
|
||||
use crmeb\basic\BaseModel;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 缓存Model
|
||||
* Class Cache
|
||||
* @package app\model\other
|
||||
*/
|
||||
class Cache extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
const EXPIRE = 0;
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'cache';
|
||||
|
||||
/**
|
||||
* 缓存KEY搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchKeyAttr($query, $value, $data)
|
||||
{
|
||||
$query->where('key', $value);
|
||||
}
|
||||
}
|
||||
176
app/model/other/Category.php
Normal file
176
app/model/other/Category.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\other;
|
||||
|
||||
|
||||
use app\model\product\label\StoreProductLabel;
|
||||
use app\model\product\specs\StoreProductSpecs;
|
||||
use app\model\user\label\UserLabel;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 分类表
|
||||
* Class Category
|
||||
* @package app\model\other
|
||||
*/
|
||||
class Category extends BaseModel
|
||||
{
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 表名
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'category';
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 用户标签
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function label()
|
||||
{
|
||||
return $this->hasMany(UserLabel::class, 'label_cate', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品标签
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function productLabel()
|
||||
{
|
||||
return $this->hasMany(StoreProductLabel::class, 'label_cate', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品参数
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function specs()
|
||||
{
|
||||
return $this->hasMany(StoreProductSpecs::class, 'temp_id', 'id')->order('sort desc');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子集分类查询条件
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(self::class, 'pid', 'id')->where('is_show', 1)->order('sort DESC,id DESC');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 归属人
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchOwnerIdAttr($query, $value)
|
||||
{
|
||||
$query->where('owner_id', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTypeAttr($query, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
if ($value) $query->whereIn('type', $value);
|
||||
} else {
|
||||
if ($value !== '') $query->where('type', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联门店ID、供应商ID搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchRelationIdAttr($query, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
if ($value) $query->whereIn('relation_id', $value);
|
||||
} else {
|
||||
if ($value !== '') $query->where('relation_id', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchSupplierIdAttr($query, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
if ($value) $query->whereIn('relation_id', $value)->where('type', 2);
|
||||
} else {
|
||||
if ($value !== '') $query->where('relation_id', $value)->where('type', 2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchStoreIdAttr($query, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
if ($value) $query->whereIn('relation_id', $value)->where('type', 1);
|
||||
} else {
|
||||
if ($value !== '') $query->where('relation_id', $value)->where('type', 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签类型0:用户1:客服话术
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchGroupAttr($query, $value)
|
||||
{
|
||||
$query->where('group', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchNotIdAttr($query, $value)
|
||||
{
|
||||
$query->where('id', '<>', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类是否显示搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchIsShowAttr($query, $value, $data)
|
||||
{
|
||||
if ($value !== '') $query->where('is_show', $value);
|
||||
}
|
||||
}
|
||||
43
app/model/other/CityArea.php
Normal file
43
app/model/other/CityArea.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\other;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
|
||||
/**
|
||||
* 城市数据(包含街道)
|
||||
* Class CityArea
|
||||
* @package app\model\other
|
||||
*/
|
||||
class CityArea extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'city_area';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $key = 'id';
|
||||
|
||||
/**
|
||||
* @return \think\model\relation\HasOne
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(self::class, 'parent_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
79
app/model/other/Express.php
Normal file
79
app/model/other/Express.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\other;
|
||||
|
||||
use crmeb\traits\ModelTrait;
|
||||
use crmeb\basic\BaseModel;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 物流公司Model
|
||||
* Class Express
|
||||
* @package app\model\other
|
||||
*/
|
||||
class Express extends BaseModel
|
||||
{
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'express';
|
||||
|
||||
/**
|
||||
* 物流公司是否显示
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchIsShowAttr($query, $value, $data)
|
||||
{
|
||||
$query->where('is_show', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物流公司信息是否完善
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
$query->where('status', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* keyword 搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchKeywordAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
$query->whereLike('name|code', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
public function searchCodeAttr($query, $value)
|
||||
{
|
||||
if ($value === '') {
|
||||
$query->where('code', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
88
app/model/other/Qrcode.php
Normal file
88
app/model/other/Qrcode.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 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;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* Class Qrcode
|
||||
* @package app\model\other
|
||||
*/
|
||||
class Qrcode extends BaseModel
|
||||
{
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'qrcode';
|
||||
|
||||
/**
|
||||
* type 搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTypeAttr($query, $value)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->whereLike('type', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* status 搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->whereLike('status', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* third_type 搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchThirdTypeAttr($query, $value)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->whereLike('third_type', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* third_id 搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchThirdIdAttr($query, $value)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->whereLike('third_id', $value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
75
app/model/other/SystemCity.php
Normal file
75
app/model/other/SystemCity.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 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;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 城市数据(已废弃留存)
|
||||
* Class SystemCity
|
||||
* @package app\model\other
|
||||
*/
|
||||
class SystemCity extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'system_city';
|
||||
|
||||
/**
|
||||
* 获取子集分类查询条件
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(self::class, 'parent_id', 'city_id')->order('id ASC');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* city搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchCityIdAttr($query, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
$query->whereIn('city_id', $value);
|
||||
} else {
|
||||
$query->where('city_id', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ParentId搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchParentIdAttr($query, $value)
|
||||
{
|
||||
$query->where('parent_id', $value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
107
app/model/other/import/ImportRecord.php
Normal file
107
app/model/other/import/ImportRecord.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\other\import;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* Class Import
|
||||
* @package app\model\other
|
||||
*/
|
||||
class ImportRecord extends BaseModel
|
||||
{
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'import_record';
|
||||
|
||||
/**
|
||||
* 类型搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
* User: liusl
|
||||
* DateTime: 2024/12/9 下午2:23
|
||||
*/
|
||||
public function searchTypeAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
if (is_array($value)) {
|
||||
$query->whereIn('type', $value);
|
||||
} else {
|
||||
$query->where('type', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
* User: liusl
|
||||
* DateTime: 2024/12/9 下午2:22
|
||||
*/
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
if (is_array($value)) {
|
||||
$query->whereIn('status', $value);
|
||||
} else {
|
||||
$query->where('status', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
* User: liusl
|
||||
* DateTime: 2024/12/9 下午2:22
|
||||
*/
|
||||
public function searchNameAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
$query->whereLike('name', "%{$value}%");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
* User: liusl
|
||||
* DateTime: 2024/12/19 下午4:58
|
||||
*/
|
||||
public function searchIsDelAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
$query->where('is_del', $value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
58
app/model/other/import/ImportRecordError.php
Normal file
58
app/model/other/import/ImportRecordError.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\other\import;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* Class ImportError
|
||||
* @package app\model\other
|
||||
*/
|
||||
class ImportRecordError extends BaseModel
|
||||
{
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'import_record_error';
|
||||
|
||||
|
||||
/**
|
||||
* 关联 id 搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return void
|
||||
* User: liusl
|
||||
* DateTime: 2024/12/9 下午2:23
|
||||
*/
|
||||
public function searchRecordIdAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') {
|
||||
if (is_array($value)) {
|
||||
if ($value) $query->whereIn('record_id', $value);
|
||||
} else {
|
||||
if ($value) $query->where('record_id', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
92
app/model/other/queue/Queue.php
Normal file
92
app/model/other/queue/Queue.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\model\other\queue;
|
||||
|
||||
use crmeb\traits\ModelTrait;
|
||||
use crmeb\basic\BaseModel;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* 队列model
|
||||
* Class Queue
|
||||
* @package app\model\other\queue
|
||||
*/
|
||||
class Queue extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
const EXPIRE = 0;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'queue_list';
|
||||
|
||||
/**
|
||||
* 缓存KEY搜索器
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchExecuteKeyAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) $query->where('execute_key', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 队列类型搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTypeAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
if (is_array($value)) {
|
||||
if ($value) $query->whereIn('type', $value);
|
||||
} else {
|
||||
if ($value) $query->where('type', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 队列主键搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchIdAttr($query, $value)
|
||||
{
|
||||
if ($value) $query->where('id', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 队列状态搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
if (is_array($value)) {
|
||||
$query->whereIn('status', $value);
|
||||
} else {
|
||||
$query->where('status', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
89
app/model/other/queue/QueueAuxiliary.php
Normal file
89
app/model/other/queue/QueueAuxiliary.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\other\queue;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 队列辅助表
|
||||
* Class QueueAuxiliary
|
||||
* @package app\model\other\queue
|
||||
*/
|
||||
class QueueAuxiliary extends BaseModel
|
||||
{
|
||||
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 表明
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'queue_auxiliary';
|
||||
|
||||
protected $insert = ['add_time'];
|
||||
|
||||
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)
|
||||
{
|
||||
if ($value) {
|
||||
if (is_array($value)) {
|
||||
$query->whereIn('status', $value);
|
||||
} else {
|
||||
$query->where('status', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型关联id搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchRelationIdAttr($query, $value)
|
||||
{
|
||||
$query->where('relation_id', $value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user