|
@@ -65,8 +65,13 @@ use Illuminate\Support\Facades\Cache;
|
|
|
|
|
|
use App\Model\Company;
|
|
use App\Model\Company;
|
|
use Hyperf\Paginator\Paginator;
|
|
use Hyperf\Paginator\Paginator;
|
|
-use App\Model\Project;
|
|
|
|
|
|
+use App\Model\Project;
|
|
|
|
|
|
|
|
+use Hyperf\Context\Context;
|
|
|
|
+use Hyperf\Context\ApplicationContext as ContextApplicationContext;
|
|
|
|
+use Hyperf\Amqp\Producer;
|
|
|
|
+
|
|
|
|
+use App\Amqp\Producer\MqProducer;
|
|
#[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
#[RpcService(name: "NewsService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
class NewsService implements NewsServiceInterface
|
|
class NewsService implements NewsServiceInterface
|
|
{
|
|
{
|
|
@@ -491,7 +496,14 @@ class NewsService implements NewsServiceInterface
|
|
// 截取 100 个字符
|
|
// 截取 100 个字符
|
|
$articleData['introduce'] = mb_substr($content, 0, 100);
|
|
$articleData['introduce'] = mb_substr($content, 0, 100);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if($articleData['status']==0){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>100,
|
|
|
|
+ 'title'=>$articleData['title'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>2,
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
$id = Article::insertGetId($articleData);
|
|
$id = Article::insertGetId($articleData);
|
|
$articleDataContent = [
|
|
$articleDataContent = [
|
|
'article_id' => $id,
|
|
'article_id' => $id,
|
|
@@ -674,7 +686,13 @@ class NewsService implements NewsServiceInterface
|
|
// 截取 100 个字符
|
|
// 截取 100 个字符
|
|
$articleData['introduce'] = mb_substr($content, 0, 100);
|
|
$articleData['introduce'] = mb_substr($content, 0, 100);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if($articleData['status']==0){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>100,
|
|
|
|
+ 'title'=>$articleData['title'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>2,]);
|
|
|
|
+ }
|
|
$id = Article::where(['id' => $data['id']])->update($articleData);
|
|
$id = Article::where(['id' => $data['id']])->update($articleData);
|
|
$articleDataContent = [
|
|
$articleDataContent = [
|
|
'content' => $data['content'],
|
|
'content' => $data['content'],
|
|
@@ -753,6 +771,27 @@ class NewsService implements NewsServiceInterface
|
|
*/
|
|
*/
|
|
public function upArticleStatus(array $data): array
|
|
public function upArticleStatus(array $data): array
|
|
{
|
|
{
|
|
|
|
+ $articleData = Article::where(['id' => $data['id']])->first();
|
|
|
|
+ if($data['status']==1){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>101,
|
|
|
|
+ 'title'=>$articleData['title'],
|
|
|
|
+ 'content'=>'审核通过',
|
|
|
|
+ 'messageType'=>2,
|
|
|
|
+ 'user_id'=>$articleData['admin_user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ if($data['status']==2){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>101,
|
|
|
|
+ 'title'=>$articleData['title'],
|
|
|
|
+ 'content'=>'审核拒绝',
|
|
|
|
+ 'messageType'=>2,
|
|
|
|
+ 'user_id'=>$articleData['admin_user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
$result = Article::where(['id' => $data['id']])->update($data);
|
|
$result = Article::where(['id' => $data['id']])->update($data);
|
|
if (isset($data['ignore_ids']) && !empty($data['ignore_ids'])) {
|
|
if (isset($data['ignore_ids']) && !empty($data['ignore_ids'])) {
|
|
//article_ignore 表插入数据 db操作
|
|
//article_ignore 表插入数据 db操作
|
|
@@ -3622,8 +3661,14 @@ class NewsService implements NewsServiceInterface
|
|
$data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
|
|
$data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
|
|
// $data['description'] = substr(preg_replace('/\s+/', '', strip_tags($data['detail'])), 0, 100);
|
|
// $data['description'] = substr(preg_replace('/\s+/', '', strip_tags($data['detail'])), 0, 100);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ if($data['status']==1){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>200,
|
|
|
|
+ 'title'=>$data['name'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>3,
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
|
|
$result = Good::insert($data);
|
|
$result = Good::insert($data);
|
|
if (empty($result)) {
|
|
if (empty($result)) {
|
|
@@ -3669,7 +3714,14 @@ class NewsService implements NewsServiceInterface
|
|
$cleaned = preg_replace('/\s+/', '', strip_tags(html_entity_decode($data['detail'], ENT_QUOTES, 'UTF-8')));
|
|
$cleaned = preg_replace('/\s+/', '', strip_tags(html_entity_decode($data['detail'], ENT_QUOTES, 'UTF-8')));
|
|
$data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
|
|
$data['description'] = mb_substr($cleaned, 0, 100, 'UTF-8');
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ if($data['status']==1){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>200,
|
|
|
|
+ 'title'=>$data['name'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>3,
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
|
|
$result = Good::where('id', $data['id'])->update($data);
|
|
$result = Good::where('id', $data['id'])->update($data);
|
|
if (empty($result)) {
|
|
if (empty($result)) {
|
|
@@ -3954,6 +4006,12 @@ class NewsService implements NewsServiceInterface
|
|
$chat_ids = $user_id;
|
|
$chat_ids = $user_id;
|
|
$user_id = json_encode($user_id);
|
|
$user_id = json_encode($user_id);
|
|
$data['re_user_ids'] = $user_id;
|
|
$data['re_user_ids'] = $user_id;
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>700,
|
|
|
|
+ 'title'=>$data['title'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>5,
|
|
|
|
+ ]);
|
|
$result = Notice::insertGetId($data);
|
|
$result = Notice::insertGetId($data);
|
|
|
|
|
|
if (empty($result)) {
|
|
if (empty($result)) {
|
|
@@ -3984,6 +4042,12 @@ class NewsService implements NewsServiceInterface
|
|
$user_id = json_encode($user_id);
|
|
$user_id = json_encode($user_id);
|
|
$data['re_user_ids'] = $user_id;
|
|
$data['re_user_ids'] = $user_id;
|
|
$data['updated_at'] = date('Y-m-d H:i:s');
|
|
$data['updated_at'] = date('Y-m-d H:i:s');
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>700,
|
|
|
|
+ 'title'=>$data['title'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>5,
|
|
|
|
+ ]);
|
|
$result = Notice::where('id', $data['id'])->update($data);
|
|
$result = Notice::where('id', $data['id'])->update($data);
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
@@ -4177,6 +4241,12 @@ class NewsService implements NewsServiceInterface
|
|
date_default_timezone_set('Asia/Shanghai');
|
|
date_default_timezone_set('Asia/Shanghai');
|
|
$data['created_at'] = date('Y-m-d H:i:s');
|
|
$data['created_at'] = date('Y-m-d H:i:s');
|
|
$data['updated_at'] = date('Y-m-d H:i:s');
|
|
$data['updated_at'] = date('Y-m-d H:i:s');
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>800,
|
|
|
|
+ 'title'=>$data['title'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ ]);
|
|
$result = Complaint::create($data);
|
|
$result = Complaint::create($data);
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
@@ -4189,6 +4259,12 @@ class NewsService implements NewsServiceInterface
|
|
$type_id = $data['type_id'] ?? 0;
|
|
$type_id = $data['type_id'] ?? 0;
|
|
unset($data['user_id']);
|
|
unset($data['user_id']);
|
|
unset($data['type_id']);
|
|
unset($data['type_id']);
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>800,
|
|
|
|
+ 'title'=>$data['title'],
|
|
|
|
+ 'content'=>'提交了审核',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ ]);
|
|
$result = Complaint::where('id', $data['id'])->update($data);
|
|
$result = Complaint::where('id', $data['id'])->update($data);
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
@@ -4227,7 +4303,59 @@ class NewsService implements NewsServiceInterface
|
|
return Result::error("处理人错误", 0);
|
|
return Result::error("处理人错误", 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ $complaintInfo = Complaint::where('id', $data['id'])->first();
|
|
|
|
+ if($data['status']==2 && !isset($data['deal'])){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>801,
|
|
|
|
+ 'title'=>$complaintInfo['title'],
|
|
|
|
+ 'content'=>'审核通过',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ 'user_id'=>$complaintInfo['user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>802,
|
|
|
|
+ 'title'=>$complaintInfo['title'],
|
|
|
|
+ 'content'=>'待处理',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ 'user_id'=>$complaintInfo['re_user_ids'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ if($data['status']==3 && !isset($data['deal'])){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>801,
|
|
|
|
+ 'title'=>$complaintInfo['title'],
|
|
|
|
+ 'content'=>'审核拒绝',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ 'user_id'=>$complaintInfo['user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ if($data['status']==2 && isset($data['deal']) && $data['deal']==2){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>802,
|
|
|
|
+ 'title'=>$complaintInfo['title'],
|
|
|
|
+ 'content'=>'处理中',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ 'user_id'=>$complaintInfo['re_user_ids'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ if($data['status']==2 && isset($data['deal']) && $data['deal']==4){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>802,
|
|
|
|
+ 'title'=>$complaintInfo['title'],
|
|
|
|
+ 'content'=>'不予处理',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ 'user_id'=>$complaintInfo['re_user_ids'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ if($data['status']==2 && isset($data['deal']) && $data['deal']==3){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>802,
|
|
|
|
+ 'title'=>$complaintInfo['title'],
|
|
|
|
+ 'content'=>'已完结',
|
|
|
|
+ 'messageType'=>6,
|
|
|
|
+ 'user_id'=>$complaintInfo['re_user_ids'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
$result = complaint::where('id', $data['id'])->update($data);
|
|
$result = complaint::where('id', $data['id'])->update($data);
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
@@ -4237,7 +4365,25 @@ class NewsService implements NewsServiceInterface
|
|
$type_id = $data['type_id'] ?? 0;
|
|
$type_id = $data['type_id'] ?? 0;
|
|
unset($data['user_id']);
|
|
unset($data['user_id']);
|
|
unset($data['type_id']);
|
|
unset($data['type_id']);
|
|
-
|
|
|
|
|
|
+ $goodInfo = Good::where('id', $data['id'])->first();
|
|
|
|
+ if($data['status']==2){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>201,
|
|
|
|
+ 'title'=>$goodInfo['name'],
|
|
|
|
+ 'content'=>'审核通过',
|
|
|
|
+ 'messageType'=>3,
|
|
|
|
+ 'user_id'=>$goodInfo['user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ if($data['status']==3){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>201,
|
|
|
|
+ 'title'=>$goodInfo['name'],
|
|
|
|
+ 'content'=>'审核拒绝',
|
|
|
|
+ 'messageType'=>3,
|
|
|
|
+ 'user_id'=>$goodInfo['user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
$result = Good::where('id', $data['id'])->update($data);
|
|
$result = Good::where('id', $data['id'])->update($data);
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
@@ -4325,6 +4471,25 @@ class NewsService implements NewsServiceInterface
|
|
Notice::where(['id' => $data['id']])->update($data);
|
|
Notice::where(['id' => $data['id']])->update($data);
|
|
}
|
|
}
|
|
$result = Notice::where('id', $data['id'])->update($data);
|
|
$result = Notice::where('id', $data['id'])->update($data);
|
|
|
|
+ $noticeInfo = Notice::where('id', $data['id'])->first();
|
|
|
|
+ if($data['status']==2){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>701,
|
|
|
|
+ 'title'=>$noticeInfo['title'],
|
|
|
|
+ 'content'=>'审核通过',
|
|
|
|
+ 'messageType'=>3,
|
|
|
|
+ 'user_id'=>$noticeInfo['user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+ if($data['status']==3){
|
|
|
|
+ $this->sendMessage([
|
|
|
|
+ 'talk_type'=>701,
|
|
|
|
+ 'title'=>$noticeInfo['title'],
|
|
|
|
+ 'content'=>'审核拒绝',
|
|
|
|
+ 'messageType'=>3,
|
|
|
|
+ 'user_id'=>$noticeInfo['user_id'],
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
public function getDUser(array $data): array
|
|
public function getDUser(array $data): array
|
|
@@ -7089,4 +7254,22 @@ class NewsService implements NewsServiceInterface
|
|
|
|
|
|
return Result::success($result);
|
|
return Result::success($result);
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * 发送消息
|
|
|
|
+ * @param array $messageData
|
|
|
|
+ * @return void
|
|
|
|
+ */
|
|
|
|
+ public function sendMessage($messageData){
|
|
|
|
+ $msg =[
|
|
|
|
+ 'talk_type'=>$messageData['talk_type'],
|
|
|
|
+ 'title'=>$messageData['title'],
|
|
|
|
+ 'content'=>$messageData['content'],
|
|
|
|
+ 'messageType'=>$messageData['messageType'],
|
|
|
|
+ 'user_id'=>$messageData['user_id']??'',
|
|
|
|
+ ];
|
|
|
|
+ $message = new MqProducer($msg);
|
|
|
|
+ $producer = ContextApplicationContext::getContainer()->get(Producer::class);
|
|
|
|
+ $producer->produce($message);
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|