chore: 添加静态资源文件和版本配置文件
添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材 添加系统版本配置文件(.version)和常量定义文件(.constant) 更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件 添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
37
app/dao/work/WorkChannelCodeDao.php
Normal file
37
app/dao/work/WorkChannelCodeDao.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkChannelCode;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 企业微信渠道码
|
||||
* Class WorkChannelCodeDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkChannelCodeDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkChannelCode::class;
|
||||
}
|
||||
|
||||
}
|
||||
32
app/dao/work/WorkChannelCycleDao.php
Normal file
32
app/dao/work/WorkChannelCycleDao.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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkChannelCycle;
|
||||
|
||||
/**
|
||||
* Class WorkChannelCycleDao
|
||||
* @package app\dao\wechat\work
|
||||
*/
|
||||
class WorkChannelCycleDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkChannelCycle::class;
|
||||
}
|
||||
}
|
||||
32
app/dao/work/WorkChannelLimitDao.php
Normal file
32
app/dao/work/WorkChannelLimitDao.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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkChannelLimit;
|
||||
|
||||
/**
|
||||
* Class WorkChannelLimitDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkChannelLimitDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkChannelLimit::class;
|
||||
}
|
||||
}
|
||||
109
app/dao/work/WorkClientDao.php
Normal file
109
app/dao/work/WorkClientDao.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkClient;
|
||||
use crmeb\basic\BaseAuth;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
use think\db\exception\DbException;
|
||||
|
||||
/**
|
||||
* 企业微信客户
|
||||
* Class WorkClientDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkClientDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkClient::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @param bool $authWhere
|
||||
* @return BaseModel
|
||||
*/
|
||||
public function searchWhere(array $where, bool $authWhere = true)
|
||||
{
|
||||
[$with, $whereKey] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
|
||||
$whereData = [];
|
||||
foreach ($whereKey as $key) {
|
||||
if (isset($where[$key])) {
|
||||
$whereData[$key] = $where[$key];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getModel()->withSearch($with, $where)->when(!empty($where['label']) || !empty($where['notLabel']), function ($query) use ($where) {
|
||||
$query->whereIn('id', function ($query) use ($where) {
|
||||
$query->name('work_client_follow')->whereIn('id', function ($query) use ($where) {
|
||||
$query->name('work_client_follow_tags')->when(!empty($where['label']), function ($query) use ($where) {
|
||||
$query->whereIn('tag_id', $where['label']);
|
||||
})->when(!empty($where['notLabel']), function ($query) use ($where) {
|
||||
$query->whereNotIn('tag_id', $where['notLabel']);
|
||||
})->field('follow_id');
|
||||
})->field('client_id');
|
||||
});
|
||||
})->when(!empty($where['userid']), function ($query) use ($where) {
|
||||
$query->whereIn('id', function ($query) use ($where) {
|
||||
$query->name('work_client_follow')->when(!empty($where['state']), function ($query) use ($where) {
|
||||
$query->where('state', '<>', '');
|
||||
})->whereIn('userid', $where['userid'])->field('client_id');
|
||||
});
|
||||
})->when(isset($where['name']) && '' !== $where['name'], function ($query) use ($where) {
|
||||
$query->whereLike('name', '%' . $where['name'] . '%');
|
||||
})->when(!empty($where['corp_id']), function ($query) use ($where) {
|
||||
$query->where('corp_id', $where['corp_id']);
|
||||
})->when(!empty($where['gender']), function ($query) use ($where) {
|
||||
$query->where('gender', $where['gender']);
|
||||
})->when(!empty($where['state']) && empty($where['userid']), function ($query) use ($where) {
|
||||
$query->whereIn('id', function ($query) use ($where) {
|
||||
$query->name('work_client_follow')->where('state', '<>', '')->field('client_id');
|
||||
});
|
||||
})->when(!empty($where['status']), function ($query) use ($where) {
|
||||
$query->whereIn('id', function ($query) use ($where) {
|
||||
$query->name('work_client_follow')->where('is_del_user', $where['status'])->field('client_id');
|
||||
});
|
||||
})->when(!empty($where['notUserid']), function ($query) use ($where) {
|
||||
$query->whereNotIn('external_userid', $where['notUserid']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @return int
|
||||
* @throws DbException
|
||||
*/
|
||||
public function getClientCount(array $where)
|
||||
{
|
||||
return $this->searchWhere($where)->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户userid
|
||||
* @param array $where
|
||||
* @return array
|
||||
*/
|
||||
public function getClientUserIds(array $where)
|
||||
{
|
||||
return $this->searchWhere($where)->column('external_userid');
|
||||
}
|
||||
}
|
||||
80
app/dao/work/WorkClientFollowDao.php
Normal file
80
app/dao/work/WorkClientFollowDao.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkClientFollow;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 企业微信客户跟踪
|
||||
* Class WorkClientFollowDao
|
||||
* @package app\dao\wechat\work
|
||||
*/
|
||||
class WorkClientFollowDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkClientFollow::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @param array $where
|
||||
* @param bool $authWhere
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function searchWhere(array $where, bool $authWhere = true)
|
||||
{
|
||||
return $this->search($where)->when(!empty($where['user_name']), function ($query) use ($where) {
|
||||
$query->whereIn('client_id', function ($query) use ($where) {
|
||||
$query->name('work_client')->where('name', 'LIKE', '%' . $where['user_name'] . '%')->field(['id']);
|
||||
});
|
||||
})->when(!empty($where['state']), function ($query) use ($where) {
|
||||
$query->where('state', $where['state']);
|
||||
})->when(!empty($where['userid']), function ($query) use ($where) {
|
||||
if (is_array($where['userid'])) {
|
||||
$query->whereIn('userid', $where['userid']);
|
||||
} else {
|
||||
$query->where('userid', $where['userid']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据员工userid获取今日添加客户总数
|
||||
* @param array $userId
|
||||
* @param int $codeId
|
||||
* @return mixed
|
||||
*/
|
||||
public function userIdByCilentCount(array $userId, int $codeId)
|
||||
{
|
||||
return $this->getModel()->whereIn('userid', $userId)->group('userid')->field(['userid', 'count(*) as sum'])->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取二维码添加客户数量
|
||||
* @param array $channeId
|
||||
* @return mixed
|
||||
*/
|
||||
public function channelIdByCilentCount(array $channeId)
|
||||
{
|
||||
return $this->getModel()->whereDay('create_time')->whereIn('state', $channeId)->group('state')->field(['state', 'count(*) as sum'])->select()->toArray();
|
||||
}
|
||||
}
|
||||
34
app/dao/work/WorkClientFollowTagsDao.php
Normal file
34
app/dao/work/WorkClientFollowTagsDao.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkClientFollowTags;
|
||||
|
||||
/**
|
||||
* 企业微信客户跟踪标签
|
||||
* Class WorkClientFollowTagsDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkClientFollowTagsDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkClientFollowTags::class;
|
||||
}
|
||||
|
||||
}
|
||||
36
app/dao/work/WorkDepartmentDao.php
Normal file
36
app/dao/work/WorkDepartmentDao.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkDepartment;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 企业微信部门
|
||||
* Class WorkDepartmentDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkDepartmentDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkDepartment::class;
|
||||
}
|
||||
}
|
||||
36
app/dao/work/WorkGroupChatAuthDao.php
Normal file
36
app/dao/work/WorkGroupChatAuthDao.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupChatAuth;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 企业微信自动拉群
|
||||
* Class WorkGroupChatAuthDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupChatAuthDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupChatAuth::class;
|
||||
}
|
||||
}
|
||||
61
app/dao/work/WorkGroupChatDao.php
Normal file
61
app/dao/work/WorkGroupChatDao.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupChat;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 企业微信群
|
||||
* Class WorkGroupChatDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupChatDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupChat::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function groupChat(array $where)
|
||||
{
|
||||
return $this->getModel()->when(!empty($where['chat_id']), function ($query) use ($where) {
|
||||
$query->whereIn('owner', function ($query) use ($where) {
|
||||
$query->name('work_group_msg_task')->when(!empty($where['status']), function ($query) use ($where) {
|
||||
$query->where('status', $where['status']);
|
||||
})->whereIn('chat_id', $where['chat_id'])->field('userid');
|
||||
});
|
||||
})->when(!empty($where['owner']), function ($query) use ($where) {
|
||||
$query->whereIn('owner', $where['owner']);
|
||||
})->when(!empty($where['name']), function ($query) use ($where) {
|
||||
$query->whereLike('name', '%' . $where['name'] . '%');
|
||||
})->when(!empty($where['chat_id']), function ($query) use ($where) {
|
||||
if (is_array($where['chat_id'])) {
|
||||
$query->whereIn('chat_id', $where['chat_id']);
|
||||
} else {
|
||||
$query->where('chat_id', $where['chat_id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
141
app/dao/work/WorkGroupChatMemberDao.php
Normal file
141
app/dao/work/WorkGroupChatMemberDao.php
Normal file
@@ -0,0 +1,141 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupChatMember;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 企业微信群成员
|
||||
* Class WorkGroupChatMemberDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupChatMemberDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupChatMember::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今日新增成员数
|
||||
* @param int $groupId
|
||||
* @return int
|
||||
*/
|
||||
public function getToDaySum(int $groupId)
|
||||
{
|
||||
return $this->getModel()->where('status', 1)->where('group_id', $groupId)->whereDay('join_time')->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今日退群成员数
|
||||
* @param int $groupId
|
||||
* @return int
|
||||
*/
|
||||
public function getToDayReturn(int $groupId)
|
||||
{
|
||||
return $this->getModel()->where('status', 0)->where('group_id', $groupId)->whereDay('join_time')->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人数统计
|
||||
* @param int $groupId
|
||||
* @param string $fromUnixtime
|
||||
* @param array $field
|
||||
* @param int $status
|
||||
* @param string $time
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return mixed
|
||||
*/
|
||||
public function getChatMemberStatistics(int $groupId, string $fromUnixtime = 'create_time', array $field = [], int $status = 1, string $time = '', int $page = 0, int $limit = 0)
|
||||
{
|
||||
$date = '%Y-%m-%d';
|
||||
switch ($time) {
|
||||
case 'today':
|
||||
case 'yesterday':
|
||||
$date = '%Y-%m-%d %H';
|
||||
break;
|
||||
case 'week':
|
||||
case 'last week':
|
||||
case 'last month':
|
||||
case 'month':
|
||||
$date = '%Y-%m-%d';
|
||||
break;
|
||||
case 'year':
|
||||
case 'last year':
|
||||
$date = '%Y-%m';
|
||||
break;
|
||||
}
|
||||
return $this->search(['time' => $time, 'timeKey' => $fromUnixtime])
|
||||
->where('group_id', $groupId)
|
||||
->where('status', $status)
|
||||
->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})
|
||||
->field(array_merge($field, ['from_unixtime(' . $fromUnixtime . ',"' . $date . '") as time']))
|
||||
->group('time')
|
||||
->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人数统计条数
|
||||
* @param int $groupId
|
||||
* @param int $status
|
||||
* @param string $time
|
||||
* @return mixed
|
||||
*/
|
||||
public function getChatMemberStatisticsCount(int $groupId, int $status = 1, string $time = '')
|
||||
{
|
||||
$date = '%Y-%m-%d';
|
||||
switch ($time) {
|
||||
case 'today':
|
||||
case 'yesterday':
|
||||
$date = '%Y-%m-%d %H';
|
||||
break;
|
||||
case 'week':
|
||||
case 'last week':
|
||||
case 'last month':
|
||||
case 'month':
|
||||
$date = '%Y-%m-%d';
|
||||
break;
|
||||
case 'year':
|
||||
case 'last year':
|
||||
$date = '%Y-%m';
|
||||
break;
|
||||
}
|
||||
return $this->search(['time' => $time, 'timeKey' => 'update_time'])
|
||||
->where('group_id', $groupId)
|
||||
->where('status', $status)
|
||||
->field(['from_unixtime(update_time,"' . $date . '") as time'])
|
||||
->group('time')
|
||||
->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前用户所在群个数
|
||||
* @param string $userid
|
||||
* @return int
|
||||
*/
|
||||
public function getChatSum(string $userid)
|
||||
{
|
||||
return $this->getModel()->where('userid', $userid)->group('group_id')->count();
|
||||
}
|
||||
}
|
||||
48
app/dao/work/WorkGroupChatStatisticDao.php
Normal file
48
app/dao/work/WorkGroupChatStatisticDao.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupChatStatistic;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* Class WorkGroupChatStatisticDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupChatStatisticDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupChatStatistic::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前统计详情
|
||||
* @param int $chatId
|
||||
* @return array|\think\Model|null
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getToDayInfo(int $chatId)
|
||||
{
|
||||
return $this->getModel()->whereDay('create_time')->where('group_id', $chatId)->find();
|
||||
}
|
||||
}
|
||||
32
app/dao/work/WorkGroupMsgRelationDao.php
Normal file
32
app/dao/work/WorkGroupMsgRelationDao.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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupMsgRelation;
|
||||
|
||||
/**
|
||||
* Class WorkGroupMsgRelationDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupMsgRelationDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupMsgRelation::class;
|
||||
}
|
||||
}
|
||||
77
app/dao/work/WorkGroupMsgSendResultDao.php
Normal file
77
app/dao/work/WorkGroupMsgSendResultDao.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupMsgSendResult;
|
||||
use crmeb\basic\BaseAuth;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* Class WorkGroupMsgSendResultDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupMsgSendResultDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupMsgSendResult::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @param bool $authWhere
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function searchWhere(array $where, bool $authWhere = true)
|
||||
{
|
||||
[$with, $whereKey] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
|
||||
$whereData = [];
|
||||
foreach ($whereKey as $key) {
|
||||
if (isset($where[$key]) && 'timeKey' !== $key) {
|
||||
$whereData[$key] = $where[$key];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getModel()->withSearch($with, $where)->when(!empty($where['client_name']), function ($query) use ($where) {
|
||||
$query->whereIn('external_userid', function ($query) use ($where) {
|
||||
$query->name('work_client')->where('name', 'like', '%' . $where['client_name'] . '%')->field(['external_userid']);
|
||||
});
|
||||
})->when(!empty($where['notChatId']), function ($query) {
|
||||
$query->whereNotNull('chat_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function getGroupChatMsg(array $where)
|
||||
{
|
||||
return $this->getModel()->when(!empty($where['msg_id']), function ($query) use ($where) {
|
||||
$query->whereIn('msg_id', $where['msg_id']);
|
||||
})->when(!empty($where['status']), function ($query) use ($where) {
|
||||
$query->where('status', $where['status']);
|
||||
})->when(!empty($where['owner']), function ($query) use ($where) {
|
||||
$query->whereIn('userid', $where['owner']);
|
||||
})->group('userid')->field([
|
||||
"GROUP_CONCAT(chat_id) as chat_ids",
|
||||
"GROUP_CONCAT(status) as status_all", 'userid', 'status']);
|
||||
}
|
||||
}
|
||||
60
app/dao/work/WorkGroupMsgSendResultGroupChatDao.php
Normal file
60
app/dao/work/WorkGroupMsgSendResultGroupChatDao.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\wechat\WechatUser;
|
||||
use app\model\work\WorkGroupChat;
|
||||
use app\model\work\WorkGroupMsgSendResult;
|
||||
|
||||
class WorkGroupMsgSendResultGroupChatDao extends BaseDao
|
||||
{
|
||||
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupMsgSendResult::class;
|
||||
}
|
||||
|
||||
protected function setJoinModel(): string
|
||||
{
|
||||
return WorkGroupChat::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $alias
|
||||
* @param string $joinAlias
|
||||
* @param string $join
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
protected function getModel(string $alias = 'm', string $joinAlias = 'g', string $join = 'left')
|
||||
{
|
||||
/** @var WechatUser $wechcatUser */
|
||||
$wechcatUser = app()->make($this->setJoinModel());
|
||||
$table = $wechcatUser->getName();
|
||||
return parent::getModel()->alias($alias)->join($table . ' ' . $joinAlias, $alias . '.chat_id = ' . $joinAlias . '.chat_id', $join);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function groupChat(array $where)
|
||||
{
|
||||
return $this->getModel()->when(!empty($where['chat_id']), function ($query) use ($where) {
|
||||
$query->whereIn('m.chat_id', $where['chat_id']);
|
||||
})->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) {
|
||||
$query->where('m.status', $where['status']);
|
||||
})->field(['m.*', 'g.name', 'g.member_num']);
|
||||
}
|
||||
|
||||
}
|
||||
50
app/dao/work/WorkGroupMsgTaskDao.php
Normal file
50
app/dao/work/WorkGroupMsgTaskDao.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupMsgTask;
|
||||
use crmeb\basic\BaseAuth;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* Class WorkGroupMsgTaskDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupMsgTaskDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupMsgTask::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @param bool $authWhere
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function searchWhere(array $where, bool $authWhere = true)
|
||||
{
|
||||
[$with, $whereKey] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
|
||||
$whereData = [];
|
||||
foreach ($whereKey as $key) {
|
||||
if (isset($where[$key]) && 'timeKey' !== $key) {
|
||||
$whereData[$key] = $where[$key];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getModel()->withSearch($with, $where)->when(!empty($where['user_name']), function ($query) use ($where) {
|
||||
$query->whereIn('userid', function ($query) use ($where) {
|
||||
$query->name('work_member')->where('name', 'like', '%' . $where['user_name'] . '%')->field(['userid']);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
36
app/dao/work/WorkGroupTemplateDao.php
Normal file
36
app/dao/work/WorkGroupTemplateDao.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkGroupTemplate;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* Class WorkGroupTemplateDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkGroupTemplateDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkGroupTemplate::class;
|
||||
}
|
||||
|
||||
}
|
||||
33
app/dao/work/WorkLabelDao.php
Normal file
33
app/dao/work/WorkLabelDao.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkLabel;
|
||||
|
||||
/**
|
||||
* 企业微信内部标签
|
||||
* Class WorkLabelDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkLabelDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkLabel::class;
|
||||
}
|
||||
}
|
||||
46
app/dao/work/WorkMediaDao.php
Normal file
46
app/dao/work/WorkMediaDao.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkMedia;
|
||||
use crmeb\basic\BaseModel;
|
||||
|
||||
/**
|
||||
* Class WorkMediaDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkMediaDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkMedia::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除时效的media_id
|
||||
* @return BaseModel
|
||||
*/
|
||||
public function deleteValidFile()
|
||||
{
|
||||
return $this->getModel()
|
||||
->where('temporary', 1)
|
||||
->where('valid_time', '<>', 0)
|
||||
->where('valid_time', '<', time())
|
||||
->update(['media_id' => '', 'valid_time' => 0]);
|
||||
}
|
||||
}
|
||||
56
app/dao/work/WorkMemberDao.php
Normal file
56
app/dao/work/WorkMemberDao.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkMember;
|
||||
use crmeb\basic\BaseAuth;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 企业微信成员
|
||||
* Class WorkMemberDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkMemberDao extends BaseDao
|
||||
{
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkMember::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @param array $where
|
||||
* @param bool $authWhere
|
||||
* @return BaseModel
|
||||
*/
|
||||
public function searchWhere(array $where, bool $authWhere = true)
|
||||
{
|
||||
[$with] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
|
||||
return $this->getModel()->withSearch($with, $where)
|
||||
->when(!empty($where['name']), function ($query) use ($where) {
|
||||
$query->where('id|name|mobile', 'like', '%' . $where['name'] . '%');
|
||||
})->when(!empty($where['department']), function ($query) use ($where) {
|
||||
$query->whereIn('id', function ($query) use ($where) {
|
||||
$query->name('work_member_relation')->where('department', $where['department'])->field(['member_id']);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
33
app/dao/work/WorkMemberOtherDao.php
Normal file
33
app/dao/work/WorkMemberOtherDao.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkMemberOther;
|
||||
|
||||
/**
|
||||
* 企业微信成员其他详细属性
|
||||
* Class WorkMemberOtherDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkMemberOtherDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkMemberOther::class;
|
||||
}
|
||||
}
|
||||
49
app/dao/work/WorkMemberRelationDao.php
Normal file
49
app/dao/work/WorkMemberRelationDao.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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkMemberRelation;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
|
||||
/**
|
||||
* 企业微信成员关联表
|
||||
* Class WorkMemberRelationDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkMemberRelationDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkMemberRelation::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @param array|string[] $field
|
||||
* @return array
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function getMemberRelationList(array $where, array $field = ['*'])
|
||||
{
|
||||
return $this->getModel()->where($where)->field($field)->select()->toArray();
|
||||
}
|
||||
}
|
||||
27
app/dao/work/WorkMomentDao.php
Normal file
27
app/dao/work/WorkMomentDao.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkMoment;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* 朋友圈
|
||||
* Class WorkMoment
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkMomentDao extends BaseDao
|
||||
{
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkMoment::class;
|
||||
}
|
||||
}
|
||||
43
app/dao/work/WorkMomentSendResultDao.php
Normal file
43
app/dao/work/WorkMomentSendResultDao.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkMomentSendResult;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
|
||||
/**
|
||||
* Class WorkMomentSendResultDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkMomentSendResultDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkMomentSendResult::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @param array|string[] $field
|
||||
* @return array
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function getMomentList(array $where, array $field = ['*'])
|
||||
{
|
||||
return $this->search($where)->field($field)->select()->toArray();
|
||||
}
|
||||
}
|
||||
60
app/dao/work/WorkWelcomeDao.php
Normal file
60
app/dao/work/WorkWelcomeDao.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkWelcome;
|
||||
use crmeb\basic\BaseAuth;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\traits\SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* Class WorkWelcomeDao
|
||||
* @package app\dao\wechat\work
|
||||
*/
|
||||
class WorkWelcomeDao extends BaseDao
|
||||
{
|
||||
|
||||
use SearchDaoTrait;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkWelcome::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @param array $where
|
||||
* @param bool $authWhere
|
||||
* @return BaseModel
|
||||
*/
|
||||
public function searchWhere(array $where, bool $authWhere = true)
|
||||
{
|
||||
[$with] = app()->make(BaseAuth::class)->________(array_keys($where), $this->setModel());
|
||||
|
||||
return $this->getModel()->withSearch($with, $where)->when(!empty($where['userids']), function ($query) use ($where) {
|
||||
$query->whereIn('id', function ($query) use ($where) {
|
||||
$query->name('wechat_work_welcome_relation')->whereIn('userid', $where['userids'])->field(['welcome_id']);
|
||||
});
|
||||
})->when(!empty($where['id']), function ($query) use ($where) {
|
||||
if (is_array($where['id'])) {
|
||||
$query->whereIn('id', $where['id']);
|
||||
} else {
|
||||
$query->where('id', $where['id']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
33
app/dao/work/WorkWelcomeRelationDao.php
Normal file
33
app/dao/work/WorkWelcomeRelationDao.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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\dao\work;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\work\WorkWelcomeRelation;
|
||||
|
||||
/**
|
||||
* 企业微信欢迎语辅助
|
||||
* Class WorkWelcomeRelationDao
|
||||
* @package app\dao\work
|
||||
*/
|
||||
class WorkWelcomeRelationDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return WorkWelcomeRelation::class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user