chore: 添加静态资源文件和版本配置文件
添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材 添加系统版本配置文件(.version)和常量定义文件(.constant) 更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件 添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
54
app/dao/message/SystemMessageDao.php
Normal file
54
app/dao/message/SystemMessageDao.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\dao\message;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\SystemMessage;
|
||||
|
||||
/**
|
||||
* 站内信
|
||||
* Class SystemMessageDao
|
||||
* @package app\dao\message
|
||||
*/
|
||||
class SystemMessageDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return SystemMessage::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @param string $field
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getMessageList(array $where, string $field = '*', int $page = 0, int $limit = 0)
|
||||
{
|
||||
return $this->getModel()->where($where)->field($field)
|
||||
->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})->when(!$page && $limit, function ($query) use ($limit) {
|
||||
$query->limit($limit);
|
||||
})->order('add_time desc')->select()->toArray();
|
||||
}
|
||||
}
|
||||
54
app/dao/message/SystemNotificationDao.php
Normal file
54
app/dao/message/SystemNotificationDao.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
declare (strict_types=1);
|
||||
|
||||
namespace app\dao\message;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\SystemNotification;
|
||||
|
||||
/**
|
||||
* 消息设置
|
||||
* Class SystemNotificationDao
|
||||
* @package app\dao\message
|
||||
*/
|
||||
class SystemNotificationDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return SystemNotification::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
* @param array $where
|
||||
* @param string $field
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getList(array $where, string $field = '*', int $page = 0, $limit = 0)
|
||||
{
|
||||
return $this->getModel()->where($where)->field($field)->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})->order('id asc')->select()->toArray();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
73
app/dao/message/TemplateMessageDao.php
Normal file
73
app/dao/message/TemplateMessageDao.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?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\message;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\TemplateMessage;
|
||||
|
||||
/**
|
||||
* 模板消息
|
||||
* Class TemplateMessageDao
|
||||
* @package app\dao\message
|
||||
*/
|
||||
class TemplateMessageDao extends BaseDao
|
||||
{
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return TemplateMessage::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一条数据
|
||||
* @param array $where
|
||||
* @param string $filed
|
||||
* @param bool $is_search
|
||||
* @return array|\think\Model|null
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getTemplateOne(array $where, string $filed = '*', bool $is_search = true)
|
||||
{
|
||||
if ($is_search) {
|
||||
return $this->search($where)->field($filed)->find();
|
||||
} else {
|
||||
return $this->getModel()->where($where)->find();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板消息列表
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return \think\Collection
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getTemplateList(array $where, int $page, int $limit)
|
||||
{
|
||||
|
||||
return $this->getModel()->when(isset($where['name']) && $where['name'] != '', function ($query) use ($where) {
|
||||
$query->where('name', 'LIKE', "%$where[name]%");
|
||||
})->when(isset($where['status']) && $where['status'] != '', function ($query) use ($where) {
|
||||
$query->where('status', $where['status']);
|
||||
})->where('type', $where['type'])->page($page, $limit)->select()->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
39
app/dao/message/service/StoreServiceAuxiliaryDao.php
Normal file
39
app/dao/message/service/StoreServiceAuxiliaryDao.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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\message\service;
|
||||
|
||||
|
||||
use app\dao\other\queue\QueueAuxiliaryDao;
|
||||
use crmeb\basic\BaseModel;
|
||||
|
||||
/**
|
||||
* 客服辅助表
|
||||
* Class StoreServiceAuxiliaryDao
|
||||
* @package app\dao\message\service
|
||||
*/
|
||||
class StoreServiceAuxiliaryDao extends QueueAuxiliaryDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
* @param array $where
|
||||
* @param bool $search
|
||||
* @return BaseModel
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public function search(array $where = [], bool $search = true)
|
||||
{
|
||||
return parent::search($where, $search)->where('type', 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
96
app/dao/message/service/StoreServiceDao.php
Normal file
96
app/dao/message/service/StoreServiceDao.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?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\message\service;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\service\StoreService;
|
||||
|
||||
/**
|
||||
* 客服dao
|
||||
* Class StoreServiceDao
|
||||
* @package app\dao\message\service
|
||||
*/
|
||||
class StoreServiceDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* 不存在的用户直接禁止掉
|
||||
* @param array $uids
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteNonExistentService(array $uids = [])
|
||||
{
|
||||
if ($uids) {
|
||||
return $this->getModel()->whereIn('uid', $uids)->update(['status' => 0]);
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return StoreService::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客服列表
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getServiceList(array $where, int $page, int $limit)
|
||||
{
|
||||
return $this->search($where)->with('user')->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})->when(isset($where['noId']), function ($query) use ($where) {
|
||||
$query->whereNotIn('uid', $where['noId']);
|
||||
})->with(['workMember' => function ($query) {
|
||||
$query->field(['uid', 'name', 'position', 'qr_code', 'external_position']);
|
||||
}])->order('id DESC')->field('id,uid,avatar,nickname as wx_name,status,add_time,phone,account_status')->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取接受通知的客服
|
||||
* @param int $customer
|
||||
* @param string $field
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getStoreServiceOrderNotice(int $customer = 0, string $field = 'nickname,phone,uid,customer')
|
||||
{
|
||||
return $this->getModel()->where(['account_status' => 1, 'status' => 1, 'notify' => 1])->when($customer, function ($query) use ($customer) {
|
||||
$query->where('customer', $customer);
|
||||
})->field($field)->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $where
|
||||
* @param array $data
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function updateOnline(array $where, array $data)
|
||||
{
|
||||
return $this->getModel()->whereNotIn('uid', $where['notUid'])->update($data);
|
||||
}
|
||||
|
||||
}
|
||||
44
app/dao/message/service/StoreServiceFeedbackDao.php
Normal file
44
app/dao/message/service/StoreServiceFeedbackDao.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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\message\service;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\service\StoreServiceFeedback;
|
||||
|
||||
/**
|
||||
* Class StoreServiceFeedbackDao
|
||||
* @package app\dao\message\service
|
||||
*/
|
||||
class StoreServiceFeedbackDao extends BaseDao
|
||||
{
|
||||
|
||||
protected function setModel(): string
|
||||
{
|
||||
return StoreServiceFeedback::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户反馈信息列表
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getFeedback(array $where, int $page, int $limit)
|
||||
{
|
||||
return $this->search($where)->page($page, $limit)->order('id DESC')->select()->toArray();
|
||||
}
|
||||
}
|
||||
142
app/dao/message/service/StoreServiceLogDao.php
Normal file
142
app/dao/message/service/StoreServiceLogDao.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?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\message\service;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\service\StoreServiceLog;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Class StoreServiceLogDao
|
||||
* @package app\dao\service
|
||||
*/
|
||||
class StoreServiceLogDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* StoreServiceLogDao constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//清楚去年的聊天记录
|
||||
// $this->removeChat();
|
||||
$this->removeYesterDayChat();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return StoreServiceLog::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取聊天记录下的uid和to_uid
|
||||
* @param int $uid
|
||||
* @return mixed
|
||||
*/
|
||||
public function getServiceUserUids(int $uid)
|
||||
{
|
||||
return $this->search(['uid' => $uid])->group('uid,to_uid')->field(['uid', 'to_uid'])->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取聊天记录并分页
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getServiceList(array $where, int $page, int $limit, array $field = ['*'])
|
||||
{
|
||||
return $this->search($where)->with('user')->field($field)->order('add_time DESC')->page($page, $limit)->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取聊天记录上翻页
|
||||
* @param array $where
|
||||
* @param int $limit
|
||||
* @param int $upperId
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getChatList(array $where, int $limit = 20, int $upperId = 0)
|
||||
{
|
||||
return $this->search($where)->when($upperId, function ($query) use ($upperId, $limit) {
|
||||
$query->where('id', '<', $upperId)->limit($limit)->order('id DESC');
|
||||
})->when(!$upperId, function ($query) use ($limit) {
|
||||
$query->limit($limit)->order('id DESC');
|
||||
})->with(['user', 'service'])->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清楚去年的聊天记录
|
||||
* @return bool
|
||||
*/
|
||||
public function removeChat()
|
||||
{
|
||||
return $this->search(['time' => 'last year'])->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清楚上周的游客用户聊天记录
|
||||
* @return bool
|
||||
*/
|
||||
public function removeYesterDayChat()
|
||||
{
|
||||
return $this->search(['time' => 'last week', 'is_tourist' => 1])->delete();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件获取条数
|
||||
* @param array $where
|
||||
* @return int
|
||||
*/
|
||||
public function whereByCount(array $where)
|
||||
{
|
||||
return $this->search(['uid' => $where['uid']])->order('id DESC')->where('add_time', '<', time() - 300)->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未读消息条数
|
||||
* @param array $where
|
||||
* @return int
|
||||
*/
|
||||
public function getMessageNum(array $where)
|
||||
{
|
||||
return $this->getModel()->where($where)->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索聊天记录
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getMessageList(array $where)
|
||||
{
|
||||
return $this->search(['chat' => $where['chat']])->when(isset($where['add_time']) && $where['add_time'], function ($query) use ($where) {
|
||||
$query->where('add_time', '>', $where['add_time']);
|
||||
})->select()->toArray();
|
||||
}
|
||||
}
|
||||
92
app/dao/message/service/StoreServiceRecordDao.php
Normal file
92
app/dao/message/service/StoreServiceRecordDao.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\dao\message\service;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\service\StoreServiceRecord;
|
||||
|
||||
/**
|
||||
* Class StoreServiceRecordDao
|
||||
* @package app\dao\message\service
|
||||
*/
|
||||
class StoreServiceRecordDao extends BaseDao
|
||||
{
|
||||
|
||||
/**
|
||||
* StoreServiceRecordDao constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->deleteWeekRecord();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return StoreServiceRecord::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除上周游客记录
|
||||
*/
|
||||
protected function deleteWeekRecord()
|
||||
{
|
||||
$this->search(['time' => 'last week', 'timeKey' => 'update_time', 'is_tourist' => 1])->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $where
|
||||
* @param array $data
|
||||
* @return \crmeb\basic\BaseModel
|
||||
*/
|
||||
public function updateOnline(array $where, array $data)
|
||||
{
|
||||
return $this->getModel()->whereNotIn('to_uid', $where['notUid'])->update($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客服聊天用户列表
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @param array $with
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getServiceList(array $where, int $page, int $limit, array $with = [])
|
||||
{
|
||||
return $this->search($where)->page($page, $limit)->when(count($with), function ($query) use ($with) {
|
||||
$query->with($with);
|
||||
})->order('update_time desc')->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询最近和用户聊天的uid用户
|
||||
* @param array $where
|
||||
* @param string $key
|
||||
* @return array|\think\Model|null
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getLatelyMsgUid(array $where, string $key)
|
||||
{
|
||||
return $this->search($where)->order('update_time DESC')->value($key);
|
||||
}
|
||||
}
|
||||
50
app/dao/message/service/StoreServiceSpeechcraftDao.php
Normal file
50
app/dao/message/service/StoreServiceSpeechcraftDao.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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\message\service;
|
||||
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\service\StoreServiceSpeechcraft;
|
||||
|
||||
/**
|
||||
* 客服话术dao
|
||||
* Class StoreServiceSpeechcraftDao
|
||||
* @package app\dao\message\service
|
||||
*/
|
||||
class StoreServiceSpeechcraftDao extends BaseDao
|
||||
{
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return StoreServiceSpeechcraft::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取话术列表
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getSpeechcraftList(array $where, int $page, int $limit)
|
||||
{
|
||||
return $this->search($where)->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})->order('sort DESC')->select()->toArray();
|
||||
}
|
||||
}
|
||||
33
app/dao/message/sms/SmsAdminDao.php
Normal file
33
app/dao/message/sms/SmsAdminDao.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\message\sms;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\system\config\SystemConfig;
|
||||
|
||||
/**
|
||||
* 短信dao
|
||||
* Class SmsAdminDao
|
||||
* @package app\dao\message\sms
|
||||
*/
|
||||
class SmsAdminDao extends BaseDao
|
||||
{
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
protected function setModel(): string
|
||||
{
|
||||
return SystemConfig::class;
|
||||
}
|
||||
|
||||
}
|
||||
61
app/dao/message/sms/SmsRecordDao.php
Normal file
61
app/dao/message/sms/SmsRecordDao.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\message\sms;
|
||||
|
||||
use app\dao\BaseDao;
|
||||
use app\model\message\sms\SmsRecord;
|
||||
|
||||
/**
|
||||
* 短信发送记录
|
||||
* Class SmsRecordDao
|
||||
* @package app\dao\message\sms
|
||||
*/
|
||||
class SmsRecordDao extends BaseDao
|
||||
{
|
||||
/**
|
||||
* 设置模型
|
||||
* @return string
|
||||
*/
|
||||
public function setModel(): string
|
||||
{
|
||||
return SmsRecord::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信发送记录
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getRecordList(array $where, int $page, int $limit)
|
||||
{
|
||||
return $this->search($where)->page($page, $limit)->order('add_time DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取10分钟前20条无状态的短信记录
|
||||
* @return array
|
||||
*/
|
||||
public function getCodeNull()
|
||||
{
|
||||
return $this->getModel()->where([
|
||||
['resultcode', '=', null],
|
||||
['add_time', '<=', time() - 600],
|
||||
['record_id', '>', 0]
|
||||
])->limit(20)->column('record_id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user