FengR 6 дней назад
Родитель
Сommit
67075e82b5

+ 8 - 8
.env

@@ -2,9 +2,9 @@ APP_NAME=public_producer
 APP_ENV=dev
 APP_ENV=dev
 
 
 DB_DRIVER=mysql
 DB_DRIVER=mysql
-DB_HOST=192.168.1.234
+DB_HOST=192.168.1.123
 DB_PORT=13306
 DB_PORT=13306
-DB_DATABASE=hyperf
+DB_DATABASE=zxt
 DB_USERNAME=root
 DB_USERNAME=root
 DB_PASSWORD=zxt_mysql_dev
 DB_PASSWORD=zxt_mysql_dev
 DB_CHARSET=utf8mb4
 DB_CHARSET=utf8mb4
@@ -12,7 +12,7 @@ DB_COLLATION=utf8mb4_unicode_ci
 DB_PREFIX=
 DB_PREFIX=
 
 
 DB_DRIVER2=mysql
 DB_DRIVER2=mysql
-DB_HOST2=192.168.1.234
+DB_HOST2=192.168.1.123
 DB_PORT2=13306
 DB_PORT2=13306
 DB_DATABASE2=collector
 DB_DATABASE2=collector
 DB_USERNAME2=root
 DB_USERNAME2=root
@@ -22,7 +22,7 @@ DB_COLLATION2=utf8mb4_unicode_ci
 DB_PREFIX2=col_
 DB_PREFIX2=col_
 
 
 DB_DRIVER3=mysql
 DB_DRIVER3=mysql
-DB_HOST3=192.168.1.234
+DB_HOST3=192.168.1.123
 DB_PORT3=13306
 DB_PORT3=13306
 DB_DATABASE3=global
 DB_DATABASE3=global
 DB_USERNAME3=root
 DB_USERNAME3=root
@@ -32,7 +32,7 @@ DB_COLLATION3=utf8mb4_unicode_ci
 DB_PREFIX3=
 DB_PREFIX3=
 
 
 DB_DRIVER4=mysql
 DB_DRIVER4=mysql
-DB_HOST4=192.168.1.234
+DB_HOST4=192.168.1.123
 DB_PORT4=13306
 DB_PORT4=13306
 DB_DATABASE4=imp
 DB_DATABASE4=imp
 DB_USERNAME4=root
 DB_USERNAME4=root
@@ -52,7 +52,7 @@ DB_PREFIX4=
 # REDIS_PORT=6379
 # REDIS_PORT=6379
 # REDIS_DB=0
 # REDIS_DB=0
 
 
-REDIS_HOST=192.168.1.234
+REDIS_HOST=192.168.1.123
 REDIS_AUTH=zxt_redis_dev
 REDIS_AUTH=zxt_redis_dev
 REDIS_PORT=26739
 REDIS_PORT=26739
 REDIS_PASSWORD=zxt_redis_dev
 REDIS_PASSWORD=zxt_redis_dev
@@ -60,13 +60,13 @@ REDIS_DB=0
 
 
 
 
 
 
-AMQP_HOST=192.168.1.234
+AMQP_HOST=192.168.1.123
 AMQP_PORT=5672
 AMQP_PORT=5672
 AMQP_USER=rabbitmq
 AMQP_USER=rabbitmq
 AMQP_PASSWORD=zxt_mq_dev
 AMQP_PASSWORD=zxt_mq_dev
 
 
 
 
-OSS_ENDPOINT =http://img.bjzxtw.org.cn
+OSS_ENDPOINT =http://192.168.1.234:19000
 OSS_KEY = xoycEr5qezRF91xITN6i
 OSS_KEY = xoycEr5qezRF91xITN6i
 OSS_SECRET = IYVyqYZxCCxQD5YnRsayzzNORBqwAPfhQlHP1Glw
 OSS_SECRET = IYVyqYZxCCxQD5YnRsayzzNORBqwAPfhQlHP1Glw
 BUCKET=pre
 BUCKET=pre

+ 1 - 1
app/JsonRpc/AdService.php

@@ -398,7 +398,7 @@ class AdService implements AdServiceInterface
                         [ 'ad_tag'=>$val['ad_tag'],'website_id'=>$val['website_id']],
                         [ 'ad_tag'=>$val['ad_tag'],'website_id'=>$val['website_id']],
                         [
                         [
                             'website_id'=>$val['website_id'],
                             'website_id'=>$val['website_id'],
-                            'typeid'=>$val['typeid'],
+                            'typeid'=>$val['typeid'] ?? 2,
                             'status'=>1,
                             'status'=>1,
                             'name'=>$val['name']??'',
                             'name'=>$val['name']??'',
                             'thumb'=>$val['thumb']??'',
                             'thumb'=>$val['thumb']??'',

+ 195 - 1
app/JsonRpc/NewsService.php

@@ -80,6 +80,7 @@ use App\Model\GroupImp;
 use App\Model\GroupTalkImp;
 use App\Model\GroupTalkImp;
 use App\Model\GroupTalkMessagerImp;
 use App\Model\GroupTalkMessagerImp;
 use App\Model\ArticleIgnore;
 use App\Model\ArticleIgnore;
+use App\Model\Message;
 
 
 #[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
@@ -8899,4 +8900,197 @@ class NewsService implements NewsServiceInterface
     }
     }
     return Result::success($result);
     return Result::success($result);
   }
   }
