mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-26 12:23:06 +08:00
Merge branch 'koogua/v1.5.9' into demo
This commit is contained in:
commit
2f24fa2246
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,7 +5,6 @@
|
||||
/config/xs.course.ini
|
||||
/config/xs.article.ini
|
||||
/config/xs.question.ini
|
||||
/config/xs.user.ini
|
||||
/config/alipay/*.crt
|
||||
/config/wxpay/*.pem
|
||||
/db/migrations/schema.php
|
||||
|
16
README.md
16
README.md
@ -6,10 +6,10 @@
|
||||
|
||||
酷瓜云课堂,依托腾讯云基础服务架构,采用C扩展框架Phalcon开发,GPL-2.0开源协议,致力开源网课系统,开源网校系统,开源知识付费系统,开源在线教育系统。
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
### 系统功能
|
||||
|
||||
@ -69,12 +69,12 @@ Tips: 请用手机注册一个新账号,用户中心 -> 关注订阅,扫码
|
||||
|
||||
### 项目文档
|
||||
|
||||
- [运行环境搭建](https://koogua.com/page/wiki)
|
||||
- [系统服务配置](https://koogua.com/page/wiki)
|
||||
- [客户终端配置](https://koogua.com/page/wiki)
|
||||
- [运行环境搭建](https://www.koogua.com/page/wiki)
|
||||
- [系统服务配置](https://www.koogua.com/page/wiki)
|
||||
- [客户终端配置](https://www.koogua.com/page/wiki)
|
||||
|
||||
### 意见反馈
|
||||
|
||||
- [码云平台](https://gitee.com/koogua/course-tencent-cloud/issues)
|
||||
- [官方社区](https://koogua.com/community)
|
||||
- [官方社区](https://www.koogua.com/community)
|
||||
- QQ交流群: 787363898
|
||||
|
@ -104,14 +104,8 @@ class CleanDemoDataTask extends Task
|
||||
$courseIndexTask = new CourseIndexTask();
|
||||
$courseIndexTask->cleanAction();
|
||||
|
||||
$groupIndexTask = new GroupIndexTask();
|
||||
$groupIndexTask->cleanAction();
|
||||
|
||||
$questionIndexTask = new QuestionIndexTask();
|
||||
$questionIndexTask->cleanAction();
|
||||
|
||||
$userIndexTask = new UserIndexTask();
|
||||
$userIndexTask->cleanAction();
|
||||
}
|
||||
|
||||
protected function isDemoEnv()
|
||||
|
@ -19,7 +19,7 @@ use App\Repos\Vip as VipRepo;
|
||||
use App\Services\Logic\Deliver\CourseDeliver as CourseDeliverService;
|
||||
use App\Services\Logic\Deliver\PackageDeliver as PackageDeliverService;
|
||||
use App\Services\Logic\Deliver\VipDeliver as VipDeliverService;
|
||||
use App\Services\Logic\Notice\OrderFinish as OrderFinishNotice;
|
||||
use App\Services\Logic\Notice\External\OrderFinish as OrderFinishNotice;
|
||||
use App\Services\Logic\Point\History\OrderConsume as OrderConsumePointHistory;
|
||||
use Phalcon\Mvc\Model;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
|
@ -8,16 +8,15 @@
|
||||
namespace App\Console\Tasks;
|
||||
|
||||
use App\Models\Task as TaskModel;
|
||||
use App\Services\Logic\Notice\AccountLogin as AccountLoginNotice;
|
||||
use App\Services\Logic\Notice\ConsultReply as ConsultReplyNotice;
|
||||
use App\Services\Logic\Notice\DingTalk\ConsultCreate as ConsultCreateNotice;
|
||||
use App\Services\Logic\Notice\DingTalk\CustomService as CustomServiceNotice;
|
||||
use App\Services\Logic\Notice\DingTalk\ServerMonitor as ServerMonitorNotice;
|
||||
use App\Services\Logic\Notice\DingTalk\TeacherLive as TeacherLiveNotice;
|
||||
use App\Services\Logic\Notice\LiveBegin as LiveBeginNotice;
|
||||
use App\Services\Logic\Notice\OrderFinish as OrderFinishNotice;
|
||||
use App\Services\Logic\Notice\PointGoodsDeliver as PointGoodsDeliverNotice;
|
||||
use App\Services\Logic\Notice\RefundFinish as RefundFinishNotice;
|
||||
use App\Services\Logic\Notice\External\AccountLogin as AccountLoginNotice;
|
||||
use App\Services\Logic\Notice\External\ConsultReply as ConsultReplyNotice;
|
||||
use App\Services\Logic\Notice\External\DingTalk\ConsultCreate as ConsultCreateNotice;
|
||||
use App\Services\Logic\Notice\External\DingTalk\ServerMonitor as ServerMonitorNotice;
|
||||
use App\Services\Logic\Notice\External\DingTalk\TeacherLive as TeacherLiveNotice;
|
||||
use App\Services\Logic\Notice\External\LiveBegin as LiveBeginNotice;
|
||||
use App\Services\Logic\Notice\External\OrderFinish as OrderFinishNotice;
|
||||
use App\Services\Logic\Notice\External\PointGoodsDeliver as PointGoodsDeliverNotice;
|
||||
use App\Services\Logic\Notice\External\RefundFinish as RefundFinishNotice;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
|
||||
@ -62,9 +61,6 @@ class NoticeTask extends Task
|
||||
case TaskModel::TYPE_STAFF_NOTICE_SERVER_MONITOR:
|
||||
$this->handleServerMonitorNotice($task);
|
||||
break;
|
||||
case TaskModel::TYPE_STAFF_NOTICE_CUSTOM_SERVICE:
|
||||
$this->handleCustomServiceNotice($task);
|
||||
break;
|
||||
}
|
||||
|
||||
$task->status = TaskModel::STATUS_FINISHED;
|
||||
@ -157,13 +153,6 @@ class NoticeTask extends Task
|
||||
$notice->handleTask($task);
|
||||
}
|
||||
|
||||
protected function handleCustomServiceNotice(TaskModel $task)
|
||||
{
|
||||
$notice = new CustomServiceNotice();
|
||||
|
||||
$notice->handleTask($task);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
* @return ResultsetInterface|Resultset|TaskModel[]
|
||||
@ -181,7 +170,6 @@ class NoticeTask extends Task
|
||||
TaskModel::TYPE_STAFF_NOTICE_CONSULT_CREATE,
|
||||
TaskModel::TYPE_STAFF_NOTICE_TEACHER_LIVE,
|
||||
TaskModel::TYPE_STAFF_NOTICE_SERVER_MONITOR,
|
||||
TaskModel::TYPE_STAFF_NOTICE_CUSTOM_SERVICE,
|
||||
];
|
||||
|
||||
$status = TaskModel::STATUS_PENDING;
|
||||
|
@ -17,7 +17,7 @@ use App\Repos\User as UserRepo;
|
||||
use App\Repos\Vip as VipRepo;
|
||||
use App\Services\Logic\Deliver\CourseDeliver as CourseDeliverService;
|
||||
use App\Services\Logic\Deliver\VipDeliver as VipDeliverService;
|
||||
use App\Services\Logic\Notice\DingTalk\PointGiftRedeem as PointGiftRedeemNotice;
|
||||
use App\Services\Logic\Notice\External\DingTalk\PointGiftRedeem as PointGiftRedeemNotice;
|
||||
use App\Services\Logic\Point\History\PointGiftRefund as PointGiftRefundPointHistory;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
|
@ -16,7 +16,7 @@ use App\Repos\Order as OrderRepo;
|
||||
use App\Repos\Refund as RefundRepo;
|
||||
use App\Repos\Trade as TradeRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\Logic\Notice\RefundFinish as RefundFinishNotice;
|
||||
use App\Services\Logic\Notice\External\RefundFinish as RefundFinishNotice;
|
||||
use App\Services\Pay\Alipay as AlipayService;
|
||||
use App\Services\Pay\Wxpay as WxpayService;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
|
@ -9,7 +9,7 @@ namespace App\Console\Tasks;
|
||||
|
||||
use App\Library\Benchmark;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Services\Logic\Notice\DingTalk\ServerMonitor as ServerMonitorNotice;
|
||||
use App\Services\Logic\Notice\External\DingTalk\ServerMonitor as ServerMonitorNotice;
|
||||
use App\Services\Search\UserSearcher;
|
||||
use GatewayClient\Gateway;
|
||||
|
||||
|
@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Console\Tasks;
|
||||
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\Search\UserDocument;
|
||||
use App\Services\Search\UserSearcher;
|
||||
use App\Services\Sync\UserIndex as UserIndexSync;
|
||||
|
||||
class SyncUserIndexTask extends Task
|
||||
{
|
||||
|
||||
public function mainAction()
|
||||
{
|
||||
$redis = $this->getRedis();
|
||||
|
||||
$key = $this->getSyncKey();
|
||||
|
||||
$userIds = $redis->sRandMember($key, 1000);
|
||||
|
||||
if (!$userIds) return;
|
||||
|
||||
$userRepo = new UserRepo();
|
||||
|
||||
$users = $userRepo->findByIds($userIds);
|
||||
|
||||
if ($users->count() == 0) return;
|
||||
|
||||
$document = new UserDocument();
|
||||
|
||||
$handler = new UserSearcher();
|
||||
|
||||
$index = $handler->getXS()->getIndex();
|
||||
|
||||
$index->openBuffer();
|
||||
|
||||
foreach ($users as $user) {
|
||||
|
||||
$doc = $document->setDocument($user);
|
||||
|
||||
if ($user->deleted == 0) {
|
||||
$index->update($doc);
|
||||
} else {
|
||||
$index->del($user->id);
|
||||
}
|
||||
}
|
||||
|
||||
$index->closeBuffer();
|
||||
|
||||
$redis->sRem($key, ...$userIds);
|
||||
}
|
||||
|
||||
protected function getSyncKey()
|
||||
{
|
||||
$sync = new UserIndexSync();
|
||||
|
||||
return $sync->getSyncKey();
|
||||
}
|
||||
|
||||
}
|
@ -9,7 +9,7 @@ namespace App\Console\Tasks;
|
||||
|
||||
use App\Models\ChapterLive as ChapterLiveModel;
|
||||
use App\Repos\ChapterLive as ChapterLiveRepo;
|
||||
use App\Services\Logic\Notice\DingTalk\TeacherLive as TeacherLiveNotice;
|
||||
use App\Services\Logic\Notice\External\DingTalk\TeacherLive as TeacherLiveNotice;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
|
||||
|
@ -1,154 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Console\Tasks;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\Search\UserDocument;
|
||||
use App\Services\Search\UserSearcher;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
|
||||
class UserIndexTask extends Task
|
||||
{
|
||||
|
||||
/**
|
||||
* 搜索测试
|
||||
*
|
||||
* @command: php console.php user_index search {query}
|
||||
* @param array $params
|
||||
* @throws \XSException
|
||||
*/
|
||||
public function searchAction($params)
|
||||
{
|
||||
$query = $params[0] ?? null;
|
||||
|
||||
if (!$query) {
|
||||
exit('please special a query word' . PHP_EOL);
|
||||
}
|
||||
|
||||
$result = $this->searchUsers($query);
|
||||
|
||||
var_export($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空索引
|
||||
*
|
||||
* @command: php console.php user_index clean
|
||||
*/
|
||||
public function cleanAction()
|
||||
{
|
||||
$this->cleanUserIndex();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重建索引
|
||||
*
|
||||
* @command: php console.php user_index rebuild
|
||||
*/
|
||||
public function rebuildAction()
|
||||
{
|
||||
$this->rebuildUserIndex();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空索引
|
||||
*/
|
||||
protected function cleanUserIndex()
|
||||
{
|
||||
$handler = new UserSearcher();
|
||||
|
||||
$index = $handler->getXS()->getIndex();
|
||||
|
||||
echo '------ start clean user index ------' . PHP_EOL;
|
||||
|
||||
$index->clean();
|
||||
|
||||
echo '------ end clean user index ------' . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重建索引
|
||||
*/
|
||||
protected function rebuildUserIndex()
|
||||
{
|
||||
$limit = 1000;
|
||||
|
||||
$totalCount = $this->countUsers();
|
||||
|
||||
if ($totalCount == 0) return;
|
||||
|
||||
$page = ceil($totalCount / $limit);
|
||||
|
||||
$handler = new UserSearcher();
|
||||
|
||||
$documenter = new UserDocument();
|
||||
|
||||
$index = $handler->getXS()->getIndex();
|
||||
|
||||
echo '------ start rebuild user index ------' . PHP_EOL;
|
||||
|
||||
$index->beginRebuild();
|
||||
|
||||
for ($i = 0; $i < $page; $i++) {
|
||||
|
||||
$offset = $i * $limit;
|
||||
|
||||
$users = $this->findUsers($limit, $offset);
|
||||
|
||||
if ($users->count() == 0) break;
|
||||
|
||||
foreach ($users as $user) {
|
||||
$document = $documenter->setDocument($user);
|
||||
$index->add($document);
|
||||
}
|
||||
|
||||
echo "------ fetch users: {$limit},{$offset} ------" . PHP_EOL;
|
||||
}
|
||||
|
||||
$index->endRebuild();
|
||||
|
||||
echo '------ end rebuild user index ------' . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索课程
|
||||
*
|
||||
* @param string $query
|
||||
* @return array
|
||||
* @throws \XSException
|
||||
*/
|
||||
protected function searchUsers($query)
|
||||
{
|
||||
$handler = new UserSearcher();
|
||||
|
||||
return $handler->search($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
* @param int $offset
|
||||
* @return ResultsetInterface|Resultset|UserModel[]
|
||||
*/
|
||||
protected function findUsers($limit, $offset)
|
||||
{
|
||||
return UserModel::query()
|
||||
->where('deleted = 0')
|
||||
->limit($limit, $offset)
|
||||
->execute();
|
||||
}
|
||||
|
||||
protected function countUsers()
|
||||
{
|
||||
$userRepo = new UserRepo();
|
||||
|
||||
return $userRepo->countUsers();
|
||||
}
|
||||
|
||||
}
|
@ -13,8 +13,8 @@ use App\Http\Admin\Services\WxpayTest as WxpayTestService;
|
||||
use App\Services\Captcha as CaptchaService;
|
||||
use App\Services\DingTalkNotice as DingTalkNoticeService;
|
||||
use App\Services\Live as LiveService;
|
||||
use App\Services\Logic\Notice\Mail\Test as MailTestService;
|
||||
use App\Services\Logic\Notice\Sms\Test as SmsTestService;
|
||||
use App\Services\Logic\Notice\External\Mail\Test as MailTestService;
|
||||
use App\Services\Logic\Notice\External\Sms\Test as SmsTestService;
|
||||
use App\Services\MyStorage as StorageService;
|
||||
use App\Services\Vod as VodService;
|
||||
use App\Services\WeChat as WeChatService;
|
||||
|
@ -21,9 +21,9 @@ use App\Repos\Report as ReportRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\Logic\Answer\AnswerDataTrait;
|
||||
use App\Services\Logic\Answer\AnswerInfo as AnswerInfoService;
|
||||
use App\Services\Logic\Notice\System\AnswerApproved as AnswerApprovedNotice;
|
||||
use App\Services\Logic\Notice\System\AnswerRejected as AnswerRejectedNotice;
|
||||
use App\Services\Logic\Notice\System\QuestionAnswered as QuestionAnsweredNotice;
|
||||
use App\Services\Logic\Notice\Internal\AnswerApproved as AnswerApprovedNotice;
|
||||
use App\Services\Logic\Notice\Internal\AnswerRejected as AnswerRejectedNotice;
|
||||
use App\Services\Logic\Notice\Internal\QuestionAnswered as QuestionAnsweredNotice;
|
||||
use App\Services\Logic\Point\History\AnswerPost as AnswerPostPointHistory;
|
||||
use App\Validators\Answer as AnswerValidator;
|
||||
|
||||
|
@ -24,8 +24,8 @@ use App\Repos\User as UserRepo;
|
||||
use App\Services\Logic\Article\ArticleDataTrait;
|
||||
use App\Services\Logic\Article\ArticleInfo as ArticleInfoService;
|
||||
use App\Services\Logic\Article\XmTagList as XmTagListService;
|
||||
use App\Services\Logic\Notice\System\ArticleApproved as ArticleApprovedNotice;
|
||||
use App\Services\Logic\Notice\System\ArticleRejected as ArticleRejectedNotice;
|
||||
use App\Services\Logic\Notice\Internal\ArticleApproved as ArticleApprovedNotice;
|
||||
use App\Services\Logic\Notice\Internal\ArticleRejected as ArticleRejectedNotice;
|
||||
use App\Services\Logic\Point\History\ArticlePost as ArticlePostPointHistory;
|
||||
use App\Services\Sync\ArticleIndex as ArticleIndexSync;
|
||||
use App\Validators\Article as ArticleValidator;
|
||||
|
@ -16,7 +16,7 @@ use App\Repos\Chapter as ChapterRepo;
|
||||
use App\Repos\Consult as ConsultRepo;
|
||||
use App\Repos\Course as CourseRepo;
|
||||
use App\Services\Logic\Consult\ConsultInfo as ConsultInfoService;
|
||||
use App\Services\Logic\Notice\ConsultReply as ConsultReplyNotice;
|
||||
use App\Services\Logic\Notice\External\ConsultReply as ConsultReplyNotice;
|
||||
use App\Validators\Consult as ConsultValidator;
|
||||
|
||||
class Consult extends Service
|
||||
|
@ -115,7 +115,7 @@ class Index extends Service
|
||||
|
||||
public function getReleases()
|
||||
{
|
||||
$url = 'https://koogua.com/api/releases';
|
||||
$url = 'https://www.koogua.com/api/releases';
|
||||
|
||||
$client = new Client();
|
||||
|
||||
|
@ -11,7 +11,7 @@ use App\Library\Paginator\Query as PagerQuery;
|
||||
use App\Models\PointGift as PointGiftModel;
|
||||
use App\Models\PointGiftRedeem as PointGiftRedeemModel;
|
||||
use App\Repos\PointGiftRedeem as PointGiftRedeemRepo;
|
||||
use App\Services\Logic\Notice\PointGoodsDeliver as PointGoodsDeliverNotice;
|
||||
use App\Services\Logic\Notice\External\PointGoodsDeliver as PointGoodsDeliverNotice;
|
||||
use App\Validators\PointGiftRedeem as PointGiftRedeemValidator;
|
||||
|
||||
class PointGiftRedeem extends Service
|
||||
|
@ -20,8 +20,8 @@ use App\Repos\Category as CategoryRepo;
|
||||
use App\Repos\Question as QuestionRepo;
|
||||
use App\Repos\Report as ReportRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\Logic\Notice\System\QuestionApproved as QuestionApprovedNotice;
|
||||
use App\Services\Logic\Notice\System\QuestionRejected as QuestionRejectedNotice;
|
||||
use App\Services\Logic\Notice\Internal\QuestionApproved as QuestionApprovedNotice;
|
||||
use App\Services\Logic\Notice\Internal\QuestionRejected as QuestionRejectedNotice;
|
||||
use App\Services\Logic\Point\History\QuestionPost as QuestionPostPointHistory;
|
||||
use App\Services\Logic\Question\QuestionDataTrait;
|
||||
use App\Services\Logic\Question\QuestionInfo as QuestionInfoService;
|
||||
|
@ -1,11 +0,0 @@
|
||||
{%- macro type_info(value) %}
|
||||
{% if value == 1 %}
|
||||
课程
|
||||
{% elseif value == 2 %}
|
||||
水吧
|
||||
{% elseif value == 3 %}
|
||||
职工
|
||||
{% else %}
|
||||
未知
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
@ -9,9 +9,7 @@ namespace App\Http\Api\Controllers;
|
||||
|
||||
use App\Services\Logic\Search\Article as ArticleSearch;
|
||||
use App\Services\Logic\Search\Course as CourseSearch;
|
||||
use App\Services\Logic\Search\Group as GroupSearch;
|
||||
use App\Services\Logic\Search\Question as QuestionSearch;
|
||||
use App\Services\Logic\Search\User as UserSearch;
|
||||
|
||||
/**
|
||||
* @RoutePrefix("/api/search")
|
||||
@ -46,7 +44,7 @@ class SearchController extends Controller
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @return ArticleSearch|QuestionSearch|CourseSearch|GroupSearch|UserSearch
|
||||
* @return ArticleSearch|QuestionSearch|CourseSearch
|
||||
*/
|
||||
protected function getSearchService($type)
|
||||
{
|
||||
@ -57,12 +55,6 @@ class SearchController extends Controller
|
||||
case 'question':
|
||||
$service = new QuestionSearch();
|
||||
break;
|
||||
case 'group':
|
||||
$service = new GroupSearch();
|
||||
break;
|
||||
case 'user':
|
||||
$service = new UserSearch();
|
||||
break;
|
||||
default:
|
||||
$service = new CourseSearch();
|
||||
break;
|
||||
|
@ -12,7 +12,7 @@ use App\Models\User as UserModel;
|
||||
use App\Repos\Connect as ConnectRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\Auth\Api as ApiAuthService;
|
||||
use App\Services\Logic\Notice\AccountLogin as AccountLoginNoticeService;
|
||||
use App\Services\Logic\Notice\External\AccountLogin as AccountLoginNoticeService;
|
||||
use App\Services\OAuth\QQ as QQAuth;
|
||||
use App\Services\OAuth\WeChat as WeChatAuth;
|
||||
use App\Services\OAuth\WeiBo as WeiBoAuth;
|
||||
|
@ -9,9 +9,7 @@ namespace App\Http\Home\Controllers;
|
||||
|
||||
use App\Services\Logic\Search\Article as ArticleSearchService;
|
||||
use App\Services\Logic\Search\Course as CourseSearchService;
|
||||
use App\Services\Logic\Search\Group as GroupSearchService;
|
||||
use App\Services\Logic\Search\Question as QuestionSearchService;
|
||||
use App\Services\Logic\Search\User as UserSearchService;
|
||||
|
||||
/**
|
||||
* @RoutePrefix("/search")
|
||||
@ -48,7 +46,7 @@ class SearchController extends Controller
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @return ArticleSearchService|QuestionSearchService|CourseSearchService|GroupSearchService|UserSearchService
|
||||
* @return ArticleSearchService|QuestionSearchService|CourseSearchService
|
||||
*/
|
||||
protected function getSearchService($type)
|
||||
{
|
||||
@ -59,12 +57,6 @@ class SearchController extends Controller
|
||||
case 'question':
|
||||
$service = new QuestionSearchService();
|
||||
break;
|
||||
case 'group':
|
||||
$service = new GroupSearchService();
|
||||
break;
|
||||
case 'user':
|
||||
$service = new UserSearchService();
|
||||
break;
|
||||
default:
|
||||
$service = new CourseSearchService();
|
||||
break;
|
||||
|
@ -16,7 +16,7 @@ use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
||||
use App\Services\Auth\Home as AuthService;
|
||||
use App\Services\Auth\Home as HomeAuthService;
|
||||
use App\Services\Logic\Account\Register as RegisterService;
|
||||
use App\Services\Logic\Notice\AccountLogin as AccountLoginNotice;
|
||||
use App\Services\Logic\Notice\External\AccountLogin as AccountLoginNotice;
|
||||
use App\Services\OAuth\QQ as QQAuth;
|
||||
use App\Services\OAuth\WeiBo as WeiBoAuth;
|
||||
use App\Services\OAuth\WeiXin as WeiXinAuth;
|
||||
|
@ -1,9 +0,0 @@
|
||||
{%- macro type_info(value) %}
|
||||
{% if value == 1 %}
|
||||
课程
|
||||
{% elseif value == 2 %}
|
||||
水吧
|
||||
{% elseif value == 3 %}
|
||||
职工
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
@ -4,7 +4,7 @@
|
||||
|
||||
{{ partial('macros/course') }}
|
||||
|
||||
{% set types = {'course':'课程','article':'专栏','question':'问答','user':'用户'} %}
|
||||
{% set types = {'course':'课程','article':'专栏','question':'问答'} %}
|
||||
{% set type = request.get('type','trim','course') %}
|
||||
{% set query = request.get('query','striptags','') %}
|
||||
|
||||
@ -39,10 +39,6 @@
|
||||
<div class="layui-tab-item layui-show">
|
||||
{{ partial('search/question') }}
|
||||
</div>
|
||||
{% elseif type == 'user' %}
|
||||
<div class="layui-tab-item layui-show">
|
||||
{{ partial('search/user') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,29 +0,0 @@
|
||||
{{ partial('macros/user') }}
|
||||
|
||||
{% if pager.total_pages > 0 %}
|
||||
<div class="search-user-list">
|
||||
{% for item in pager.items %}
|
||||
{% set user_url = url({'for':'home.user.show','id':item.id}) %}
|
||||
{% set item.about = item.about|default('这个家伙真懒,什么也没有留下!') %}
|
||||
<div class="search-user-card">
|
||||
<div class="avatar">
|
||||
<a href="{{ user_url }}" target="_blank">
|
||||
<img src="{{ item.avatar }}!avatar_160" alt="{{ item.name }}">
|
||||
</a>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="name">
|
||||
<a href="{{ user_url }}" target="_blank">{{ item.name }}</a>
|
||||
</div>
|
||||
<div class="about">{{ item.about }}</div>
|
||||
<div class="meta">
|
||||
<span>性别:{{ gender_info(item.gender) }}</span>
|
||||
<span>地区:{{ item.area }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ partial('search/empty') }}
|
||||
{% endif %}
|
@ -14,9 +14,9 @@ class AppInfo
|
||||
|
||||
protected $alias = 'CTC';
|
||||
|
||||
protected $link = 'https://koogua.com';
|
||||
protected $link = 'https://www.koogua.com';
|
||||
|
||||
protected $version = '1.5.8';
|
||||
protected $version = '1.5.9';
|
||||
|
||||
public function __get($name)
|
||||
{
|
||||
|
@ -199,16 +199,6 @@ function kg_default_user_avatar_path()
|
||||
return '/img/default/user_avatar.png';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认群组头像路径
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function kg_default_group_avatar_path()
|
||||
{
|
||||
return '/img/default/group_avatar.png';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取默认课程封面路径
|
||||
*
|
||||
@ -315,20 +305,6 @@ function kg_cos_user_avatar_url($path, $style = null)
|
||||
return kg_cos_img_url($path, $style);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取群组头像URL
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $style
|
||||
* @return string
|
||||
*/
|
||||
function kg_cos_group_avatar_url($path, $style = null)
|
||||
{
|
||||
$path = $path ?: kg_default_group_avatar_path();
|
||||
|
||||
return kg_cos_img_url($path, $style);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取课程封面URL
|
||||
*
|
||||
@ -442,7 +418,7 @@ function kg_clean_html($content)
|
||||
* @param int $length
|
||||
* @return string
|
||||
*/
|
||||
function kg_parse_summary($content, $length = 100)
|
||||
function kg_parse_summary($content, $length = 150)
|
||||
{
|
||||
$content = trim(strip_tags($content));
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
namespace App\Listeners;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use App\Services\Logic\Notice\AccountLogin as AccountLoginNoticeService;
|
||||
use App\Services\Logic\Notice\External\AccountLogin as AccountLoginNoticeService;
|
||||
use App\Services\Logic\Point\History\AccountRegister as AccountRegisterPointHistory;
|
||||
use Phalcon\Events\Event as PhEvent;
|
||||
|
||||
|
@ -95,15 +95,6 @@ class Notification extends Model
|
||||
const TYPE_ANSWER_COMMENTED = 227;
|
||||
const TYPE_ANSWER_LIKED = 228;
|
||||
|
||||
/* -------------- 微聊相关 -------------- */
|
||||
|
||||
const TYPE_FRIEND_REQUEST = 0; // 好友请求
|
||||
const TYPE_FRIEND_ACCEPTED = 0; // 好友被接受
|
||||
const TYPE_FRIEND_REFUSED = 0; // 好友被拒绝
|
||||
const TYPE_GROUP_REQUEST = 0; // 入群请求
|
||||
const TYPE_GROUP_ACCEPTED = 0; // 入群被接受
|
||||
const TYPE_GROUP_REFUSED = 0; // 入群被拒绝
|
||||
|
||||
/* -------------- 评论相关 -------------- */
|
||||
|
||||
const TYPE_COMMENT_CREATED = 500;
|
||||
|
@ -35,7 +35,7 @@ class Task extends Model
|
||||
const TYPE_STAFF_NOTICE_CONSULT_CREATE = 31; // 咨询创建通知
|
||||
const TYPE_STAFF_NOTICE_TEACHER_LIVE = 32; // 直播讲师通知
|
||||
const TYPE_STAFF_NOTICE_SERVER_MONITOR = 33; // 服务监控通知
|
||||
const TYPE_STAFF_NOTICE_CUSTOM_SERVICE = 34; // 客服消息通知
|
||||
const TYPE_STAFF_NOTICE_CUSTOM_SERVICE = 34; // 客服消息通知(废弃)
|
||||
const TYPE_STAFF_NOTICE_POINT_GIFT_REDEEM = 35; // 积分兑换通知
|
||||
const TYPE_STAFF_NOTICE_LUCKY_GIFT_REDEEM = 36; // 抽奖兑换通知
|
||||
|
||||
|
@ -9,7 +9,6 @@ namespace App\Models;
|
||||
|
||||
use App\Caches\MaxUserId as MaxUserIdCache;
|
||||
use App\Caches\User as UserCache;
|
||||
use App\Services\Sync\UserIndex as UserIndexSync;
|
||||
use Phalcon\Mvc\Model\Behavior\SoftDelete;
|
||||
use Phalcon\Text;
|
||||
|
||||
@ -216,11 +215,6 @@ class User extends Model
|
||||
|
||||
public function beforeUpdate()
|
||||
{
|
||||
if (time() - $this->update_time > 3 * 3600) {
|
||||
$sync = new UserIndexSync();
|
||||
$sync->addItem($this->id);
|
||||
}
|
||||
|
||||
$this->update_time = time();
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ use App\Models\Chapter as ChapterModel;
|
||||
use App\Models\ChapterLive as ChapterLiveModel;
|
||||
use App\Repos\Chapter as ChapterRepo;
|
||||
use App\Repos\CourseUser as CourseUserRepo;
|
||||
use App\Services\Logic\Notice\LiveBegin as LiveBeginNotice;
|
||||
use App\Services\Logic\Notice\External\LiveBegin as LiveBeginNotice;
|
||||
use Phalcon\Logger\Adapter\File as FileLogger;
|
||||
|
||||
class LiveNotify extends Service
|
||||
|
@ -10,7 +10,7 @@ namespace App\Services\Logic\Answer;
|
||||
use App\Models\Answer as AnswerModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Services\Logic\AnswerTrait;
|
||||
use App\Services\Logic\Notice\System\AnswerAccepted as AnswerAcceptedNotice;
|
||||
use App\Services\Logic\Notice\Internal\AnswerAccepted as AnswerAcceptedNotice;
|
||||
use App\Services\Logic\Point\History\AnswerAccepted as AnswerAcceptPointHistory;
|
||||
use App\Services\Logic\QuestionTrait;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
@ -13,7 +13,7 @@ use App\Models\User as UserModel;
|
||||
use App\Repos\Question as QuestionRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\Logic\AnswerTrait;
|
||||
use App\Services\Logic\Notice\System\QuestionAnswered as QuestionAnsweredNotice;
|
||||
use App\Services\Logic\Notice\Internal\QuestionAnswered as QuestionAnsweredNotice;
|
||||
use App\Services\Logic\Point\History\AnswerPost as AnswerPostPointHistory;
|
||||
use App\Services\Logic\QuestionTrait;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
@ -12,7 +12,7 @@ use App\Models\AnswerLike as AnswerLikeModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\AnswerLike as AnswerLikeRepo;
|
||||
use App\Services\Logic\AnswerTrait;
|
||||
use App\Services\Logic\Notice\System\AnswerLiked as AnswerLikedNotice;
|
||||
use App\Services\Logic\Notice\Internal\AnswerLiked as AnswerLikedNotice;
|
||||
use App\Services\Logic\Point\History\AnswerLiked as AnswerLikedPointHistory;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\UserLimit as UserLimitValidator;
|
||||
|
@ -12,7 +12,7 @@ use App\Models\ArticleFavorite as ArticleFavoriteModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\ArticleFavorite as ArticleFavoriteRepo;
|
||||
use App\Services\Logic\ArticleTrait;
|
||||
use App\Services\Logic\Notice\System\ArticleFavorited as ArticleFavoritedNotice;
|
||||
use App\Services\Logic\Notice\Internal\ArticleFavorited as ArticleFavoritedNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\UserLimit as UserLimitValidator;
|
||||
|
||||
|
@ -12,7 +12,7 @@ use App\Models\ArticleLike as ArticleLikeModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\ArticleLike as ArticleLikeRepo;
|
||||
use App\Services\Logic\ArticleTrait;
|
||||
use App\Services\Logic\Notice\System\ArticleLiked as ArticleLikedNotice;
|
||||
use App\Services\Logic\Notice\Internal\ArticleLiked as ArticleLikedNotice;
|
||||
use App\Services\Logic\Point\History\ArticleLiked as ArticleLikedPointHistory;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\UserLimit as UserLimitValidator;
|
||||
|
@ -11,10 +11,10 @@ use App\Models\Answer as AnswerModel;
|
||||
use App\Models\Article as ArticleModel;
|
||||
use App\Models\Comment as CommentModel;
|
||||
use App\Models\Question as QuestionModel;
|
||||
use App\Services\Logic\Notice\System\AnswerCommented as AnswerCommentedNotice;
|
||||
use App\Services\Logic\Notice\System\ArticleCommented as ArticleCommentedNotice;
|
||||
use App\Services\Logic\Notice\System\CommentReplied as CommentRepliedNotice;
|
||||
use App\Services\Logic\Notice\System\QuestionCommented as QuestionCommentedNotice;
|
||||
use App\Services\Logic\Notice\Internal\AnswerCommented as AnswerCommentedNotice;
|
||||
use App\Services\Logic\Notice\Internal\ArticleCommented as ArticleCommentedNotice;
|
||||
use App\Services\Logic\Notice\Internal\CommentReplied as CommentRepliedNotice;
|
||||
use App\Services\Logic\Notice\Internal\QuestionCommented as QuestionCommentedNotice;
|
||||
use App\Services\Logic\Point\History\CommentPost as CommentPostPointHistory;
|
||||
|
||||
trait AfterCreateTrait
|
||||
|
@ -12,7 +12,7 @@ use App\Models\CommentLike as CommentLikeModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\CommentLike as CommentLikeRepo;
|
||||
use App\Services\Logic\CommentTrait;
|
||||
use App\Services\Logic\Notice\System\CommentLiked as CommentLikedNotice;
|
||||
use App\Services\Logic\Notice\Internal\CommentLiked as CommentLikedNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\UserLimit as UserLimitValidator;
|
||||
|
||||
|
@ -15,7 +15,7 @@ use App\Repos\Chapter as ChapterRepo;
|
||||
use App\Repos\Course as CourseRepo;
|
||||
use App\Services\Logic\ChapterTrait;
|
||||
use App\Services\Logic\CourseTrait;
|
||||
use App\Services\Logic\Notice\DingTalk\ConsultCreate as ConsultCreateNotice;
|
||||
use App\Services\Logic\Notice\External\DingTalk\ConsultCreate as ConsultCreateNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Traits\Client as ClientTrait;
|
||||
use App\Validators\Consult as ConsultValidator;
|
||||
|
@ -12,7 +12,7 @@ use App\Models\ConsultLike as ConsultLikeModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\ConsultLike as ConsultLikeRepo;
|
||||
use App\Services\Logic\ConsultTrait;
|
||||
use App\Services\Logic\Notice\System\ConsultLiked as ConsultLikedNotice;
|
||||
use App\Services\Logic\Notice\Internal\ConsultLiked as ConsultLikedNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\UserLimit as UserLimitValidator;
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace App\Services\Logic\Consult;
|
||||
|
||||
use App\Models\Consult as ConsultModel;
|
||||
use App\Services\Logic\ConsultTrait;
|
||||
use App\Services\Logic\Notice\ConsultReply as ConsultReplyNotice;
|
||||
use App\Services\Logic\Notice\External\ConsultReply as ConsultReplyNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\Consult as ConsultValidator;
|
||||
|
||||
|
@ -1,68 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\DingTalk;
|
||||
|
||||
use App\Models\ImMessage as ImMessageModel;
|
||||
use App\Models\Task as TaskModel;
|
||||
use App\Repos\ImMessage as ImMessageRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Services\DingTalkNotice;
|
||||
|
||||
class CustomService extends DingTalkNotice
|
||||
{
|
||||
|
||||
public function handleTask(TaskModel $task)
|
||||
{
|
||||
if (!$this->enabled) return;
|
||||
|
||||
$messageRepo = new ImMessageRepo();
|
||||
|
||||
$message = $messageRepo->findById($task->item_id);
|
||||
|
||||
$userRepo = new UserRepo();
|
||||
|
||||
$sender = $userRepo->findById($message->sender_id);
|
||||
|
||||
$content = kg_ph_replace("{user.name} 通过在线客服给你发送了消息:{message.content}", [
|
||||
'user.name' => $sender->name,
|
||||
'message.content' => $message->content,
|
||||
]);
|
||||
|
||||
$this->atCustomService($content);
|
||||
}
|
||||
|
||||
public function createTask(ImMessageModel $message)
|
||||
{
|
||||
if (!$this->enabled) return;
|
||||
|
||||
$keyName = "dingtalk_custom_service_notice:{$message->sender_id}";
|
||||
|
||||
$cache = $this->getCache();
|
||||
|
||||
$content = $cache->get($keyName);
|
||||
|
||||
if ($content) return;
|
||||
|
||||
$cache->save($keyName, 1, 3600);
|
||||
|
||||
$task = new TaskModel();
|
||||
|
||||
$itemInfo = [
|
||||
'im_message' => ['id' => $message->id],
|
||||
];
|
||||
|
||||
$task->item_id = $message->id;
|
||||
$task->item_info = $itemInfo;
|
||||
$task->item_type = TaskModel::TYPE_STAFF_NOTICE_CUSTOM_SERVICE;
|
||||
$task->priority = TaskModel::PRIORITY_MIDDLE;
|
||||
$task->status = TaskModel::STATUS_PENDING;
|
||||
|
||||
$task->create();
|
||||
}
|
||||
|
||||
}
|
@ -5,12 +5,12 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice;
|
||||
namespace App\Services\Logic\Notice\External;
|
||||
|
||||
use App\Models\Task as TaskModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
||||
use App\Services\Logic\Notice\WeChat\AccountLogin as WeChatAccountLoginNotice;
|
||||
use App\Services\Logic\Notice\External\WeChat\AccountLogin as WeChatAccountLoginNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Traits\Client as ClientTrait;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice;
|
||||
namespace App\Services\Logic\Notice\External;
|
||||
|
||||
use App\Models\Consult as ConsultModel;
|
||||
use App\Models\Task as TaskModel;
|
||||
@ -13,8 +13,8 @@ use App\Repos\Consult as ConsultRepo;
|
||||
use App\Repos\Course as CourseRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
||||
use App\Services\Logic\Notice\Sms\ConsultReply as SmsConsultReplyNotice;
|
||||
use App\Services\Logic\Notice\WeChat\ConsultReply as WeChatConsultReplyNotice;
|
||||
use App\Services\Logic\Notice\External\Sms\ConsultReply as SmsConsultReplyNotice;
|
||||
use App\Services\Logic\Notice\External\WeChat\ConsultReply as WeChatConsultReplyNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
||||
class ConsultReply extends LogicService
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\DingTalk;
|
||||
namespace App\Services\Logic\Notice\External\DingTalk;
|
||||
|
||||
use App\Models\Consult as ConsultModel;
|
||||
use App\Models\Task as TaskModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\DingTalk;
|
||||
namespace App\Services\Logic\Notice\External\DingTalk;
|
||||
|
||||
use App\Models\PointGift as PointGiftModel;
|
||||
use App\Models\PointGiftRedeem as PointGiftRedeemModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\DingTalk;
|
||||
namespace App\Services\Logic\Notice\External\DingTalk;
|
||||
|
||||
use App\Models\Task as TaskModel;
|
||||
use App\Services\DingTalkNotice;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\DingTalk;
|
||||
namespace App\Services\Logic\Notice\External\DingTalk;
|
||||
|
||||
use App\Models\ChapterLive as ChapterLiveModel;
|
||||
use App\Models\Task as TaskModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice;
|
||||
namespace App\Services\Logic\Notice\External;
|
||||
|
||||
use App\Models\Chapter as ChapterModel;
|
||||
use App\Models\CourseUser as CourseUserModel;
|
||||
@ -14,8 +14,8 @@ use App\Repos\Chapter as ChapterRepo;
|
||||
use App\Repos\Course as CourseRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
||||
use App\Services\Logic\Notice\Sms\LiveBegin as SmsLiveBeginNotice;
|
||||
use App\Services\Logic\Notice\WeChat\LiveBegin as WeChatLiveBeginNotice;
|
||||
use App\Services\Logic\Notice\External\Sms\LiveBegin as SmsLiveBeginNotice;
|
||||
use App\Services\Logic\Notice\External\WeChat\LiveBegin as WeChatLiveBeginNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
||||
class LiveBegin extends LogicService
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Mail;
|
||||
namespace App\Services\Logic\Notice\External\Mail;
|
||||
|
||||
use App\Services\Mailer;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Mail;
|
||||
namespace App\Services\Logic\Notice\External\Mail;
|
||||
|
||||
use App\Services\Mailer as MailerService;
|
||||
use App\Services\Verify as VerifyService;
|
@ -5,15 +5,15 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice;
|
||||
namespace App\Services\Logic\Notice\External;
|
||||
|
||||
use App\Models\Order as OrderModel;
|
||||
use App\Models\Task as TaskModel;
|
||||
use App\Repos\Order as OrderRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
||||
use App\Services\Logic\Notice\Sms\OrderFinish as SmsOrderFinishNotice;
|
||||
use App\Services\Logic\Notice\WeChat\OrderFinish as WeChatOrderFinishNotice;
|
||||
use App\Services\Logic\Notice\External\Sms\OrderFinish as SmsOrderFinishNotice;
|
||||
use App\Services\Logic\Notice\External\WeChat\OrderFinish as WeChatOrderFinishNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
||||
class OrderFinish extends LogicService
|
@ -5,15 +5,15 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice;
|
||||
namespace App\Services\Logic\Notice\External;
|
||||
|
||||
use App\Models\PointGiftRedeem as PointGiftRedeemModel;
|
||||
use App\Models\Task as TaskModel;
|
||||
use App\Repos\PointGiftRedeem as PointGiftRedeemRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
||||
use App\Services\Logic\Notice\Sms\GoodsDeliver as SmsGoodsDeliverNotice;
|
||||
use App\Services\Logic\Notice\WeChat\GoodsDeliver as WeChatGoodsDeliverNotice;
|
||||
use App\Services\Logic\Notice\External\Sms\GoodsDeliver as SmsGoodsDeliverNotice;
|
||||
use App\Services\Logic\Notice\External\WeChat\GoodsDeliver as WeChatGoodsDeliverNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
||||
class PointGoodsDeliver extends LogicService
|
@ -5,15 +5,15 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice;
|
||||
namespace App\Services\Logic\Notice\External;
|
||||
|
||||
use App\Models\Refund as RefundModel;
|
||||
use App\Models\Task as TaskModel;
|
||||
use App\Repos\Refund as RefundRepo;
|
||||
use App\Repos\User as UserRepo;
|
||||
use App\Repos\WeChatSubscribe as WeChatSubscribeRepo;
|
||||
use App\Services\Logic\Notice\Sms\RefundFinish as SmsRefundFinishNotice;
|
||||
use App\Services\Logic\Notice\WeChat\RefundFinish as WeChatRefundFinishNotice;
|
||||
use App\Services\Logic\Notice\External\Sms\RefundFinish as SmsRefundFinishNotice;
|
||||
use App\Services\Logic\Notice\External\WeChat\RefundFinish as WeChatRefundFinishNotice;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
||||
class RefundFinish extends LogicService
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Sms;
|
||||
namespace App\Services\Logic\Notice\External\Sms;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\Account as AccountRepo;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Sms;
|
||||
namespace App\Services\Logic\Notice\External\Sms;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\Account as AccountRepo;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Sms;
|
||||
namespace App\Services\Logic\Notice\External\Sms;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\Account as AccountRepo;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Sms;
|
||||
namespace App\Services\Logic\Notice\External\Sms;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\Account as AccountRepo;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Sms;
|
||||
namespace App\Services\Logic\Notice\External\Sms;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\Account as AccountRepo;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Sms;
|
||||
namespace App\Services\Logic\Notice\External\Sms;
|
||||
|
||||
use App\Services\Smser;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\Sms;
|
||||
namespace App\Services\Logic\Notice\External\Sms;
|
||||
|
||||
use App\Services\Smser as SmserService;
|
||||
use App\Services\Verify as VerifyService;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\WeChat;
|
||||
namespace App\Services\Logic\Notice\External\WeChat;
|
||||
|
||||
use App\Models\WeChatSubscribe as WeChatSubscribeModel;
|
||||
use App\Services\WeChatNotice;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\WeChat;
|
||||
namespace App\Services\Logic\Notice\External\WeChat;
|
||||
|
||||
use App\Models\WeChatSubscribe as WeChatSubscribeModel;
|
||||
use App\Services\WeChatNotice;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\WeChat;
|
||||
namespace App\Services\Logic\Notice\External\WeChat;
|
||||
|
||||
use App\Models\WeChatSubscribe as WeChatSubscribeModel;
|
||||
use App\Services\WeChatNotice;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\WeChat;
|
||||
namespace App\Services\Logic\Notice\External\WeChat;
|
||||
|
||||
use App\Models\WeChatSubscribe as WeChatSubscribeModel;
|
||||
use App\Services\WeChatNotice;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\WeChat;
|
||||
namespace App\Services\Logic\Notice\External\WeChat;
|
||||
|
||||
use App\Models\WeChatSubscribe as WeChatSubscribeModel;
|
||||
use App\Services\WeChatNotice;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\WeChat;
|
||||
namespace App\Services\Logic\Notice\External\WeChat;
|
||||
|
||||
use App\Models\WeChatSubscribe as WeChatSubscribeModel;
|
||||
use App\Services\WeChatNotice;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Answer as AnswerModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Answer as AnswerModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Answer as AnswerModel;
|
||||
use App\Models\Comment as CommentModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Answer as AnswerModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Answer as AnswerModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Article as ArticleModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Article as ArticleModel;
|
||||
use App\Models\Comment as CommentModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Article as ArticleModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Article as ArticleModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Article as ArticleModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Article as ArticleModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Comment as CommentModel;
|
||||
use App\Services\Logic\Service as LogicService;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Comment as CommentModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Comment as CommentModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Consult as ConsultModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Answer as AnswerModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Notification as NotificationModel;
|
||||
use App\Models\Question as QuestionModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Comment as CommentModel;
|
||||
use App\Models\Notification as NotificationModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Notification as NotificationModel;
|
||||
use App\Models\Question as QuestionModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Notification as NotificationModel;
|
||||
use App\Models\Question as QuestionModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Notification as NotificationModel;
|
||||
use App\Models\Question as QuestionModel;
|
@ -5,7 +5,7 @@
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Notice\System;
|
||||
namespace App\Services\Logic\Notice\Internal;
|
||||
|
||||
use App\Models\Notification as NotificationModel;
|
||||
use App\Models\Review as ReviewModel;
|
@ -11,7 +11,7 @@ use App\Models\Question as QuestionModel;
|
||||
use App\Models\QuestionFavorite as QuestionFavoriteModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\QuestionFavorite as QuestionFavoriteRepo;
|
||||
use App\Services\Logic\Notice\System\QuestionFavorited as QuestionFavoritedNotice;
|
||||
use App\Services\Logic\Notice\Internal\QuestionFavorited as QuestionFavoritedNotice;
|
||||
use App\Services\Logic\QuestionTrait;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\UserLimit as UserLimitValidator;
|
||||
|
@ -11,7 +11,7 @@ use App\Models\Question as QuestionModel;
|
||||
use App\Models\QuestionLike as QuestionLikeModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\QuestionLike as QuestionLikeRepo;
|
||||
use App\Services\Logic\Notice\System\QuestionLiked as QuestionLikedNotice;
|
||||
use App\Services\Logic\Notice\Internal\QuestionLiked as QuestionLikedNotice;
|
||||
use App\Services\Logic\Point\History\QuestionLiked as QuestionLikedPointHistory;
|
||||
use App\Services\Logic\QuestionTrait;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
|
@ -11,7 +11,7 @@ use App\Models\Review as ReviewModel;
|
||||
use App\Models\ReviewLike as ReviewLikeModel;
|
||||
use App\Models\User as UserModel;
|
||||
use App\Repos\ReviewLike as ReviewLikeRepo;
|
||||
use App\Services\Logic\Notice\System\ReviewLiked as ReviewLikedNotice;
|
||||
use App\Services\Logic\Notice\Internal\ReviewLiked as ReviewLikedNotice;
|
||||
use App\Services\Logic\ReviewTrait;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\UserLimit as UserLimitValidator;
|
||||
|
@ -1,90 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Search;
|
||||
|
||||
use App\Library\Paginator\Adapter\XunSearch as XunSearchPaginator;
|
||||
use App\Library\Paginator\Query as PagerQuery;
|
||||
use App\Services\Search\GroupSearcher as GroupSearcherService;
|
||||
use Phalcon\Text;
|
||||
|
||||
class Group extends Handler
|
||||
{
|
||||
|
||||
public function search()
|
||||
{
|
||||
$pagerQuery = new PagerQuery();
|
||||
|
||||
$params = $pagerQuery->getParams();
|
||||
$page = $pagerQuery->getPage();
|
||||
$limit = $pagerQuery->getLimit();
|
||||
|
||||
$searcher = new GroupSearcherService();
|
||||
|
||||
$paginator = new XunSearchPaginator([
|
||||
'xs' => $searcher->getXS(),
|
||||
'highlight' => $searcher->getHighlightFields(),
|
||||
'query' => $params['query'],
|
||||
'page' => $page,
|
||||
'limit' => $limit,
|
||||
]);
|
||||
|
||||
$pager = $paginator->getPaginate();
|
||||
|
||||
return $this->handleGroups($pager);
|
||||
}
|
||||
|
||||
public function getHotQuery($limit = 10, $type = 'total')
|
||||
{
|
||||
$searcher = new GroupSearcherService();
|
||||
|
||||
return $searcher->getHotQuery($limit, $type);
|
||||
}
|
||||
|
||||
public function getRelatedQuery($query, $limit = 10)
|
||||
{
|
||||
$searcher = new GroupSearcherService();
|
||||
|
||||
return $searcher->getRelatedQuery($query, $limit);
|
||||
}
|
||||
|
||||
protected function handleGroups($pager)
|
||||
{
|
||||
if ($pager->total_items == 0) {
|
||||
return $pager;
|
||||
}
|
||||
|
||||
$items = [];
|
||||
|
||||
$baseUrl = kg_cos_url();
|
||||
|
||||
foreach ($pager->items as $item) {
|
||||
|
||||
$owner = json_decode($item['owner'], true);
|
||||
|
||||
if (!empty($item['avatar']) && !Text::startsWith($item['avatar'], 'http')) {
|
||||
$item['avatar'] = $baseUrl . $item['avatar'];
|
||||
}
|
||||
|
||||
$items[] = [
|
||||
'id' => (int)$item['id'],
|
||||
'type' => (int)$item['type'],
|
||||
'name' => (string)$item['name'],
|
||||
'avatar' => (string)$item['avatar'],
|
||||
'about' => (string)$item['about'],
|
||||
'user_count' => (int)$item['user_count'],
|
||||
'msg_count' => (int)$item['msg_count'],
|
||||
'owner' => $owner,
|
||||
];
|
||||
}
|
||||
|
||||
$pager->items = $items;
|
||||
|
||||
return $pager;
|
||||
}
|
||||
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Logic\Search;
|
||||
|
||||
use App\Library\Paginator\Adapter\XunSearch as XunSearchPaginator;
|
||||
use App\Library\Paginator\Query as PagerQuery;
|
||||
use App\Services\Search\UserSearcher as UserSearcherService;
|
||||
|
||||
class User extends Handler
|
||||
{
|
||||
|
||||
public function search()
|
||||
{
|
||||
$pagerQuery = new PagerQuery();
|
||||
|
||||
$params = $pagerQuery->getParams();
|
||||
$page = $pagerQuery->getPage();
|
||||
$limit = $pagerQuery->getLimit();
|
||||
|
||||
$searcher = new UserSearcherService();
|
||||
|
||||
$paginator = new XunSearchPaginator([
|
||||
'xs' => $searcher->getXS(),
|
||||
'highlight' => $searcher->getHighlightFields(),
|
||||
'query' => $params['query'],
|
||||
'page' => $page,
|
||||
'limit' => $limit,
|
||||
]);
|
||||
|
||||
$pager = $paginator->getPaginate();
|
||||
|
||||
return $this->handleUsers($pager);
|
||||
}
|
||||
|
||||
public function getHotQuery($limit = 10, $type = 'total')
|
||||
{
|
||||
$searcher = new UserSearcherService();
|
||||
|
||||
return $searcher->getHotQuery($limit, $type);
|
||||
}
|
||||
|
||||
public function getRelatedQuery($query, $limit = 10)
|
||||
{
|
||||
$searcher = new UserSearcherService();
|
||||
|
||||
return $searcher->getRelatedQuery($query, $limit);
|
||||
}
|
||||
|
||||
protected function handleUsers($pager)
|
||||
{
|
||||
if ($pager->total_items == 0) {
|
||||
return $pager;
|
||||
}
|
||||
|
||||
$items = [];
|
||||
|
||||
$baseUrl = kg_cos_url();
|
||||
|
||||
foreach ($pager->items as $item) {
|
||||
|
||||
$item['avatar'] = $baseUrl . $item['avatar'];
|
||||
|
||||
$items[] = [
|
||||
'id' => (int)$item['id'],
|
||||
'name' => (string)$item['name'],
|
||||
'avatar' => (string)$item['avatar'],
|
||||
'title' => (string)$item['title'],
|
||||
'about' => (string)$item['about'],
|
||||
'vip' => (int)$item['vip'],
|
||||
'gender' => (int)$item['gender'],
|
||||
'area' => (string)$item['area'],
|
||||
];
|
||||
}
|
||||
|
||||
$pager->items = $items;
|
||||
|
||||
return $pager;
|
||||
}
|
||||
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace App\Services\Logic\Verify;
|
||||
|
||||
use App\Services\Logic\Notice\Mail\Verify as MailVerifyService;
|
||||
use App\Services\Logic\Notice\External\Mail\Verify as MailVerifyService;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\Captcha as CaptchaValidator;
|
||||
use App\Validators\Verify as VerifyValidator;
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace App\Services\Logic\Verify;
|
||||
|
||||
use App\Services\Logic\Notice\Sms\Verify as SmsVerifyService;
|
||||
use App\Services\Logic\Notice\External\Sms\Verify as SmsVerifyService;
|
||||
use App\Services\Logic\Service as LogicService;
|
||||
use App\Validators\Captcha as CaptchaValidator;
|
||||
use App\Validators\Verify as VerifyValidator;
|
||||
|
@ -1,55 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Search;
|
||||
|
||||
use App\Models\User as UserModel;
|
||||
use Phalcon\Di\Injectable;
|
||||
|
||||
class UserDocument extends Injectable
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置文档
|
||||
*
|
||||
* @param UserModel $user
|
||||
* @return \XSDocument
|
||||
*/
|
||||
public function setDocument(UserModel $user)
|
||||
{
|
||||
$doc = new \XSDocument();
|
||||
|
||||
$data = $this->formatDocument($user);
|
||||
|
||||
$doc->setFields($data);
|
||||
|
||||
return $doc;
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化文档
|
||||
*
|
||||
* @param UserModel $user
|
||||
* @return array
|
||||
*/
|
||||
public function formatDocument(UserModel $user)
|
||||
{
|
||||
$user->avatar = UserModel::getAvatarPath($user->avatar);
|
||||
|
||||
return [
|
||||
'id' => $user->id,
|
||||
'name' => $user->name,
|
||||
'title' => $user->title,
|
||||
'avatar' => $user->avatar,
|
||||
'about' => $user->about,
|
||||
'gender' => $user->gender,
|
||||
'area' => $user->area,
|
||||
'vip' => $user->vip,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
|
||||
* @license https://opensource.org/licenses/GPL-2.0
|
||||
* @link https://www.koogua.com
|
||||
*/
|
||||
|
||||
namespace App\Services\Search;
|
||||
|
||||
class UserSearcher extends Searcher
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->xs = $this->getXS();
|
||||
}
|
||||
|
||||
public function getXS()
|
||||
{
|
||||
$filename = config_path('xs.user.ini');
|
||||
|
||||
return new \XS($filename);
|
||||
}
|
||||
|
||||
public function getHighlightFields()
|
||||
{
|
||||
return ['name', 'about'];
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user