Initial commit: queue workspace
Made-with: Cursor
This commit is contained in:
62
pro_v3.5.1/app/model/wechat/WechatCard.php
Normal file
62
pro_v3.5.1/app/model/wechat/WechatCard.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?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\wechat;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 关键词model
|
||||
* Class WechatKey
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatCard extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_card';
|
||||
|
||||
/**
|
||||
* 特别信息修改器
|
||||
* @param $value
|
||||
* @return false|string
|
||||
*/
|
||||
protected function setEspecialAttr($value)
|
||||
{
|
||||
if ($value) {
|
||||
return is_array($value) ? json_encode($value) : $value;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 特别信息获取器
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getEspecialAttr($value)
|
||||
{
|
||||
return $value ? json_decode($value, true) : [];
|
||||
}
|
||||
}
|
||||
38
pro_v3.5.1/app/model/wechat/WechatKey.php
Normal file
38
pro_v3.5.1/app/model/wechat/WechatKey.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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\wechat;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 关键词model
|
||||
* Class WechatKey
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatKey extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_key';
|
||||
}
|
||||
38
pro_v3.5.1/app/model/wechat/WechatMedia.php
Normal file
38
pro_v3.5.1/app/model/wechat/WechatMedia.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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\wechat;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* Class WechatMedia
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatMedia extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 表名
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_media';
|
||||
|
||||
}
|
||||
45
pro_v3.5.1/app/model/wechat/WechatMessage.php
Normal file
45
pro_v3.5.1/app/model/wechat/WechatMessage.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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\wechat;
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 微信用户行为记录 model
|
||||
* Class WechatMessage
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatMessage extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_message';
|
||||
|
||||
protected $insert = ['add_time'];
|
||||
|
||||
public static function setAddTimeAttr($value)
|
||||
{
|
||||
return time();
|
||||
}
|
||||
|
||||
}
|
||||
38
pro_v3.5.1/app/model/wechat/WechatNewsCategory.php
Normal file
38
pro_v3.5.1/app/model/wechat/WechatNewsCategory.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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\wechat;
|
||||
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* Class WechatNewsCategory
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatNewsCategory extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_news_category';
|
||||
|
||||
}
|
||||
79
pro_v3.5.1/app/model/wechat/WechatQrcode.php
Normal file
79
pro_v3.5.1/app/model/wechat/WechatQrcode.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\wechat;
|
||||
|
||||
use app\model\user\User;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 关键词
|
||||
* Class WechatReply
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatQrcode extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_qrcode';
|
||||
|
||||
/**
|
||||
* 添加时间获取器
|
||||
* @param $value
|
||||
* @return false|string
|
||||
*/
|
||||
protected function getAddTimeAttr($value)
|
||||
{
|
||||
if ($value) return date('Y-m-d H:i:s', (int)$value);
|
||||
return '';
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'uid', 'uid')->bind(['nickname', 'avatar']);
|
||||
}
|
||||
|
||||
public function record()
|
||||
{
|
||||
return $this->hasOne(WechatQrcodeRecord::class, 'qid', 'id');
|
||||
}
|
||||
|
||||
public function searchUidAttr($query, $value)
|
||||
{
|
||||
if ($value != '') $query->where('uid', $value);
|
||||
}
|
||||
|
||||
public function searchCateIdAttr($query, $value)
|
||||
{
|
||||
if ($value != '') $query->where('cate_id', $value);
|
||||
}
|
||||
|
||||
public function searchNameAttr($query, $value)
|
||||
{
|
||||
if ($value != '') $query->whereLike('id|uid|name', '%' . $value . '%');
|
||||
}
|
||||
|
||||
public function searchIsDelAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') $query->where('is_del', $value);
|
||||
}
|
||||
}
|
||||
42
pro_v3.5.1/app/model/wechat/WechatQrcodeCate.php
Normal file
42
pro_v3.5.1/app/model/wechat/WechatQrcodeCate.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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\wechat;
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 关键词
|
||||
* Class WechatReply
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatQrcodeCate extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_qrcode_cate';
|
||||
|
||||
public function searchIsDelAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') $query->where('is_del', $value);
|
||||
}
|
||||
}
|
||||
57
pro_v3.5.1/app/model/wechat/WechatQrcodeRecord.php
Normal file
57
pro_v3.5.1/app/model/wechat/WechatQrcodeRecord.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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\wechat;
|
||||
|
||||
use app\model\user\User;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 关键词
|
||||
* Class WechatReply
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatQrcodeRecord extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_qrcode_record';
|
||||
|
||||
/**
|
||||
* 关联user
|
||||
* @return \think\model\relation\HasOne
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'uid', 'uid');
|
||||
}
|
||||
|
||||
public function searchQidAttr($query, $value)
|
||||
{
|
||||
if ($value) $query->where('qid', $value);
|
||||
}
|
||||
|
||||
public function searchIsFollowAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') $query->where('is_follow', $value);
|
||||
}
|
||||
}
|
||||
49
pro_v3.5.1/app/model/wechat/WechatReply.php
Normal file
49
pro_v3.5.1/app/model/wechat/WechatReply.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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\wechat;
|
||||
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* 关键词
|
||||
* Class WechatReply
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatReply extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_reply';
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
* @var string[]
|
||||
*/
|
||||
public static $replyType = ['text', 'image', 'news', 'voice'];
|
||||
|
||||
|
||||
public function wechatKeys()
|
||||
{
|
||||
return $this->hasMany(WechatKey::class, 'reply_id', 'id');
|
||||
}
|
||||
}
|
||||
140
pro_v3.5.1/app/model/wechat/WechatUser.php
Normal file
140
pro_v3.5.1/app/model/wechat/WechatUser.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?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\wechat;
|
||||
|
||||
use app\model\user\User;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\ModelTrait;
|
||||
|
||||
/**
|
||||
* Class WechatUser
|
||||
* @package app\model\wechat
|
||||
*/
|
||||
class WechatUser extends BaseModel
|
||||
{
|
||||
use ModelTrait;
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'uid';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'wechat_user';
|
||||
|
||||
protected $insert = ['add_time'];
|
||||
|
||||
public static function setAddTimeAttr()
|
||||
{
|
||||
return time();
|
||||
}
|
||||
|
||||
protected function getAddTimeAttr($value)
|
||||
{
|
||||
if ($value) return date('Y-m-d H:i', (int)$value);
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联user
|
||||
* @return \think\model\relation\HasOne
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'uid', 'uid');
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定公众号
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchUnionidAttr($query, $value)
|
||||
{
|
||||
return $query->where('unionid', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公众号唯一id
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchOpenidAttr($query, $value)
|
||||
{
|
||||
return $query->where('openid', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分组
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchGroupIdAttr($query, $value)
|
||||
{
|
||||
return $query->where('group_id', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 性别
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchSexAttr($query, $value)
|
||||
{
|
||||
return $query->where('sex', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否关注
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchSubscribeAttr($query, $value)
|
||||
{
|
||||
return $query->where('subscribe', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchTypeAttr($query, $value)
|
||||
{
|
||||
return $query->where('user_type', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户类型
|
||||
* @param Model $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchUserTypeAttr($query, $value)
|
||||
{
|
||||
return $query->where('user_type', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否注销
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function searchIsDelAttr($query, $value)
|
||||
{
|
||||
if ($value !== '') return $query->where('is_del', $value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user