-}
+  /**
+   * 网民留言-添加
+   * @param array $data
+   * @return array
+   */
+  public function addMessage(array $data): array
+  {
+    $user = User::where('id', $data['user_id'])->first();
+    if (empty($user)) {
+      return Result::error('用户不存在');
+    }
+    if($user['type_id'] == 10000){
+      $data['status'] = 1;
+    }else{
+      $data['status'] = 0;
+    }
+    if ($data['keyword'] == '') {
+      //提取标题+内容中的关键词
+      $data['keyword'] = $data['title'];
+      //  . substr(str_replace(' ', '', strip_tags($data['content'])), 0, 20);
+      Jieba::init(); // 初始化 jieba-php
+      Finalseg::init();
+      $segList = Jieba::cut($data['keyword']);
+      $segList1 = array_slice($segList, 0, 8);
+      $data['keyword'] = implode(',', $segList1);
+    }
+    if ($data['description'] == '') {
+      //提取内容中的描述
+      $content = $data['content'];
+      // 去除 <style> 和 <script> 标签及其内容
+      $content = preg_replace('/<(style|script)[^>]*>.*?<\/\1>/is', '', $content);
+      // 去除所有 HTML 标签
+      $content = strip_tags($content);
+      // 去除 HTML 实体
+      $content = html_entity_decode($content, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+      // 只保留文本和标点符号(去除所有字母数字以外的特殊符号,可根据需要调整正则)
+      $content = preg_replace('/[^\p{L}\p{N}\p{P}\p{Zs}]+/u', '', $content);
+      // 去除多余空白
+      $content = preg_replace('/\s+/u', '', $content);
+      // 截取 100 个字符
+      $data['description'] = mb_substr($content, 0, 100);
+    }
+    if(!empty($data['reply'])){
+      $data['reply_userid'] = $data['user_id'];
+    }
+    $result = Message::insertGetId($data);
+    if(empty($result)){
+        return Result::error('添加失败');
+    }
+    return Result::success($result);
+  }
+  /**
+   * 网民留言-更新
+   * @param array $data
+   * @return array
+   */
+  public function upMessage(array $data): array
+  {
+    $user = User::where('id', $data['user_id'])->first();
+    if (empty($user)) {
+      return Result::error('用户不存在');
+    }
+    if($user['type_id'] == 10000){
+      $data['status'] = 1;
+    }
+    $message = Message::where('id', $data['id'])->first();
+    if (empty($message)) {
+      return Result::error('留言不存在');
+    }
+    if($data['user_id'] != $message['user_id']){
+        return Result::error('非留言人不能更新');
+      }
+    if ($data['keyword'] == '') {
+      //提取标题+内容中的关键词
+      $data['keyword'] = $data['title'];
+      //  . substr(str_replace(' ', '', strip_tags($data['content'])), 0, 20);
+      Jieba::init(); // 初始化 jieba-php
+      Finalseg::init();
+      $segList = Jieba::cut($data['keyword']);
+      $segList1 = array_slice($segList, 0, 8);
+      $data['keyword'] = implode(',', $segList1);
+    }
+    if ($data['description'] == '') {
+      //提取内容中的描述
+      $content = $data['content'];
+      // 去除 <style> 和 <script> 标签及其内容
+      $content = preg_replace('/<(style|script)[^>]*>.*?<\/\1>/is', '', $content);
+      // 去除所有 HTML 标签
+      $content = strip_tags($content);
+      // 去除 HTML 实体
+      $content = html_entity_decode($content, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+      // 只保留文本和标点符号(去除所有字母数字以外的特殊符号,可根据需要调整正则)
+      $content = preg_replace('/[^\p{L}\p{N}\p{P}\p{Zs}]+/u', '', $content);
+      // 去除多余空白
+      $content = preg_replace('/\s+/u', '', $content);
+      // 截取 100 个字符
+      $data['description'] = mb_substr($content, 0, 100);
+    }
+    unset($data['id']);
+    if(!empty($data['reply'])){
+      $data['reply_userid'] = $data['user_id'];
+    }
+    $result = Message::where('id', $message['id'])->update($data);
+    if (empty($result)) {
+      return Result::error('更新失败');
+    }
+    return Result::success($result);
+  }
+  /**
+   * 网民留言-删除
+   * @param array $data
+   * @return array
+   */
+  public function delMessage(array $data): array
+  {
+    $result = Message::where('id', $data['id'])->delete();
+    if (empty($result)) {
+      return Result::error('删除失败');
+    }
+    return Result::success($result);
+  }
+  /**
+   * 网民留言-更新状态
+   * @param array $data
+   * @return array
+   */
+  public function upMessageStatus(array $data): array
+  {
+    $message = Message::where('id', $data['id'])->first();
+    if (empty($message)) {
+      return Result::error('留言不存在!');
+    }
+    unset($data['id']);
+    if($data['status'] != 2){
+      $data['reason'] = null;
+    }
+    $result = Message::where('id', $message['id'])->update($data);
+    if (empty($result)) {
+      return Result::error('留言更新失败!');
+    }
+    return Result::success($result);
+  }
+  /**
+   * 网民留言-获取详情
+   * @param array $data
+   * @return array
+   */
+  public function getMessageInfo(array $data): array
+  {
+    $result = Message::where('id', $data['id'])->first();
+    if (empty($result)) {
+      return Result::error('留言不存在!');
+    }
+    return Result::success($result);
+  }
+  /**
+   * 网民留言-获取列表
+   * @param array $data
+   * @return array
+   */
+  public function getMessageList(array $data): array
+  {
+    $where = [];
+    if($data['is_master'] == 1){
+      $where['status'] = 1;
+    }
+    $user = User::where('id', $data['user_id'])->first();
+    if (empty($user)) {
+      return Result::error('用户不存在');
+    }
+    if($user['type_id'] != 10000){
+      $where['user_id'] = $data['user_id'];
+    }
+    if(!empty($data['title'])){
+      array_push($where, ['title', 'like', '%'.$data['title'].'%']);
+    }
+    $result = Message::when($data['is_master'] == 0, function ($query) {
+        $query->whereIn('status', [0, 2]);
+      })
+      ->when(!empty($where), function ($query) use ($where) {
+        $query->where($where);
+      })
+      ->orderBy('updated_at', 'desc')
+      ->paginate($data['page_size'], ['*'], 'page', $data['page']);
+    if(empty($result)) {
+      return Result::error('留言不存在!');
+    }
+    $result = [
+      'data' => $result->items(),
+      'count' => $result->total(),
+    ];
+    return Result::success($result);
+  }
+}

+ 30 - 0
app/JsonRpc/NewsServiceInterface.php

@@ -369,4 +369,34 @@ interface NewsServiceInterface
      * @return array
      * @return array
      */
      */
     public function delJobPosition(array $data):array;
     public function delJobPosition(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function addMessage(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function upMessage(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function delMessage(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function upMessageStatus(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getMessageInfo(array $data):array;
+    /**
+     * @param array $data
+     * @return array
+     */
+    public function getMessageList(array $data):array;
 }
 }

+ 93 - 45
app/JsonRpc/PublicRpcService.php

@@ -3988,7 +3988,9 @@ class PublicRpcService implements PublicRpcServiceInterface
 
 
         // 将模型对象转换为数组,确保关系字段正确命名
         // 将模型对象转换为数组,确保关系字段正确命名
         $sectors = $sectors->toArray();
         $sectors = $sectors->toArray();
-
+        if(empty($sectors)){
+            return '此网站没有 通栏!';
+        }
         // 提取并返回 component_imgs 内容,添加空安全检查
         // 提取并返回 component_imgs 内容,添加空安全检查
         // return $sectors[0]['sector_components'][0]['component']['component_imgs'] ?? [];
         // return $sectors[0]['sector_components'][0]['component']['component_imgs'] ?? [];
         // return $sectors;
         // return $sectors;
@@ -4005,12 +4007,6 @@ class PublicRpcService implements PublicRpcServiceInterface
         $websiteServer = new \App\JsonRpc\WebsiteService();
         $websiteServer = new \App\JsonRpc\WebsiteService();
         $all_cate_data = $websiteServer->getWebsiteModelCategory($cat_column);
         $all_cate_data = $websiteServer->getWebsiteModelCategory($cat_column);
         $all_cate = $all_cate_data['data'] ?? [];
         $all_cate = $all_cate_data['data'] ?? [];
-
-        // $all_cate = $query->where('is_show', 1)
-        //     // ->where('pid', 0)
-        //     ->orderBy('sort')
-        //     ->orderBy('updated_at', 'desc')
-        //     ->get()->toArray();
         $cate_num = count($all_cate);
         $cate_num = count($all_cate);
         // return $all_cate;
         // return $all_cate;
         if ($cate_num < 5) {
         if ($cate_num < 5) {
@@ -4019,7 +4015,6 @@ class PublicRpcService implements PublicRpcServiceInterface
         $all_cate = $all_cate->toArray();
         $all_cate = $all_cate->toArray();
         $del_catid = 0;
         $del_catid = 0;
         foreach ($all_cate as $k => $v) {
         foreach ($all_cate as $k => $v) {
-            $cat_arr_id = json_decode($v['category_arr_id'], true) ?? [];
             if (!empty($v['web_url']) || $v['type'] != 1 || $v['pid'] == $del_catid) {
             if (!empty($v['web_url']) || $v['type'] != 1 || $v['pid'] == $del_catid) {
                 $del_catid = $v['category_id'] ?? '';
                 $del_catid = $v['category_id'] ?? '';
                 unset($all_cate[$k]);
                 unset($all_cate[$k]);
@@ -4027,12 +4022,17 @@ class PublicRpcService implements PublicRpcServiceInterface
         }
         }
         $all_cate = array_values($all_cate);
         $all_cate = array_values($all_cate);
         $cate_num = min($cate_num, 24);
         $cate_num = min($cate_num, 24);
-        $all_sector_type = array_column($sectors, 'sector_type');
+        if(isset($sectors[0]['sector_type'])){
+            $all_sector_type = array_column($sectors, 'sector_type');
+        }else{
+            return '此网站没有 通栏类型!';
+        }
         // return $all_cate;
         // return $all_cate;
         $grouped = array_reduce(array_keys($sectors), function ($carry, $idx) use ($sectors) {
         $grouped = array_reduce(array_keys($sectors), function ($carry, $idx) use ($sectors) {
             $carry[$sectors[$idx]['sector_type']][] = $idx;
             $carry[$sectors[$idx]['sector_type']][] = $idx;
             return $carry;
             return $carry;
         }, []);
         }, []);
+        // 以通栏分类为索引 随机取一个通栏索引作为其值
         $unipue_sector_keys = array_combine(
         $unipue_sector_keys = array_combine(
             array_keys($grouped),
             array_keys($grouped),
             array_map(function ($type) use ($grouped) {
             array_map(function ($type) use ($grouped) {
@@ -4048,6 +4048,7 @@ class PublicRpcService implements PublicRpcServiceInterface
         $rule_must_type = $rule->must_type;
         $rule_must_type = $rule->must_type;
         $sector_num = $rule->max_num;
         $sector_num = $rule->max_num;
         $unique_sector_type = array_flip($unipue_sector_keys);
         $unique_sector_type = array_flip($unipue_sector_keys);
+        //      必须通栏的类型
         $must_type = array_unique(array_intersect($unique_sector_type, $rule_must_type));
         $must_type = array_unique(array_intersect($unique_sector_type, $rule_must_type));
         //      先求交集,去重后统计
         //      先求交集,去重后统计
         $is_must = count($must_type);
         $is_must = count($must_type);
@@ -4070,6 +4071,7 @@ class PublicRpcService implements PublicRpcServiceInterface
 
 
 
 
         // 2.非必须通栏的随机处理
         // 2.非必须通栏的随机处理
+        //      非必需通栏的类型
         $not_must_type = array_unique(array_diff($unique_sector_type, $must_type));
         $not_must_type = array_unique(array_diff($unique_sector_type, $must_type));
         $total = count($not_must_type);
         $total = count($not_must_type);
         $randomCount = mt_rand(0, $total); // 可能为0(无元素)或任意数量,最多等于数组长度
         $randomCount = mt_rand(0, $total); // 可能为0(无元素)或任意数量,最多等于数组长度
@@ -4088,7 +4090,7 @@ class PublicRpcService implements PublicRpcServiceInterface
             $random_sector = array_values(array_intersect_key($sectors, array_flip($randomKeys)));
             $random_sector = array_values(array_intersect_key($sectors, array_flip($randomKeys)));
             $rand_count = count($random_sector);
             $rand_count = count($random_sector);
         }
         }
-        if ($page == 1) {
+        if ($page == 1 && $rand_count > 0) {
             $random_cat_num = array_sum(array_column($random_sector, 'cat_num'));
             $random_cat_num = array_sum(array_column($random_sector, 'cat_num'));
             $random_cat_num += $must_cat_num;
             $random_cat_num += $must_cat_num;
             if ($random_cat_num > $cate_num) {
             if ($random_cat_num > $cate_num) {
@@ -4099,13 +4101,15 @@ class PublicRpcService implements PublicRpcServiceInterface
         // 3.计算随机之后减去必需的通栏,查询重复通栏可用数量;(目前的这些通栏没有重复的同类别通栏)
         // 3.计算随机之后减去必需的通栏,查询重复通栏可用数量;(目前的这些通栏没有重复的同类别通栏)
         $repeat_num = $sector_num - $rand_count - $must_count;
         $repeat_num = $sector_num - $rand_count - $must_count;
         // 组合起来通栏
         // 组合起来通栏
-        $sector_zuhe1 = array_merge($must_sector, $random_sector);
+        if($rand_count > 0){
+            $sector_zuhe1 = array_merge($must_sector, $random_sector);
+        }else{
+            $sector_zuhe1 = $must_sector;
+        }
         $sector_zuhe1_type = array_column($sector_zuhe1, 'sector_type');
         $sector_zuhe1_type = array_column($sector_zuhe1, 'sector_type');
         $sector_ids = array_column($sector_zuhe1, 'id');
         $sector_ids = array_column($sector_zuhe1, 'id');
         if ($repeat_num > 0) {
         if ($repeat_num > 0) {
             $rule_repeat = (array)$rule->type_max;
             $rule_repeat = (array)$rule->type_max;
-            $sector_zuhe1_type = array_count_values(array_column($sector_zuhe1, 'sector_type'));
-            // $sector_arr = array_intersect_key($rule_repeat,$sector_zuhe1_type);
             foreach ($rule_repeat as $key => $value) {
             foreach ($rule_repeat as $key => $value) {
                 if (in_array($key, array_keys($sector_zuhe1_type))) {
                 if (in_array($key, array_keys($sector_zuhe1_type))) {
                     $rule_repeat[$key] = $value - 1;
                     $rule_repeat[$key] = $value - 1;
@@ -4125,7 +4129,7 @@ class PublicRpcService implements PublicRpcServiceInterface
             $max_iterations = 10;
             $max_iterations = 10;
             $iteration_count = 0;
             $iteration_count = 0;
             // 剩余的栏目数量
             // 剩余的栏目数量
-            if ($page == 1) {
+            if ($page == 1 && $rand_count > 0) {
                 $sector_cate_comnum = $cate_num - $random_cat_num;
                 $sector_cate_comnum = $cate_num - $random_cat_num;
                 if ($sector_cate_comnum < 0) {
                 if ($sector_cate_comnum < 0) {
                     return '栏目数量过少,无法完成随机!';
                     return '栏目数量过少,无法完成随机!';
@@ -4135,15 +4139,11 @@ class PublicRpcService implements PublicRpcServiceInterface
             // -----新添加的代码-----
             // -----新添加的代码-----
             $re_sector = array_intersect($all_sector_type, $repeat_type);
             $re_sector = array_intersect($all_sector_type, $repeat_type);
             $re_sector_key = array_keys($re_sector);
             $re_sector_key = array_keys($re_sector);
-            $every_repeattype_num = array_count_values($re_sector);
+            $every_repeattype_num = count($re_sector);
+
             // $re_sector_key = array_keys($re_sector,1);
             // $re_sector_key = array_keys($re_sector,1);
             $repaet_key = 0;
             $repaet_key = 0;
             $re_type_keys = [];
             $re_type_keys = [];
-
-
-            $one_sector_key = array_search(1, $re_sector);
-            $two_sector_key = array_search(2, $re_sector);
-            $three_sector_key = array_search(3, $re_sector);
             $all_cat_num = array_column($sectors, 'cat_num');
             $all_cat_num = array_column($sectors, 'cat_num');
             $repeat_sector_key = [];
             $repeat_sector_key = [];
             // $rule_repeat['1'] = 1;
             // $rule_repeat['1'] = 1;
@@ -4162,7 +4162,7 @@ class PublicRpcService implements PublicRpcServiceInterface
                             $re_type_keys[$value] = [];
                             $re_type_keys[$value] = [];
                         }
                         }
                         // 剩余的通栏数量>0  并且 剩余的此类通栏数量>0
                         // 剩余的通栏数量>0  并且 剩余的此类通栏数量>0
-                        if ($repeat_num - $repaet_key > 0 && $rule_repeat[$type_key] - count($re_type_keys[$value]) > 0 && ($page != 1 || (isset($sector_cate_comnum) && $sector_cate_comnum > 3))) {
+                        if ($repeat_num - $repaet_key > 0 && $rule_repeat[$type_key] - count($re_type_keys[$value])-1 > 0 && ($page != 1 || (isset($sector_cate_comnum) && $sector_cate_comnum > 3))) {
                             // var_dump("0000",array_keys($re_sector,$value));
                             // var_dump("0000",array_keys($re_sector,$value));
                             $one_sector_type = array_keys($re_sector, $value);
                             $one_sector_type = array_keys($re_sector, $value);
                             // 若是此类通栏的数量>1  则随机取一个对应的键值
                             // 若是此类通栏的数量>1  则随机取一个对应的键值
@@ -4232,12 +4232,15 @@ class PublicRpcService implements PublicRpcServiceInterface
                     $sector[$toutiao_key] = $sort_1;
                     $sector[$toutiao_key] = $sort_1;
                     $sector[1] = $pic;
                     $sector[1] = $pic;
                     $sector[$pic_key] = $sort_2;
                     $sector[$pic_key] = $sort_2;
+                    $place_count = 2;
                 } else if ($pic_key) {
                 } else if ($pic_key) {
                     $sector[0] = $pic;
                     $sector[0] = $pic;
                     $sector[$pic_key] = $sort_1;
                     $sector[$pic_key] = $sort_1;
+                    $place_count = 1;
                 } else {
                 } else {
                     $sector[0] = $toutiao;
                     $sector[0] = $toutiao;
                     $sector[$toutiao_key] = $sort_1;
                     $sector[$toutiao_key] = $sort_1;
+                    $place_count = 1;
                 }
                 }
             }
             }
             if ($data['page'] == '2' || $data['page'] == 2 || in_array(5, $sector_specal_sort)) {
             if ($data['page'] == '2' || $data['page'] == 2 || in_array(5, $sector_specal_sort)) {
@@ -4248,21 +4251,66 @@ class PublicRpcService implements PublicRpcServiceInterface
                     $sector[$toutiao_key] = $sort_2;
                     $sector[$toutiao_key] = $sort_2;
                     $sector[2] = $pic;
                     $sector[2] = $pic;
                     $sector[$pic_key] = $sort_3;
                     $sector[$pic_key] = $sort_3;
+                    $place_count = 2;
                 } else if ($pic_key) {
                 } else if ($pic_key) {
                     $sector[1] = $pic;
                     $sector[1] = $pic;
                     $sector[$pic_key] = $sort_2;
                     $sector[$pic_key] = $sort_2;
+                    $place_count = 1;
                 } else if ($toutiao_key) {
                 } else if ($toutiao_key) {
                     $sector[1] = $toutiao;
                     $sector[1] = $toutiao;
                     $sector[$toutiao_key] = $sort_2;
                     $sector[$toutiao_key] = $sort_2;
+                    $place_count = 1;
+                }
+            }
+        }
+        //涉及广告的位置及数量处理
+        // 提取所有 sector_type 值
+        $sector_finsh_type = array_column($sector, 'sector_type');
+        // 统计值为 2 的数量
+        // 使用 array_filter 过滤出值为 2 的元素,再用 count 计算数量
+        $count_type_2 = count(array_filter($sector_finsh_type, fn($v) => $v == 2));
+        $count_not_type_2 = count($sector_finsh_type) - $count_type_2;
+        // 查找所有值为 2 的键名(可能多个)
+        $type_2_keys = array_keys($sector_finsh_type, 2);
+        $ad_sector = $sector[$type_2_keys[0]];
+        foreach ($type_2_keys as $k => $v) {
+            unset($sector[$v]);
+        }
+        $all_sector = [];
+        $idx = 0;
+        $ad = 0;
+        // return $rule;
+        // 将 $rule->type_max 转为数组后再取值,避免把 stdClass 当数组用
+        $typeMax = (array)($rule->type_max ?? []);
+
+        $rull_adtype = $typeMax[2] ?? 0;
+        $sector_num = count($sector);
+        $sectorMax = $rule->max_num ?? [];
+        foreach ($sector as $key => $value) {
+            // 若是 6、7 直接放入
+            if (in_array($value['sector_type'], [6, 7])) {
+                $all_sector[$idx++] = $value;
+            } else {
+                // 其余通栏:隔一个加一个广告通栏
+                if ($idx % 2 == 1 && isset($ad_sector) && $ad < $rull_adtype && $sector_num < $sectorMax) {
+                    $all_sector[$idx++] = $ad_sector;
+                    $sector_num++;
+                    $ad++;
                 }
                 }
+                $all_sector[$idx++] = $value;
+            }
+            if(empty($sector) && in_array(2, $rule_must_type)){
+                $all_sector[0] = $ad_sector;
             }
             }
         }
         }
+        // -------------未完待续-----------------
+
         $sector_id = array_column($sector, 'id');
         $sector_id = array_column($sector, 'id');
         $y_num = 0;
         $y_num = 0;
         $cat_key = 0;
         $cat_key = 0;
         $ad_key = 0;
         $ad_key = 0;
-        // return $sector_id;
-        foreach ($sector as $key => $value) {
+        // return $all_sector;
+        foreach ($all_sector as $key => $value) {
             // array_push($value['sort_id'],$key);
             // array_push($value['sort_id'],$key);
             // $sector_id_ = $value['sector_id'];
             // $sector_id_ = $value['sector_id'];
             $sectorid = $value['id'];
             $sectorid = $value['id'];
@@ -4303,17 +4351,32 @@ class PublicRpcService implements PublicRpcServiceInterface
                 $component_data = json_decode($value['sector_components'][$i]['component']['component_data'] ?? '[]', true) ?? [];
                 $component_data = json_decode($value['sector_components'][$i]['component']['component_data'] ?? '[]', true) ?? [];
                 $list_type = json_decode($value['sector_components'][$i]['component']['component_column'] ?? '[]', true) ?? [];
                 $list_type = json_decode($value['sector_components'][$i]['component']['component_column'] ?? '[]', true) ?? [];
                 if (!empty($component_data) && !empty($list_type)) {
                 if (!empty($component_data) && !empty($list_type)) {
-                    $componentData = $component_data['componentData'];
+                    if (in_array($component_type, [23, 24])) {
+                        $componentData[0] = $component_data['componentData'];
+                        $componentData[1] = $component_data['componentData'];
+                    }else{
+                        $componentData = $component_data['componentData'];
+                    }
                     if ($component_type != 10) {
                     if ($component_type != 10) {
-                        $componentData['listType'] = $list_type['listType'];
+                        if (in_array($component_type, [23, 24])) {
+                            $componentData[0]['listType'] = $list_type['listType'];
+                            $componentData[1]['listType'] = $list_type['listType'];
+                        }else{
+                            $componentData['listType'] = $list_type['listType'];
+                        }
                     }
                     }
                 }
                 }
                 if (in_array($component_type, [7, 14, 15, 23, 24]) && ($page == 1 || $page == 2)) {
                 if (in_array($component_type, [7, 14, 15, 23, 24]) && ($page == 1 || $page == 2)) {
                     if ($page == 1) {
                     if ($page == 1) {
                         if(!empty($all_cate[$cat_key]['real_category_arr_id'])){
                         if(!empty($all_cate[$cat_key]['real_category_arr_id'])){
-                            $cat_arr[$cat_key] = $all_cate[$cat_key]['real_category_arr_id'];
+                            $cat_arr[$cat_key] = json_decode($all_cate[$cat_key]['real_category_arr_id'],true);
+                        }else{
+                            $cat_arr[$cat_key] = json_decode($all_cate[$cat_key]['category_arr_id'],true);
+                        }
+                        if(!empty($all_cate[$cat_key+1]['real_category_arr_id'])){
+                            $cat_arr[$cat_key+1] = json_decode($all_cate[$cat_key+1]['real_category_arr_id'],true);
                         }else{
                         }else{
-                            $cat_arr[$cat_key] = $all_cate[$cat_key]['category_arr_id'];
+                            $cat_arr[$cat_key+1] = json_decode($all_cate[$cat_key+1]['category_arr_id'],true);
                         }
                         }
                         if (in_array($component_type, [23, 24])) {
                         if (in_array($component_type, [23, 24])) {
                             $componentData[0]['name'] = $all_cate[$cat_key]['alias'];
                             $componentData[0]['name'] = $all_cate[$cat_key]['alias'];
@@ -4325,11 +4388,8 @@ class PublicRpcService implements PublicRpcServiceInterface
                             $cat_key += 2;
                             $cat_key += 2;
                         } else {
                         } else {
                             $componentData['name'] = $all_cate[$cat_key]['alias'];
                             $componentData['name'] = $all_cate[$cat_key]['alias'];
-                            if(!empty($all_cate[$cat_key]['category_arr_id'])){
-                                $componentData['category_arr'] = $all_cate[$cat_key]['real_category_arr_id'];
-                            }else{
-                                $componentData['category_arr'] = $all_cate[$cat_key]['category_arr_id'];
-                            }
+                            $componentData['category_arr'] = $cat_arr[$cat_key];
+                            $componentData['category_id'] = $all_cate[$cat_key]['category_id'];
                             $cat_key++;
                             $cat_key++;
                         }
                         }
                     }
                     }
@@ -4354,7 +4414,7 @@ class PublicRpcService implements PublicRpcServiceInterface
                         $ad = $ad_data;
                         $ad = $ad_data;
                     }
                     }
                     $template_data[$key]['ad'] = $ad;
                     $template_data[$key]['ad'] = $ad;
-                    $canvas_data[$key]['ad'] = $ad;
+                    $canvas_data[$key]['content']['ad'] = $ad;
                 }
                 }
                 $sector_component[$i] = [
                 $sector_component[$i] = [
                     'component_type' => $value['sector_components'][$i]['component']['component_type'],
                     'component_type' => $value['sector_components'][$i]['component']['component_type'],
@@ -4367,12 +4427,6 @@ class PublicRpcService implements PublicRpcServiceInterface
                     // 'type_id' => $value['sector_components'][$i]['component']['type_id'],
                     // 'type_id' => $value['sector_components'][$i]['component']['type_id'],
                 ];
                 ];
             }
             }
-
-            // $sector_key[$key] = array_keys($value );
-            // $sector_component = [
-            //    'component_type' $value['sector_components'];
-
-            // ];
             $template_data[$key]['componentList'] = $sector_component;
             $template_data[$key]['componentList'] = $sector_component;
             $canvas_data[$key]['content']['componentList'] = $sector_component;
             $canvas_data[$key]['content']['componentList'] = $sector_component;
             // $canvas_data[$key]['ad'] = $key;
             // $canvas_data[$key]['ad'] = $key;
@@ -4380,17 +4434,11 @@ class PublicRpcService implements PublicRpcServiceInterface
             $canvas_data[$key]['moved'] = false;
             $canvas_data[$key]['moved'] = false;
             // $page['template'][$key][$sector_key]['componentData'] = $result[$sectorId];
             // $page['template'][$key][$sector_key]['componentData'] = $result[$sectorId];
         }
         }
-        // return $canvas_data;
         $datas['component'][0] = [
         $datas['component'][0] = [
             'template_data' => $template_data,
             'template_data' => $template_data,
             'canvas_data' => $canvas_data,
             'canvas_data' => $canvas_data,
         ];
         ];
         return $datas;
         return $datas;
-
-        // return [
-        //     'all_sector'=> array_column($sectors,'sector_name'),
-        //     'sector'=> array_column($sector,'sector_name'),
-        // ];
     }
     }
 
 
 
 

+ 36 - 36
app/JsonRpc/WebsiteService.php

@@ -76,26 +76,26 @@ class WebsiteService implements WebsiteServiceInterface
         // 构建查询
         // 构建查询
         $query = Website::when($data, function ($query) use ($data) {
         $query = Website::when($data, function ($query) use ($data) {
             if (isset($data['keyword']) && !empty($data['keyword'])) {
             if (isset($data['keyword']) && !empty($data['keyword'])) {
-                $query->where('zxt_website.website_name', 'like', '%' . trim($data['keyword']) . '%');
+                $query->where('website.website_name', 'like', '%' . trim($data['keyword']) . '%');
             }
             }
             if (isset($data['website_column_id']) && !empty($data['website_column_id'])) {
             if (isset($data['website_column_id']) && !empty($data['website_column_id'])) {
-                $query->whereJsonContains("zxt_website.website_column_arr_id", intval($data['website_column_id']));
+                $query->whereJsonContains("website.website_column_arr_id", intval($data['website_column_id']));
             }
             }
             if (isset($data['web_type']) && !empty($data['web_type'])) {
             if (isset($data['web_type']) && !empty($data['web_type'])) {
-                $query->where('zxt_website.web_type', intval($data['web_type']));
+                $query->where('website.web_type', intval($data['web_type']));
             }
             }
             if (isset($data['is_core']) && !empty($data['is_core'])) {
             if (isset($data['is_core']) && !empty($data['is_core'])) {
-                $query->where('zxt_website.is_core', intval($data['is_core']));
+                $query->where('website.is_core', intval($data['is_core']));
             }
             }
         });
         });
 
 
         $column_name = WebsiteColumn::pluck('column_name', 'id')->all();
         $column_name = WebsiteColumn::pluck('column_name', 'id')->all();
-        $queryWithJoins = $query->leftJoin("zxt_website_column", "zxt_website.website_column_id", "zxt_website_column.id");
+        $queryWithJoins = $query->leftJoin("website_column", "website.website_column_id", "website_column.id");
         $count = $queryWithJoins->count();
         $count = $queryWithJoins->count();
-        $result = $queryWithJoins->select("zxt_website.*", "zxt_website_column.column_name")
+        $result = $queryWithJoins->select("website.*", "website_column.column_name")
             ->limit($data['pageSize'])
             ->limit($data['pageSize'])
             ->offset(($data['page'] - 1) * $data['pageSize'])
             ->offset(($data['page'] - 1) * $data['pageSize'])
-            ->orderBy("zxt_website.updated_at", "desc")
+            ->orderBy("website.updated_at", "desc")
             ->get()
             ->get()
             ->all();
             ->all();
         foreach ($result as $key => $value) {
         foreach ($result as $key => $value) {
@@ -269,11 +269,11 @@ class WebsiteService implements WebsiteServiceInterface
     {
     {
 
 
         $where = [
         $where = [
-            ['zxt_website.id', '=', $id],
+            ['website.id', '=', $id],
         ];
         ];
         $result = Website::where($where)
         $result = Website::where($where)
-            ->leftJoin("template", "template.id", "zxt_website.template_id")
-            ->select("zxt_website.*", "template.template_name", "template.template_img")
+            ->leftJoin("template", "template.id", "website.template_id")
+            ->select("website.*", "template.template_name", "template.template_img")
             ->first();
             ->first();
         if (empty($result)) {
         if (empty($result)) {
             return Result::error("数据不存在", 0);
             return Result::error("数据不存在", 0);
@@ -306,11 +306,11 @@ class WebsiteService implements WebsiteServiceInterface
     {
     {
         $where = [];
         $where = [];
         if (isset($data['keyword']) && $data['keyword']) {
         if (isset($data['keyword']) && $data['keyword']) {
-            array_push($where, ['zxt_website_column.column_name', 'like', '%' . $data['keyword'] . '%']);
+            array_push($where, ['website_column.column_name', 'like', '%' . $data['keyword'] . '%']);
         }
         }
         $result = WebsiteColumn::where($where)
         $result = WebsiteColumn::where($where)
-            ->leftJoin("zxt_website_column as wc", "zxt_website_column.pid", "wc.id")
-            ->select("zxt_website_column.*", "wc.column_name as parent_column_name")
+            ->leftJoin("website_column as wc", "website_column.pid", "wc.id")
+            ->select("website_column.*", "wc.column_name as parent_column_name")
             ->limit($data['pageSize'])->offset(($data['page'] - 1) * $data['pageSize'])->get();
             ->limit($data['pageSize'])->offset(($data['page'] - 1) * $data['pageSize'])->get();
         $count = WebsiteColumn::where($where)->count();
         $count = WebsiteColumn::where($where)->count();
         if (empty($result)) {
         if (empty($result)) {
@@ -1128,7 +1128,7 @@ class WebsiteService implements WebsiteServiceInterface
     {
     {
         $where = [];
         $where = [];
         if (isset($data['keyword']) && !empty($data['keyword'])) {
         if (isset($data['keyword']) && !empty($data['keyword'])) {
-            array_push($where, ['zxt_website.website_name', 'like', '%' . $data['keyword'] . '%']);
+            array_push($where, ['website.website_name', 'like', '%' . $data['keyword'] . '%']);
         }
         }
         $result = Website::where($where)->get();
         $result = Website::where($where)->get();
 
 
@@ -1414,10 +1414,10 @@ class WebsiteService implements WebsiteServiceInterface
     {
     {
         $where = [];
         $where = [];
         if (isset($data['keyword']) && !empty($data['keyword'])) {
         if (isset($data['keyword']) && !empty($data['keyword'])) {
-            array_push($where, ['zxt_website.website_name', 'like', '%' . $data['keyword'] . '%']);
+            array_push($where, ['website.website_name', 'like', '%' . $data['keyword'] . '%']);
         }
         }
         if (isset($data['website_column_id']) && !empty($data['website_column_id'])) {
         if (isset($data['website_column_id']) && !empty($data['website_column_id'])) {
-            array_push($where, ['zxt_website.website_column_id', '=', $data['website_column_id']]);
+            array_push($where, ['website.website_column_id', '=', $data['website_column_id']]);
         }
         }
         $result = Website::where($where)
         $result = Website::where($where)
             ->with(["websiteCategory" => function ($query) {
             ->with(["websiteCategory" => function ($query) {
@@ -1882,33 +1882,33 @@ class WebsiteService implements WebsiteServiceInterface
     public function getWebsiteintel(array $data): array
     public function getWebsiteintel(array $data): array
     {
     {
         //查询所有网站模板信息
         //查询所有网站模板信息
-        $query = Website::leftJoin("website_template_info", "website_template_info.website_id", "zxt_website.id")
+        $query = Website::leftJoin("website_template_info", "website_template_info.website_id", "website.id")
             ->leftJoin("template", "template.template_id", "website_template_info.template_id")
             ->leftJoin("template", "template.template_id", "website_template_info.template_id")
             ->leftJoin("template_class", "template_class.class_id", "template.template_class_id")
             ->leftJoin("template_class", "template_class.class_id", "template.template_class_id")
-            ->leftJoin('zxt_website_column', 'zxt_website_column.id', 'zxt_website.website_column_id')
-            ->leftJoin('zxt_website_column as parent_column', function ($join) {
-                $join->on('zxt_website_column.pid', '=', 'parent_column.id')
-                    ->where('zxt_website_column.pid', 2);
+            ->leftJoin('website_column', 'website_column.id', 'website.website_column_id')
+            ->leftJoin('website_column as parent_column', function ($join) {
+                $join->on('website_column.pid', '=', 'parent_column.id')
+                    ->where('website_column.pid', 2);
             })
             })
             ->whereRaw('NOT JSON_CONTAINS(website_column_arr_id, \'3\')')
             ->whereRaw('NOT JSON_CONTAINS(website_column_arr_id, \'3\')')
             ->select(
             ->select(
                 "website_template_info.id",
                 "website_template_info.id",
                 "template_class.name",
                 "template_class.name",
-                "zxt_website.id as website_id",
-                "zxt_website.website_name",
-                "zxt_website.website_url",
+                "website.id as website_id",
+                "website.website_name",
+                "website.website_url",
                 "website_template_info.action_id",
                 "website_template_info.action_id",
                 "website_template_info.created_at",
                 "website_template_info.created_at",
                 "website_template_info.updated_at",
                 "website_template_info.updated_at",
                 "website_template_info.page_type",
                 "website_template_info.page_type",
-                'zxt_website_column.column_name',
+                'website_column.column_name',
                 'parent_column.column_name as parent_column_name',
                 'parent_column.column_name as parent_column_name',
                 DB::raw("COALESCE(website_template_info.status, 0) as template_status"),
                 DB::raw("COALESCE(website_template_info.status, 0) as template_status"),
                 "template.template_name"
                 "template.template_name"
             );
             );
         //若存在条件;则在$query的基础上进行筛选
         //若存在条件;则在$query的基础上进行筛选
         if (isset($data['website_name']) && !empty($data['website_name'])) {
         if (isset($data['website_name']) && !empty($data['website_name'])) {
-            $query->where('zxt_website.website_name', 'like', '%' . $data['website_name'] . '%');
+            $query->where('website.website_name', 'like', '%' . $data['website_name'] . '%');
         }
         }
         if (isset($data['status']) && !empty($data['status'])) {
         if (isset($data['status']) && !empty($data['status'])) {
             $query->where('website_template_info.status', $data['status']);
             $query->where('website_template_info.status', $data['status']);
@@ -1946,7 +1946,7 @@ class WebsiteService implements WebsiteServiceInterface
      */
      */
     public function checkWebsiteBuild(array $data): array
     public function checkWebsiteBuild(array $data): array
     {
     {
-        $website = Website::where('zxt_website.id', $data['website_id'])->first();
+        $website = Website::where('website.id', $data['website_id'])->first();
         if (empty($website)) {
         if (empty($website)) {
             return Result::error("请输入正确的网站id!", 0);
             return Result::error("请输入正确的网站id!", 0);
         }
         }
@@ -2028,7 +2028,7 @@ class WebsiteService implements WebsiteServiceInterface
      */
      */
     public function upWebsiteTemplateintel(array $data): array
     public function upWebsiteTemplateintel(array $data): array
     {
     {
-        $web = Website::where('zxt_website.id', $data['website_id'])->first();
+        $web = Website::where('website.id', $data['website_id'])->first();
         if (empty($web)) {
         if (empty($web)) {
             return Result::error("请输入正确的网站id!", 0);
             return Result::error("请输入正确的网站id!", 0);
         }
         }
@@ -2091,7 +2091,7 @@ class WebsiteService implements WebsiteServiceInterface
     public function getWebsiteTemplateList(array $data): array
     public function getWebsiteTemplateList(array $data): array
     {
     {
 
 
-        $website = Website::where('zxt_website.id', $data['website_id'])->first();
+        $website = Website::where('website.id', $data['website_id'])->first();
         if (empty($website)) {
         if (empty($website)) {
             return Result::error("请输入正确的网站id!", 0);
             return Result::error("请输入正确的网站id!", 0);
         } else {
         } else {
@@ -2600,15 +2600,15 @@ class WebsiteService implements WebsiteServiceInterface
             $list = Article::where('article.id', $data['article_id'])
             $list = Article::where('article.id', $data['article_id'])
             ->leftJoin('website_category', 'article.catid', '=', 'website_category.category_id')
             ->leftJoin('website_category', 'article.catid', '=', 'website_category.category_id')
             // WebsiteCategory::query()->where($where)
             // WebsiteCategory::query()->where($where)
-            ->leftJoin('website', 'zxt_website.id', '=', 'website_category.website_id')
+            ->leftJoin('website', 'website.id', '=', 'website_category.website_id')
             ->leftJoinSub(function ($query) use ($data) {
             ->leftJoinSub(function ($query) use ($data) {
                 $query->from('article_ignore')
                 $query->from('article_ignore')
                 ->where('article_ignore.article_id', $data['article_id']);
                 ->where('article_ignore.article_id', $data['article_id']);
                 }, 'article_ignore', function ($join) {
                 }, 'article_ignore', function ($join) {
                 $join->on('website_category.website_id', '=', 'article_ignore.website_id');
                 $join->on('website_category.website_id', '=', 'article_ignore.website_id');
                 })
                 })
-            ->select('website_category.*', 'zxt_website.website_name', DB::raw('IFNULL(article_ignore.c_show_time, "") as c_show_time')) // 选择需要的字段,不存在记录时 c_show_time 为空字符串
-            ->distinct('zxt_website.website_name') // 使用DISTINCT关键字按website_name过滤重复数据
+            ->select('website_category.*', 'website.website_name', DB::raw('IFNULL(article_ignore.c_show_time, "") as c_show_time')) // 选择需要的字段,不存在记录时 c_show_time 为空字符串
+            ->distinct('website.website_name') // 使用DISTINCT关键字按website_name过滤重复数据
             ->get();
             ->get();
             // ->array_map(function ($item) {
             // ->array_map(function ($item) {
             //     $item['c_show_time'] = json_decode($item['category_arr_id'], true);
             //     $item['c_show_time'] = json_decode($item['category_arr_id'], true);
@@ -2617,8 +2617,8 @@ class WebsiteService implements WebsiteServiceInterface
             ;
             ;
         }else{
         }else{
              $list = WebsiteCategory::query()->where($where)
              $list = WebsiteCategory::query()->where($where)
-            ->leftJoin('website', 'zxt_website.id', '=', 'website_category.website_id')
-            ->select('website_category.*', 'zxt_website.website_name')
+            ->leftJoin('website', 'website.id', '=', 'website_category.website_id')
+            ->select('website_category.*', 'website.website_name')
             ->distinct()
             ->distinct()
             ->get();
             ->get();
         }
         }
@@ -2796,8 +2796,8 @@ class WebsiteService implements WebsiteServiceInterface
         })
         })
             ->orderBy('updated_at', 'desc');
             ->orderBy('updated_at', 'desc');
         $count = $query->count();
         $count = $query->count();
-        $row = $query->leftJoin('website', 'zxt_website.id', '=', 'website_img.website_id')
-            ->select('website_img.*', 'zxt_website.website_name')
+        $row = $query->leftJoin('website', 'website.id', '=', 'website_img.website_id')
+            ->select('website_img.*', 'website.website_name')
             ->limit($data['pageSize'])
             ->limit($data['pageSize'])
             ->offset(($data['page'] - 1) * $data['pageSize'])
             ->offset(($data['page'] - 1) * $data['pageSize'])
             ->get();
             ->get();

+ 30 - 0
app/Model/AdSize.php

@@ -0,0 +1,30 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class AdSize extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'ad_size';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [
+        'width', // 👈 添加这一行
+        'height',
+    ];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 27 - 0
app/Model/AdStats.php

@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class AdStats extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'ad_stats';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+}

+ 28 - 0
app/Model/Message.php

@@ -0,0 +1,28 @@
+<?php
+
+declare(strict_types=1);
+
+namespace App\Model;
+
+use Hyperf\DbConnection\Model\Model;
+
+/**
+ */
+class Message extends Model
+{
+    /**
+     * The table associated with the model.
+     */
+    protected ?string $table = 'message';
+
+    /**
+     * The attributes that are mass assignable.
+     */
+    protected array $fillable = [];
+
+    /**
+     * The attributes that should be cast to native types.
+     */
+    protected array $casts = [];
+
+}

+ 4 - 0
app/Model/Role.php

@@ -24,4 +24,8 @@ class Role extends Model
      * The attributes that should be cast to native types.
      * The attributes that should be cast to native types.
      */
      */
     protected array $casts = [];
     protected array $casts = [];
+    public function users()
+    {
+        return $this->hasMany(RoleUser::class);
+    }
 }
 }

+ 1 - 1
app/Model/Website.php

@@ -13,7 +13,7 @@ class Website extends Model
     /**
     /**
      * The table associated with the model.
      * The table associated with the model.
      */
      */
-    protected ?string $table = 'zxt_website';
+    protected ?string $table = 'website';
     /**
     /**
      * The attributes that are mass assignable.
      * The attributes that are mass assignable.
      */
      */

+ 1 - 1
app/Model/WebsiteColumn.php

@@ -13,7 +13,7 @@ class WebsiteColumn extends Model
     /**
     /**
      * The table associated with the model.
      * The table associated with the model.
      */
      */
-    protected ?string $table = 'zxt_website_column';
+    protected ?string $table = 'website_column';
     /**
     /**
      * The attributes that are mass assignable.
      * The attributes that are mass assignable.
      */
      */

+ 1 - 1
app/Service/MinioService.php

@@ -67,7 +67,7 @@ class MinioService
      */
      */
     public function uploadFile($data)
     public function uploadFile($data)
     {
     {
-        $acceptExt = ['png', 'jpg', 'jpeg', 'gif', 'xls', 'xlsx', 'pdf', 'doc', 'docx', 'ppt', 'zip', 'pptx', 'mp4', 'flv','rar','tar'];
+        $acceptExt = ['png', 'jpg', 'jpeg', 'gif', 'xls', 'xlsx', 'pdf', 'doc', 'docx', 'ppt', 'zip', 'pptx', 'mp4', 'flv','rar','tar','txt','mp3'];
         try {
         try {
             if (!in_array( $data['ext'], $acceptExt)) {
             if (!in_array( $data['ext'], $acceptExt)) {
                 return Result::error('文件名后缀不允许');
                 return Result::error('文件名后缀不允许');

+ 1 - 0
composer.json

@@ -15,6 +15,7 @@
         "php": ">=8.1",
         "php": ">=8.1",
         "aws/aws-sdk-php": "^3.336",
         "aws/aws-sdk-php": "^3.336",
         "doctrine/annotations": "^2.0",
         "doctrine/annotations": "^2.0",
+        "fukuball/jieba-php": "dev-master",
         "hyperf/cache": "~3.1.0",
         "hyperf/cache": "~3.1.0",
         "hyperf/command": "~3.1.0",
         "hyperf/command": "~3.1.0",
         "hyperf/config": "~3.1.0",
         "hyperf/config": "~3.1.0",

+ 87 - 14
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
         "This file is @generated automatically"
     ],
     ],
-    "content-hash": "9e24e7b69b09585bdb1584dff8aaec3b",
+    "content-hash": "fab742d38f3abf7546bf3b18e5bf84bb",
     "packages": [
     "packages": [
         {
         {
             "name": "aws/aws-crt-php",
             "name": "aws/aws-crt-php",
@@ -62,16 +62,16 @@
         },
         },
         {
         {
             "name": "aws/aws-sdk-php",
             "name": "aws/aws-sdk-php",
-            "version": "3.369.8",
+            "version": "3.369.11",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/aws/aws-sdk-php.git",
                 "url": "https://github.com/aws/aws-sdk-php.git",
-                "reference": "2fa2011e2adc8e70b15b17c50d598fc44fc3106a"
+                "reference": "014c521eae8eeb1f9562cb512523b17cd6c1bec7"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2fa2011e2adc8e70b15b17c50d598fc44fc3106a",
-                "reference": "2fa2011e2adc8e70b15b17c50d598fc44fc3106a",
+                "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/014c521eae8eeb1f9562cb512523b17cd6c1bec7",
+                "reference": "014c521eae8eeb1f9562cb512523b17cd6c1bec7",
                 "shasum": ""
                 "shasum": ""
             },
             },
             "require": {
             "require": {
@@ -153,9 +153,9 @@
             "support": {
             "support": {
                 "forum": "https://github.com/aws/aws-sdk-php/discussions",
                 "forum": "https://github.com/aws/aws-sdk-php/discussions",
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
                 "issues": "https://github.com/aws/aws-sdk-php/issues",
-                "source": "https://github.com/aws/aws-sdk-php/tree/3.369.8"
+                "source": "https://github.com/aws/aws-sdk-php/tree/3.369.11"
             },
             },
-            "time": "2026-01-06T19:10:11+00:00"
+            "time": "2026-01-12T19:14:19+00:00"
         },
         },
         {
         {
             "name": "carbonphp/carbon-doctrine-types",
             "name": "carbonphp/carbon-doctrine-types",
@@ -596,6 +596,77 @@
             },
             },
             "time": "2020-11-24T22:02:12+00:00"
             "time": "2020-11-24T22:02:12+00:00"
         },
         },
+        {
+            "name": "fukuball/jieba-php",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/fukuball/jieba-php.git",
+                "reference": "435d73f4d85435fd88a472ddce76b6cc3892f3e4"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/fukuball/jieba-php/zipball/435d73f4d85435fd88a472ddce76b6cc3892f3e4",
+                "reference": "435d73f4d85435fd88a472ddce76b6cc3892f3e4",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "require-dev": {
+                "doctrine/instantiator": "^1.3",
+                "guzzlehttp/guzzle": "^7.0",
+                "php-coveralls/php-coveralls": "^2.5",
+                "phpunit/phpunit": "^8.5 || ^9.0",
+                "psr/log": "^1.1",
+                "squizlabs/php_codesniffer": "^3.6 || ^4.0",
+                "symfony/config": "^5.4",
+                "symfony/console": "^5.4",
+                "symfony/deprecation-contracts": "^2.5",
+                "symfony/filesystem": "^5.4",
+                "symfony/service-contracts": "^2.5",
+                "symfony/stopwatch": "^5.4",
+                "symfony/string": "^5.4",
+                "symfony/yaml": "^5.4"
+            },
+            "default-branch": true,
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "src/vendor/multi-array/MultiArray.php",
+                    "src/vendor/multi-array/Factory/MultiArrayFactory.php"
+                ],
+                "psr-4": {
+                    "Fukuball\\Jieba\\": "src/class/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "fukuball",
+                    "email": "fukuball@gmail.com"
+                }
+            ],
+            "description": "結巴中文分詞(PHP 版本):做最好的 PHP 中文分詞、中文斷詞組件",
+            "keywords": [
+                "Jieba",
+                "php"
+            ],
+            "support": {
+                "issues": "https://github.com/fukuball/jieba-php/issues",
+                "source": "https://github.com/fukuball/jieba-php/tree/master"
+            },
+            "time": "2025-10-20T08:31:12+00:00"
+        },
         {
         {
             "name": "graham-campbell/result-type",
             "name": "graham-campbell/result-type",
             "version": "v1.1.4",
             "version": "v1.1.4",
@@ -7577,16 +7648,16 @@
         },
         },
         {
         {
             "name": "friendsofphp/php-cs-fixer",
             "name": "friendsofphp/php-cs-fixer",
-            "version": "v3.92.4",
+            "version": "v3.92.5",
             "source": {
             "source": {
                 "type": "git",
                 "type": "git",
                 "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
                 "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
-                "reference": "9e7488b19403423e02e8403cc1eb596baf4673b0"
+                "reference": "260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58"
             },
             },
             "dist": {
             "dist": {
                 "type": "zip",
                 "type": "zip",
-                "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/9e7488b19403423e02e8403cc1eb596baf4673b0",
-                "reference": "9e7488b19403423e02e8403cc1eb596baf4673b0",
+                "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58",
+                "reference": "260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58",
                 "shasum": ""
                 "shasum": ""
             },
             },
             "require": {
             "require": {
@@ -7669,7 +7740,7 @@
             ],
             ],
             "support": {
             "support": {
                 "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
                 "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
-                "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.92.4"
+                "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.92.5"
             },
             },
             "funding": [
             "funding": [
                 {
                 {
@@ -7677,7 +7748,7 @@
                     "type": "github"
                     "type": "github"
                 }
                 }
             ],
             ],
-            "time": "2026-01-04T00:38:52+00:00"
+            "time": "2026-01-08T21:57:37+00:00"
         },
         },
         {
         {
             "name": "hamcrest/hamcrest-php",
             "name": "hamcrest/hamcrest-php",
@@ -10936,7 +11007,9 @@
     ],
     ],
     "aliases": [],
     "aliases": [],
     "minimum-stability": "dev",
     "minimum-stability": "dev",
-    "stability-flags": [],
+    "stability-flags": {
+        "fukuball/jieba-php": 20
+    },
     "prefer-stable": true,
     "prefer-stable": true,
     "prefer-lowest": false,
     "prefer-lowest": false,
     "platform": {
     "platform": {

Разница между файлами не показана из-за своего большого размера
+ 266 - 240
vendor/composer/autoload_classmap.php


Разница между файлами не показана из-за своего большого размера
+ 284 - 161
vendor/composer/autoload_static.php


Некоторые файлы не были показаны из-за большого количества измененных файлов