From fffbdefbff0d9bafda0bf8b3a44307f463f6680e Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Wed, 28 Jan 2026 17:26:37 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Vod.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/api/controller/Vod.php b/application/api/controller/Vod.php index 19e7699a3..fe3db2246 100644 --- a/application/api/controller/Vod.php +++ b/application/api/controller/Vod.php @@ -60,7 +60,7 @@ public function get_list(Request $request) $where['vod_tag'] = ['like', '%' . $this->format_sql_string($param['vod_tag']) . '%']; } if (isset($param['vod_name']) && strlen($param['vod_name']) > 0) { - $where['vod_name'] = ['like', '%' . $this->format_sql_string($param['vod_name']) . '%']; + $where['vod_name'] = ['like', '%'.$param['vod_name'].'%']; } if (isset($param['vod_blurb']) && strlen($param['vod_blurb']) > 0) { $where['vod_blurb'] = ['like', '%' . $this->format_sql_string($param['vod_blurb']) . '%']; @@ -83,7 +83,7 @@ public function get_list(Request $request) if (strlen($param['orderby']) > 0) { $order = 'vod_' . $param['orderby'] . " DESC"; } - $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year'; + $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; // $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field, []); $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field); } @@ -120,7 +120,7 @@ public function get_detail(Request $request) ]); } - $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->select(); + $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->find(); // 返回 return json([ From 2b86a5bb146a1e4d830fb51a6885e93362a87521 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Thu, 29 Jan 2026 16:23:26 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E5=88=86=E7=B1=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/controller/Type.php b/application/api/controller/Type.php index 966234d26..5992d52d0 100644 --- a/application/api/controller/Type.php +++ b/application/api/controller/Type.php @@ -57,7 +57,7 @@ public function get_list(Request $request) foreach ($list as $index => $item) { $child_total = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->count(); if ($child_total > 0) { - $child = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->select(); + $child = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->order('type_sort ASC')->select(); $list[$index]['child'] = $child; } } From eab17184e6dc3825797506581ae31d5a68a377f8 Mon Sep 17 00:00:00 2001 From: tomas123 Date: Thu, 29 Jan 2026 22:13:23 +0800 Subject: [PATCH 03/20] 11 --- application/api/controller/Vod.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/api/controller/Vod.php b/application/api/controller/Vod.php index fe3db2246..e05475be7 100644 --- a/application/api/controller/Vod.php +++ b/application/api/controller/Vod.php @@ -48,7 +48,7 @@ public function get_list(Request $request) $where['type_id'] = (int)$param['type_id']; } if (isset($param['id'])) { - $where['vod_id'] = (int)$param['id']; + $where['vod_id'] = $param['id']; } // if (isset($param['type_id_1'])) { // $where['type_id_1'] = (int)$param['type_id_1']; @@ -121,7 +121,11 @@ public function get_detail(Request $request) } $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->find(); - + //判断vod_rel_vod 字段是否为空 + if (!empty($res['vod_rel_vod'])) { + $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; + $res['vod_rel_vod_list'] = Db::table('mac_vod')->where(['vod_id' => ['in', $res['vod_rel_vod']]])->field($field)->select(); + } // 返回 return json([ 'code' => 1, From db1059dc8958b86168e37522e55d7855a9218cfc Mon Sep 17 00:00:00 2001 From: tomas123 Date: Mon, 2 Feb 2026 20:23:02 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/validate/Comment.php | 2 +- application/common.php | 7 +++++- application/index/controller/Comment.php | 28 ++++++++++++------------ 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/application/api/validate/Comment.php b/application/api/validate/Comment.php index 000b6621e..301cf21ff 100644 --- a/application/api/validate/Comment.php +++ b/application/api/validate/Comment.php @@ -7,7 +7,7 @@ class Comment extends Validate { protected $rule = [ - 'offset' => 'number|between:1,' . PHP_INT_MAX, + 'offset' => 'number|between:0,' . PHP_INT_MAX, 'limit' => 'number|between:1,' . PHP_INT_MAX, 'rid' => 'number|between:1,' . PHP_INT_MAX, 'orderby' => 'in:time,up,down' diff --git a/application/common.php b/application/common.php index 3f757ae07..65999d88e 100644 --- a/application/common.php +++ b/application/common.php @@ -43,7 +43,12 @@ function slog($logs) { $ymd = date('Y-m-d-H'); $now = date('Y-m-d H:i:s'); - $toppath = "./log/$ymd.txt"; + $log_dir = "./log/"; + // 自动创建日志目录 + if (!is_dir($log_dir)) { + @mkdir($log_dir, 0755, true); + } + $toppath = $log_dir . $ymd . ".txt"; $ts = @fopen($toppath,"a+"); @fputs($ts, $now .' '. $logs ."\r\n"); @fclose($ts); diff --git a/application/index/controller/Comment.php b/application/index/controller/Comment.php index 06a93f3d3..afd64ebb9 100644 --- a/application/index/controller/Comment.php +++ b/application/index/controller/Comment.php @@ -36,30 +36,28 @@ public function ajax() { public function saveData() { $param = input(); - if($GLOBALS['config']['comment']['verify'] == 1){ if(!captcha_check($param['verify'])){ - return ['code'=>1002,'msg'=>lang('verify_err')]; + return json(['code'=>1002,'msg'=>lang('verify_err')]); } - } - + } if($GLOBALS['config']['comment']['login'] ==1){ if(empty(cookie('user_id'))){ - return ['code' => 1003, 'msg' =>lang('index/require_login')]; + return json(['code' => 1003, 'msg' =>lang('index/require_login')]); } - $res = model('User')->checkLogin(); + $res = model('User')->checkLogin(); if($res['code']>1) { - return ['code' => 1003, 'msg' => lang('index/require_login')]; + return json(['code' => 1003, 'msg' => lang('index/require_login')]); } } if(empty($param['comment_content'])){ - return ['code'=>1004,'msg'=>lang('index/require_content')]; + return json(['code'=>1004,'msg'=>lang('index/require_content')]); } $cookie = 'comment_timespan'; if(!empty(cookie($cookie))){ - return ['code'=>1005,'msg'=>lang('frequently')]; + return json(['code'=>1005,'msg'=>lang('frequently')]); } $param['comment_content']= htmlentities(mac_filter_words($param['comment_content'])); @@ -68,7 +66,7 @@ public function saveData() { // } if(!in_array($param['comment_mid'],['1','2','3','8','9','11'])){ - return ['code'=>1006,'msg'=>lang('index/mid_err')]; + return json(['code'=>1006,'msg'=>lang('index/mid_err')]); } if(empty(cookie('user_id'))){ @@ -95,7 +93,7 @@ public function saveData() { if(!empty($blcaks['black_keyword_list']) && count($blcaks['black_keyword_list']) > 0){ foreach ($blcaks['black_keyword_list'] as $key => $value) { if(strpos($param['comment_content'], $value) !== false){ - return ['code'=>1007,'msg'=>lang('index/blacklist_keyword')]; + return json(['code'=>1007,'msg'=>lang('index/blacklist_keyword')]); } } } @@ -103,13 +101,14 @@ public function saveData() { if(!empty($blcaks['black_ip_list']) && count($blcaks['black_ip_list']) > 0){ $client_ip = long2ip($param['comment_ip']); if (in_array($client_ip, $blcaks['black_ip_list'])){ - return ['code'=>1008,'msg'=>lang('index/blacklist_ip')]; + return json(['code'=>1008,'msg'=>lang('index/blacklist_ip')]); } } $res = model('Comment')->saveData($param); + slog('评论保存结果: ' . json_encode($res)); if($res['code']>1){ - return $res; + return json($res); } else{ cookie($cookie, 't', $GLOBALS['config']['comment']['timespan']); @@ -119,7 +118,8 @@ public function saveData() { else{ $res['msg'] = lang('index/thanks_msg'); } - return $res; + slog('最终返回结果: ' . json_encode($res)); + return json($res); } } From 98a6905102ec67c6fc615589c7f2841081978f4d Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Tue, 3 Feb 2026 09:59:15 +0800 Subject: [PATCH 05/20] =?UTF-8?q?ajax.php=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/validate/Ajax.php | 48 +++++++ application/index/controller/Ajax.php | 174 +++++++++++++++++++++++++- 2 files changed, 220 insertions(+), 2 deletions(-) create mode 100644 application/common/validate/Ajax.php diff --git a/application/common/validate/Ajax.php b/application/common/validate/Ajax.php new file mode 100644 index 000000000..81a15d5fe --- /dev/null +++ b/application/common/validate/Ajax.php @@ -0,0 +1,48 @@ + 'number|between:1,' . PHP_INT_MAX, + 'vod_id' => 'require|number|between:0,' . PHP_INT_MAX, + 'id' => 'number|between:0,' . PHP_INT_MAX, + 'offset' => 'number|between:0,' . PHP_INT_MAX, + 'limit' => 'number|between:1,500', + 'orderby' => 'in:hits,up,pubdate,hits_week,hits_month,hits_day,score', + 'vod_letter' => 'max:1', + 'vod_name' => 'max:50', + 'vod_tag' => 'max:20', + 'vod_blurb' => 'max:20', + 'vod_class' => 'max:10', + // year,area,class + 'type_id_1' => 'require|number|between:0,' . PHP_INT_MAX, + ]; + + protected $message = [ + + ]; + + protected $scene = [ + 'get_list' => [ + 'type_id', + ], + 'get_vod_list' => [ + 'id', + 'offset', + 'limit', + 'orderby', + 'type_id', +// 'type_id_1', + 'vod_letter', + 'vod_name', + 'vod_tag', + 'vod_blurb', + 'vod_class', + ], + 'get_vod_detail' => [ + 'vod_id', + ], + ]; +} \ No newline at end of file diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index d72d24746..533bd54d1 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -1,7 +1,7 @@ 1,'msg'=>lang('ok')]); } + /** + * 获取分类树 + * + * @param Request $request + * @return \think\response\Json + */ + public function get_list(Request $request) + { + // 参数校验 + // 参数校验 + $param = $request->param(); + $validate = validate($request->controller()); + if (!$validate->scene($request->action())->check($param)) { + return json([ + 'code' => 1001, + 'msg' => '参数错误: ' . $validate->getError(), + ]); + } + // 查询条件组装 + $where = []; + // 查询第一级 + $where['type_pid'] = 0; + + if (isset($param['type_id'])) { + $where['type_id'] = (int)$param['type_id']; + } + + // 数据获取 + $total = model('Type')->getCountByCond($where); + $list = []; + if ($total > 0) { + // 排序 + $order = "type_sort DESC"; + $field = '*'; + $list = model('Type')->getListByCond(0, PHP_INT_MAX, $where, $order, $field, []); + foreach ($list as $index => $item) { + $child_total = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->count(); + if ($child_total > 0) { + $child = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->order('type_sort ASC')->select(); + $list[$index]['child'] = $child; + } + } + } + // 返回 + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'info' => [ + 'total' => $total, + 'rows' => $list, + ], + ]); + } + + /** + * 获取视频列表 + * + * @param Request $request + * @return \think\response\Json + */ + public function get_vod_list(Request $request) + { + // 参数校验 + $param = $request->param(); + $validate = validate($request->controller()); + if (!$validate->scene($request->action())->check($param)) { + return json([ + 'code' => 1001, + 'msg' => '参数错误: ' . $validate->getError(), + ]); + } + $offset = isset($param['offset']) ? (int)$param['offset'] : 0; + $limit = isset($param['limit']) ? (int)$param['limit'] : 20; + // 查询条件组装 + $where = []; + if (isset($param['type_id'])) { + $where['type_id'] = (int)$param['type_id']; + } + if (isset($param['id'])) { + $where['vod_id'] = $param['id']; + } +// if (isset($param['type_id_1'])) { +// $where['type_id_1'] = (int)$param['type_id_1']; +// } + if (!empty($param['vod_letter'])) { + $where['vod_letter'] = $param['vod_letter']; + } + if (isset($param['vod_tag']) && strlen($param['vod_tag']) > 0) { + $where['vod_tag'] = ['like', '%' . $this->format_sql_string($param['vod_tag']) . '%']; + } + if (isset($param['vod_name']) && strlen($param['vod_name']) > 0) { + $where['vod_name'] = ['like', '%'.$param['vod_name'].'%']; + } + if (isset($param['vod_blurb']) && strlen($param['vod_blurb']) > 0) { + $where['vod_blurb'] = ['like', '%' . $this->format_sql_string($param['vod_blurb']) . '%']; + } + if (isset($param['vod_class']) && strlen($param['vod_class']) > 0) { + $where['vod_class'] = ['like', '%' . $this->format_sql_string($param['vod_class']) . '%']; + } + if (isset($param['vod_area']) && strlen($param['vod_area']) > 0) { + $where['vod_area'] = $this->format_sql_string($param['vod_area']); + } + if (isset($param['vod_year']) && strlen($param['vod_year']) > 0) { + $where['vod_year'] = $this->format_sql_string($param['vod_year']); + } + // 数据获取 + $total = model('Vod')->getCountByCond($where); + $list = []; + if ($total > 0) { + // 排序 + $order = "vod_time DESC"; + if (strlen($param['orderby']) > 0) { + $order = 'vod_' . $param['orderby'] . " DESC"; + } + $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; +// $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field, []); + $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field); + } + // 返回 + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'info' => [ + 'offset' => $offset, + 'limit' => $limit, + 'total' => $total, + 'rows' => $list, + ], + ]); + } + /** + * 视频详细信息 + * + * @param Request $request + * @return \think\response\Json + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ + public function get_vod_detail(Request $request) + { + $param = $request->param(); + $validate = validate($request->controller()); + if (!$validate->scene($request->action())->check($param)) { + return json([ + 'code' => 1001, + 'msg' => '参数错误: ' . $validate->getError(), + ]); + } + + $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->find(); + //判断vod_rel_vod 字段是否为空 + if (!empty($res['vod_rel_vod'])) { + $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; + $res['vod_rel_vod_list'] = Db::table('mac_vod')->where(['vod_id' => ['in', $res['vod_rel_vod']]])->field($field)->select(); + } + // 返回 + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'info' => $res + ]); + } + protected function format_sql_string($str) + { + $str = preg_replace('/\b(SELECT|INSERT|UPDATE|DELETE|DROP|UNION|WHERE|FROM|JOIN|INTO|VALUES|SET|AND|OR|NOT|EXISTS|HAVING|GROUP BY|ORDER BY|LIMIT|OFFSET)\b/i', '', $str); + $str = preg_replace('/[^\w\s\-\.]/', '', $str); + $str = trim(preg_replace('/\s+/', ' ', $str)); + return $str; + } } \ No newline at end of file From d430eadb8df38896bb3d8f9e74a2aedebfeb99be Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Tue, 3 Feb 2026 10:49:37 +0800 Subject: [PATCH 06/20] =?UTF-8?q?ulog=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/model/Ulog.php | 108 ++++++++++++++++++++++++++ application/index/controller/User.php | 23 +++++- 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/application/common/model/Ulog.php b/application/common/model/Ulog.php index c8cfcf203..ca22fecce 100644 --- a/application/common/model/Ulog.php +++ b/application/common/model/Ulog.php @@ -116,6 +116,114 @@ public function listData($where,$order,$page=1,$limit=20,$start=0) return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list]; } + public function listData_new($where,$order,$offset=0,$limit=20) + { + $offset = $offset > 0 ? (int)$offset : 0; + $limit = $limit ? (int)$limit : 20; + + if(!is_array($where)){ + $where = json_decode($where,true); + } + $limit_str = $offset .",".$limit; + $total = $this->where($where)->count(); + $list = Db::name('Ulog')->where($where)->order($order)->limit($limit_str)->select(); + + $user_ids=[]; + foreach($list as $k=>&$v){ + if($v['user_id'] >0){ + $user_ids[$v['user_id']] = $v['user_id']; + } + + if($v['ulog_mid']==1){ + $vod_info = model('Vod')->infoData(['vod_id'=>['eq',$v['ulog_rid']]],'*',1); + + if($v['ulog_sid']>0 && $v['ulog_nid']>0){ + if($v['ulog_type']==5){ + $vod_info['info']['link'] = mac_url_vod_down($vod_info['info'],['sid'=>$v['ulog_sid'],'nid'=>$v['ulog_nid']]); + } + else{ + $vod_info['info']['link'] = mac_url_vod_play($vod_info['info'],['sid'=>$v['ulog_sid'],'nid'=>$v['ulog_nid']]); + } + } + else{ + $vod_info['info']['link'] = mac_url_vod_detail($vod_info['info']); + } + $v['data'] = [ + 'id'=>$vod_info['info']['vod_id'], + 'name'=>$vod_info['info']['vod_name'], + 'pic'=>mac_url_img($vod_info['info']['vod_pic']), + 'link'=>$vod_info['info']['link'], + 'type'=>[ + 'type_id'=>$vod_info['info']['type']['type_id'], + 'type_name'=>$vod_info['info']['type']['type_name'], + 'link'=>mac_url_type($vod_info['info']['type']), + ], + + ]; + } + elseif($v['ulog_mid']==2){ + $art_info = model('Art')->infoData(['art_id'=>['eq',$v['ulog_rid']]],'*',1); + $art_info['info']['link'] = mac_url_art_detail($art_info['info']); + $v['data'] = [ + 'id'=>$art_info['info']['art_id'], + 'name'=>$art_info['info']['art_name'], + 'pic'=>mac_url_img($art_info['info']['art_pic']), + 'link'=>$art_info['info']['link'], + 'type'=>[ + 'type_id'=>$art_info['info']['type']['type_id'], + 'type_name'=>$art_info['info']['type']['type_name'], + 'link'=>mac_url_type($art_info['info']['type']), + ], + + ]; + } + elseif($v['ulog_mid']==3){ + $topic_info = model('Topic')->infoData(['topic_id'=>['eq',$v['ulog_rid']]],'*',1); + $topic_info['info']['link'] = mac_url_topic_detail($topic_info['info']); + $v['data'] = [ + 'id'=>$topic_info['info']['topic_id'], + 'name'=>$topic_info['info']['topic_name'], + 'pic'=>mac_url_img($topic_info['info']['topic_pic']), + 'link'=>$topic_info['info']['link'], + 'type'=>[], + ]; + } + elseif($v['ulog_mid']==8){ + $actor_info = model('Actor')->infoData(['actor_id'=>['eq',$v['ulog_rid']]],'*',1); + $actor_info['info']['link'] = mac_url_actor_detail($actor_info['info']); + $v['data'] = [ + 'id'=>$actor_info['info']['actor_id'], + 'name'=>$actor_info['info']['actor_name'], + 'pic'=>mac_url_img($actor_info['info']['actor_pic']), + 'link'=>$actor_info['info']['link'], + 'type'=>[], + ]; + } + } + + if(!empty($user_ids)){ + $where2=[]; + $where['user_id'] = ['in', $user_ids]; + $order='user_id desc'; + $user_list = model('User')->listData($where2,$order,1,999); + $user_list = mac_array_rekey($user_list['list'],'user_id'); + + foreach($list as $k=>&$v){ + $list[$k]['user_name'] = $user_list[$v['user_id']]['user_name']; + } + } + return [ + 'code' => 1, + 'msg' => '获取成功', + 'info' => [ + 'offset' => $offset, + 'limit' => $limit, + 'total' => $total, + 'rows' => $list, + ], + ] ; + //return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list]; + } public function infoData($where,$field='*') { if(empty($where) || !is_array($where)){ diff --git a/application/index/controller/User.php b/application/index/controller/User.php index f065ac66e..0c8197f76 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -97,7 +97,28 @@ public function ajax_ulog() } return json($res); } - +public function ajax_ulog_list() + { + $param = input(); + + $where = []; + $where['user_id'] = $GLOBALS['user']['user_id']; + $param['offset'] = intval($param['offset']) < 1 ? 0 : intval($param['offset']); + $param['limit'] = intval($param['limit']) < 1 ? 10 : intval($param['limit']); + if(intval($param['mid'])>0){ + $where['ulog_mid'] = ['eq',intval($param['mid'])]; + } + if(intval($param['id'])>0){ + $where['ulog_rid'] = ['eq',intval($param['id'])]; + } + if(intval($param['type'])>0){ + $where['ulog_type'] = ['eq',intval($param['type'])]; + } + $order = 'ulog_time desc'; + $res = model('Ulog')->listData_new($where, $order, $param['offset'], $param['limit']); + + return json($res); + } public function ajax_buy_popedom() { $param = input(); From fa560c20a09d3803729a25a76fd6840a82f8daea Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Tue, 3 Feb 2026 14:18:51 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/validate/Comment.php | 10 +++++ application/index/controller/Comment.php | 50 ++++++++++++++++++++++++ application/index/controller/User.php | 1 - 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/application/common/validate/Comment.php b/application/common/validate/Comment.php index 50c6de73e..5d4e638d5 100644 --- a/application/common/validate/Comment.php +++ b/application/common/validate/Comment.php @@ -9,6 +9,10 @@ class Comment extends Validate 'comment_content' => 'require', 'comment_mid' => 'require', 'comment_rid' => 'require', + 'offset' => 'number|between:0,' . PHP_INT_MAX, + 'limit' => 'number|between:1,' . PHP_INT_MAX, + 'rid' => 'number|between:1,' . PHP_INT_MAX, + 'orderby' => 'in:time,up,down' ]; protected $message = [ @@ -21,5 +25,11 @@ class Comment extends Validate protected $scene = [ 'add'=> ['comment_name','comment_content','comment_mid','comment_rid'], 'edit'=> ['comment_name','comment_content'], + 'get_list' => [ + 'offset', + 'limit', + 'rid', + 'orderby', + ], ]; } \ No newline at end of file diff --git a/application/index/controller/Comment.php b/application/index/controller/Comment.php index afd64ebb9..58d5d25bd 100644 --- a/application/index/controller/Comment.php +++ b/application/index/controller/Comment.php @@ -187,5 +187,55 @@ public function digg() } return json(['code'=>1,'msg'=>lang('opt_ok'),'data'=>$data]); } +/** + * 获取列表 + * + * @param Request $request + * @return \think\response\Json + */ + public function get_list(Request $request) + { + // 参数校验 + $param = $request->param(); + $validate = validate($request->controller()); + if (!$validate->scene($request->action())->check($param)) { + return json([ + 'code' => 1001, + 'msg' => '参数错误: ' . $validate->getError(), + ]); + } + $offset = isset($param['offset']) ? (int)$param['offset'] : 0; + $limit = isset($param['limit']) ? (int)$param['limit'] : 20; + // 查询条件组装 + $where = []; + + if (isset($param['rid'])) { + $where['comment_rid'] = (int)$param['rid']; + } + // 数据获取 + $total = model('Comment')->getCountByCond($where); + $list = []; + if ($total > 0) { + // 排序 + $order = "comment_time DESC"; + if (strlen($param['orderby']) > 0) { + $order = 'comment_' . $param['orderby'] . " DESC"; + } + $field = '*'; + $list = model('Comment')->getListByCond($offset, $limit, $where, $order, $field, []); + } + // 返回 + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'info' => [ + 'offset' => $offset, + 'limit' => $limit, + 'total' => $total, + 'rows' => $list, + ], + ]); + } + } diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 0c8197f76..60c62551b 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -100,7 +100,6 @@ public function ajax_ulog() public function ajax_ulog_list() { $param = input(); - $where = []; $where['user_id'] = $GLOBALS['user']['user_id']; $param['offset'] = intval($param['offset']) < 1 ? 0 : intval($param['offset']); From 59ae8b033e46f53ed608c8559587bacf668eb0a5 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Wed, 4 Feb 2026 17:14:34 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/common/auth.php | 28 +++++ application/admin/controller/Appimage.php | 118 +++++++++++++++++++ application/admin/view/appimage/index.html | 116 ++++++++++++++++++ application/admin/view/appimage/info.html | 129 +++++++++++++++++++++ application/common/model/AppImage.php | 79 +++++++++++++ application/common/validate/AppImage.php | 20 ++++ application/data/update/database.php | 4 + application/index/controller/Ajax.php | 48 ++++++++ application/install/sql/install.sql | 22 ++++ 9 files changed, 564 insertions(+) create mode 100644 application/admin/controller/Appimage.php create mode 100644 application/admin/view/appimage/index.html create mode 100644 application/admin/view/appimage/info.html create mode 100644 application/common/model/AppImage.php create mode 100644 application/common/validate/AppImage.php diff --git a/application/admin/common/auth.php b/application/admin/common/auth.php index d6f789c40..2d289d8dc 100644 --- a/application/admin/common/auth.php +++ b/application/admin/common/auth.php @@ -407,6 +407,34 @@ 'controller' => 'annex', 'action' => 'data', ), + 37 => + array ( + 'show' => 1, + 'name' => '图片管理', + 'controller' => 'appimage', + 'action' => 'index', + ), + 3701 => + array ( + 'show' => 0, + 'name' => '--图片信息维护', + 'controller' => 'appimage', + 'action' => 'info', + ), + 3702 => + array ( + 'show' => 0, + 'name' => '--图片批量修改', + 'controller' => 'appimage', + 'action' => 'batch', + ), + 3703 => + array ( + 'show' => 0, + 'name' => '--图片删除', + 'controller' => 'appimage', + 'action' => 'del', + ), 3604 => array ( 'show' => 0, diff --git a/application/admin/controller/Appimage.php b/application/admin/controller/Appimage.php new file mode 100644 index 000000000..cd4b11ed0 --- /dev/null +++ b/application/admin/controller/Appimage.php @@ -0,0 +1,118 @@ +_pagesize : $param['limit']; + $where=[]; + + if(!empty($param['wd'])){ + $param['wd'] = htmlspecialchars(urldecode($param['wd'])); + $where['image_title'] = ['like','%'.$param['wd'].'%']; + } + + if(isset($param['image_type']) && $param['image_type'] !== ''){ + $where['image_type'] = ['eq',$param['image_type']]; + } + + if(isset($param['image_status']) && $param['image_status'] !== ''){ + $where['image_status'] = ['eq',$param['image_status']]; + } + + $order='image_sort asc,image_id desc'; + $res = model('AppImage')->listData($where,$order,$param['page'],$param['limit']); + + $this->assign('list',$res['list']); + $this->assign('total',$res['total']); + $this->assign('page',$res['page']); + $this->assign('limit',$res['limit']); + + $param['page'] = '{page}'; + $param['limit'] = '{limit}'; + $this->assign('param',$param); + $this->assign('title','图片管理'); + return $this->fetch('admin@appimage/index'); + } + + public function info() + { + if (Request()->isPost()) { + $param = input(); + + // 处理图片上传 + if(empty($param['image_pic'])){ + return $this->error('请上传图片'); + } + + $res = model('AppImage')->saveData($param); + if($res['code']>1){ + return $this->error($res['msg']); + } + return $this->success($res['msg']); + } + + $id = input('id'); + $info = []; + if($id){ + $where=[]; + $where['image_id'] = ['eq',$id]; + $res = model('AppImage')->infoData($where); + $info = $res['info']; + } + + $this->assign('info',$info); + $this->assign('title','图片管理'); + return $this->fetch('admin@appimage/info'); + } + + public function del() + { + $param = input(); + $ids = $param['ids']; + + if(!empty($ids)){ + $where=[]; + $where['image_id'] = ['in',$ids]; + $res = model('AppImage')->delData($where); + if($res['code']>1){ + return $this->error($res['msg']); + } + return $this->success($res['msg']); + } + return $this->error(lang('param_err')); + } + + public function batch() + { + $param = input(); + $ids = $param['ids']; + $col = $param['col']; + $val = $param['val']; + + if(!empty($ids) && !empty($col)){ + $where = []; + $where['image_id'] = ['in',$ids]; + $data = []; + $data[$col] = $val; + $data['image_time'] = time(); + + $res = Db::name('AppImage')->where($where)->update($data); + if($res===false){ + return $this->error(lang('save_err')); + } + return $this->success(lang('save_ok')); + } + return $this->error(lang('param_err')); + } + +} diff --git a/application/admin/view/appimage/index.html b/application/admin/view/appimage/index.html new file mode 100644 index 000000000..d452236a0 --- /dev/null +++ b/application/admin/view/appimage/index.html @@ -0,0 +1,116 @@ +{include file="../../../application/admin/view/public/head" /} +
+ +
+
+
+
+ +
+
+ +
+
+ +
+ +
+
+ + + +
+ +
+ + + + + + + + + + + + + + + + + {volist name="list" id="vo"} + + + + + + + + + + + + + {/volist} + +
ID排序类型标题图片跳转链接状态更新时间操作
{$vo.image_id} + {if condition="$vo.image_type eq 1"} + 启动页 + {elseif condition="$vo.image_type eq 2"/} + Banner + {/if} + {$vo.image_title} + {if condition="$vo.image_pic"} + + {/if} + {$vo.image_link} + + {$vo.image_time|date='Y-m-d H:i:s',###} + 编辑 + 删除 +
+
+ +
+
+{include file="../../../application/admin/view/public/foot" /} + + + + + diff --git a/application/admin/view/appimage/info.html b/application/admin/view/appimage/info.html new file mode 100644 index 000000000..e91a2b975 --- /dev/null +++ b/application/admin/view/appimage/info.html @@ -0,0 +1,129 @@ +{include file="../../../application/admin/view/public/head" /} + +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + +
+ {if condition="isset($info.image_pic) && $info.image_pic"} + + {/if} +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+
+ +
+ +{include file="../../../application/admin/view/public/foot" /} + + + + + diff --git a/application/common/model/AppImage.php b/application/common/model/AppImage.php new file mode 100644 index 000000000..4e765c4bd --- /dev/null +++ b/application/common/model/AppImage.php @@ -0,0 +1,79 @@ + 0 ? (int)$page : 1; + $limit = $limit ? (int)$limit : 20; + $start = $start ? (int)$start : 0; + if(!is_array($where)){ + $where = json_decode($where,true); + } + $limit_str = ($limit * ($page-1) + $start) .",".$limit; + $total = $this->where($where)->count(); + $list = Db::name('AppImage')->where($where)->order($order)->limit($limit_str)->select(); + + return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list]; + } + + public function infoData($where,$field='*') + { + if(!is_array($where)){ + $where = json_decode($where,true); + } + $info = Db::name('AppImage')->where($where)->field($field)->find(); + if(empty($info)){ + return ['code'=>1001,'msg'=>lang('data_not_exist')]; + } + return ['code'=>1,'msg'=>lang('data_info'),'info'=>$info]; + } + + public function saveData($data) + { + $validate = \think\Loader::validate('AppImage'); + if(!$validate->check($data)){ + return ['code'=>1001,'msg'=>lang('param_err').':'.$validate->getError() ]; + } + if(empty($data['image_id'])){ + $data['image_time_add'] = time(); + $data['image_time'] = time(); + $res = Db::name('AppImage')->insert($data); + } + else{ + $data['image_time'] = time(); + $res = Db::name('AppImage')->where('image_id',$data['image_id'])->update($data); + } + if(false === $res){ + return ['code'=>1002,'msg'=>lang('save_err')]; + } + return ['code'=>1,'msg'=>lang('save_ok')]; + } + + public function delData($where) + { + if(!is_array($where)){ + $where = json_decode($where,true); + } + $res = Db::name('AppImage')->where($where)->delete(); + if($res===false){ + return ['code'=>1001,'msg'=>lang('del_err')]; + } + return ['code'=>1,'msg'=>lang('del_ok')]; + } + +} diff --git a/application/common/validate/AppImage.php b/application/common/validate/AppImage.php new file mode 100644 index 000000000..a4d29585f --- /dev/null +++ b/application/common/validate/AppImage.php @@ -0,0 +1,20 @@ + 'require|in:1,2', + 'image_title' => 'require|max:255', + 'image_pic' => 'require', + ]; + + protected $message = [ + 'image_type.require' => '图片类型不能为空', + 'image_type.in' => '图片类型错误', + 'image_title.require'=> '图片标题不能为空', + 'image_title.max' => '图片标题最多255个字符', + 'image_pic.require' => '图片地址不能为空', + ]; +} diff --git a/application/data/update/database.php b/application/data/update/database.php index 4571b54c6..72e82f4b5 100644 --- a/application/data/update/database.php +++ b/application/data/update/database.php @@ -12,6 +12,10 @@ $sql .= "CREATE TABLE `mac_manga` ( `manga_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '漫画ID', `type_id` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '主分类ID', `type_id_1` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '副分类ID', `group_id` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '会员组ID', `manga_name` varchar(255) NOT NULL DEFAULT '' COMMENT '漫画名称', `manga_sub` varchar(255) NOT NULL DEFAULT '' COMMENT '副标题', `manga_en` varchar(255) NOT NULL DEFAULT '' COMMENT '英文名', `manga_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0=锁定,1=正常)', `manga_letter` char(1) NOT NULL DEFAULT '' COMMENT '首字母', `manga_color` varchar(6) NOT NULL DEFAULT '' COMMENT '标题颜色', `manga_from` varchar(30) NOT NULL DEFAULT '' COMMENT '来源', `manga_author` varchar(255) NOT NULL DEFAULT '' COMMENT '作者', `manga_tag` varchar(100) NOT NULL DEFAULT '' COMMENT '标签', `manga_class` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展分类', `manga_pic` varchar(1024) NOT NULL DEFAULT '' COMMENT '封面图', `manga_pic_thumb` varchar(1024) NOT NULL DEFAULT '' COMMENT '封面缩略图', `manga_pic_slide` varchar(1024) NOT NULL DEFAULT '' COMMENT '封面幻灯图', `manga_pic_screenshot` text DEFAULT NULL COMMENT '内容截图', `manga_blurb` varchar(255) NOT NULL DEFAULT '' COMMENT '简介', `manga_remarks` varchar(100) NOT NULL DEFAULT '' COMMENT '备注(例如:更新至xx话)', `manga_jumpurl` varchar(150) NOT NULL DEFAULT '' COMMENT '跳转URL', `manga_tpl` varchar(30) NOT NULL DEFAULT '' COMMENT '独立模板', `manga_level` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '推荐级别', `manga_lock` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '锁定状态(0=未锁,1=已锁)', `manga_points` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '点播所需积分', `manga_points_detail` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '每章所需积分', `manga_up` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '顶数', `manga_down` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '踩数', `manga_hits` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '总点击数', `manga_hits_day` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '日点击数', `manga_hits_week` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '周点击数', `manga_hits_month` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '月点击数', `manga_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `manga_time_add` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `manga_time_hits` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点击时间', `manga_time_make` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '生成时间', `manga_score` decimal(3,1) unsigned NOT NULL DEFAULT '0.0' COMMENT '平均评分', `manga_score_all` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '总评分', `manga_score_num` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '评分次数', `manga_rel_manga` varchar(255) NOT NULL DEFAULT '' COMMENT '关联漫画', `manga_rel_vod` varchar(255) NOT NULL DEFAULT '' COMMENT '关联视频', `manga_pwd` varchar(10) NOT NULL DEFAULT '' COMMENT '访问密码', `manga_pwd_url` varchar(255) NOT NULL DEFAULT '' COMMENT '密码跳转URL', `manga_content` mediumtext DEFAULT NULL COMMENT '详细介绍', `manga_serial` varchar(20) NOT NULL DEFAULT '0' COMMENT '连载状态(文字)', `manga_total` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '总章节数', `manga_chapter_from` varchar(255) NOT NULL DEFAULT '' COMMENT '章节来源', `manga_chapter_url` mediumtext DEFAULT NULL COMMENT '章节URL列表', `manga_last_update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后更新时间戳', `manga_age_rating` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '年龄分级(0=全年龄,1=12+,2=18+)', `manga_orientation` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '阅读方向(1=左到右,2=右到左,3=垂直)', `manga_is_vip` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否VIP(0=否,1=是)', `manga_copyright_info` varchar(255) NOT NULL DEFAULT '' COMMENT '版权信息', PRIMARY KEY (`manga_id`), KEY `type_id` (`type_id`) USING BTREE, KEY `type_id_1` (`type_id_1`) USING BTREE, KEY `manga_level` (`manga_level`) USING BTREE, KEY `manga_hits` (`manga_hits`) USING BTREE, KEY `manga_time` (`manga_time`) USING BTREE, KEY `manga_letter` (`manga_letter`) USING BTREE, KEY `manga_down` (`manga_down`) USING BTREE, KEY `manga_up` (`manga_up`) USING BTREE, KEY `manga_tag` (`manga_tag`) USING BTREE, KEY `manga_name` (`manga_name`) USING BTREE, KEY `manga_en` (`manga_en`) USING BTREE, KEY `manga_hits_day` (`manga_hits_day`) USING BTREE, KEY `manga_hits_week` (`manga_hits_week`) USING BTREE, KEY `manga_hits_month` (`manga_hits_month`) USING BTREE, KEY `manga_time_add` (`manga_time_add`) USING BTREE, KEY `manga_time_make` (`manga_time_make`) USING BTREE, KEY `manga_lock` (`manga_lock`), KEY `manga_score` (`manga_score`), KEY `manga_score_all` (`manga_score_all`), KEY `manga_score_num` (`manga_score_num`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='漫画表';"; $sql .="\r"; } +if(empty($col_list[$pre.'app_image'])){ + $sql .= "CREATE TABLE `mac_app_image` ( `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '图片ID', `image_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '图片类型(1=启动页,2=Banner广告)', `image_title` varchar(255) NOT NULL DEFAULT '' COMMENT '图片标题', `image_pic` varchar(1024) NOT NULL DEFAULT '' COMMENT '图片地址', `image_link` varchar(500) NOT NULL DEFAULT '' COMMENT '跳转链接', `image_sort` int(10) NOT NULL DEFAULT '0' COMMENT '排序', `image_status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(0=禁用,1=启用)', `image_remarks` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', `image_time_add` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `image_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`image_id`), KEY `image_type` (`image_type`), KEY `image_status` (`image_status`), KEY `image_sort` (`image_sort`)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='APP图片管理表';"; + $sql .="\r"; +} /*updates*/ if(empty($col_list[$pre.'art']['art_pic_screenshot'])){ $sql .= "ALTER TABLE `mac_art` ADD `art_pic_screenshot` text;"; diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index 533bd54d1..548909483 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -640,4 +640,52 @@ protected function format_sql_string($str) $str = trim(preg_replace('/\s+/', ' ', $str)); return $str; } + + /** + * 获取APP图片列表(启动页、Banner广告) + * + * @param Request $request + * @return \think\response\Json + */ + public function get_app_images(Request $request) + { + $param = $request->param(); + + // 查询条件 + $where = []; + $where['image_status'] = ['eq', 1]; // 只获取启用的图片 + + // 图片类型: 1=启动页, 2=Banner广告 + if (isset($param['image_type']) && in_array($param['image_type'], ['1', '2'])) { + $where['image_type'] = ['eq', $param['image_type']]; + } + + // 排序 + $order = 'image_sort asc, image_id desc'; + + // 获取数据 + $res = model('AppImage')->listData($where, $order, 1, 100); + + if ($res['code'] == 1 && !empty($res['list'])) { + foreach ($res['list'] as &$item) { + // 处理图片地址 + $item['image_pic'] = mac_url_img($item['image_pic']); + // 只返回必要字段 + $item = [ + 'id' => $item['image_id'], + 'type' => $item['image_type'], + 'title' => $item['image_title'], + 'pic' => $item['image_pic'], + 'link' => $item['image_link'], + 'sort' => $item['image_sort'], + ]; + } + } + + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'data' => $res['list'] ?? [] + ]); + } } \ No newline at end of file diff --git a/application/install/sql/install.sql b/application/install/sql/install.sql index 6ffc65788..d2735e91c 100644 --- a/application/install/sql/install.sql +++ b/application/install/sql/install.sql @@ -962,6 +962,28 @@ CREATE TABLE `mac_website` ( ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ; +-- ---------------------------- +-- Table structure for mac_app_image +-- ---------------------------- +DROP TABLE IF EXISTS `mac_app_image`; +CREATE TABLE `mac_app_image` ( + `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '图片ID', + `image_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '图片类型(1=启动页,2=Banner广告)', + `image_title` varchar(255) NOT NULL DEFAULT '' COMMENT '图片标题', + `image_pic` varchar(1024) NOT NULL DEFAULT '' COMMENT '图片地址', + `image_link` varchar(500) NOT NULL DEFAULT '' COMMENT '跳转链接', + `image_sort` int(10) NOT NULL DEFAULT '0' COMMENT '排序', + `image_status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(0=禁用,1=启用)', + `image_remarks` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', + `image_time_add` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', + `image_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', + PRIMARY KEY (`image_id`), + KEY `image_type` (`image_type`), + KEY `image_status` (`image_status`), + KEY `image_sort` (`image_sort`) +) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='APP图片管理表'; + + -- ---------------------------- -- Table structure for mac_vod_search -- ---------------------------- From 5bdaf85c9477908f84506e19152098132c9eb4fe Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Wed, 4 Feb 2026 18:00:41 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/common/auth.php | 56 +++++++++++++++---------------- runtime/.gitignore | 2 -- runtime/index.html | 0 3 files changed, 28 insertions(+), 30 deletions(-) delete mode 100755 runtime/.gitignore delete mode 100644 runtime/index.html diff --git a/application/admin/common/auth.php b/application/admin/common/auth.php index 2d289d8dc..1bc3335e4 100644 --- a/application/admin/common/auth.php +++ b/application/admin/common/auth.php @@ -407,34 +407,6 @@ 'controller' => 'annex', 'action' => 'data', ), - 37 => - array ( - 'show' => 1, - 'name' => '图片管理', - 'controller' => 'appimage', - 'action' => 'index', - ), - 3701 => - array ( - 'show' => 0, - 'name' => '--图片信息维护', - 'controller' => 'appimage', - 'action' => 'info', - ), - 3702 => - array ( - 'show' => 0, - 'name' => '--图片批量修改', - 'controller' => 'appimage', - 'action' => 'batch', - ), - 3703 => - array ( - 'show' => 0, - 'name' => '--图片删除', - 'controller' => 'appimage', - 'action' => 'del', - ), 3604 => array ( 'show' => 0, @@ -477,6 +449,34 @@ 'controller' => 'images', 'action' => 'sync', ), + 37 => + array ( + 'show' => 1, + 'name' => '图片管理', + 'controller' => 'appimage', + 'action' => 'index', + ), + 3701 => + array ( + 'show' => 0, + 'name' => '--图片信息维护', + 'controller' => 'appimage', + 'action' => 'info', + ), + 3702 => + array ( + 'show' => 0, + 'name' => '--图片批量修改', + 'controller' => 'appimage', + 'action' => 'batch', + ), + 3703 => + array ( + 'show' => 0, + 'name' => '--图片删除', + 'controller' => 'appimage', + 'action' => 'del', + ), ), ), 5 => diff --git a/runtime/.gitignore b/runtime/.gitignore deleted file mode 100755 index c96a04f00..000000000 --- a/runtime/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/runtime/index.html b/runtime/index.html deleted file mode 100644 index e69de29bb..000000000 From 0f7c58ced642094d451bf4aeca3a09c7debc5046 Mon Sep 17 00:00:00 2001 From: tomas123 Date: Wed, 4 Feb 2026 21:17:03 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/appimage/info.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/admin/view/appimage/info.html b/application/admin/view/appimage/info.html index e91a2b975..c9138ba5b 100644 --- a/application/admin/view/appimage/info.html +++ b/application/admin/view/appimage/info.html @@ -90,10 +90,9 @@ // 上传图片 upload.render({ elem: '#upload_pic' - , url: '{:url("upload/upload")}' - , data: {flag: 'app'} - , accept: 'images' - , acceptMime: 'image/*' + + , url: '{:url("upload/upload")}?flag=app' + , method: 'post' , before: function(obj){ layer.load(); } From 3639ab1c7df92495d32c149f14c2d2be17f3b678 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Thu, 5 Feb 2026 15:06:18 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/appimage/info.html | 50 +++++++++++------------ application/index/controller/Ajax.php | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/application/admin/view/appimage/info.html b/application/admin/view/appimage/info.html index c9138ba5b..9595356fd 100644 --- a/application/admin/view/appimage/info.html +++ b/application/admin/view/appimage/info.html @@ -20,20 +20,14 @@
- - +
-
- - -
- {if condition="isset($info.image_pic) && $info.image_pic"} - - {/if} -
+
+ +
+
+
@@ -89,25 +83,31 @@ // 上传图片 upload.render({ - elem: '#upload_pic' - - , url: '{:url("upload/upload")}?flag=app' + elem: '.layui-upload' + , url: "{:url('upload/upload')}?flag=app" , method: 'post' , before: function(obj){ - layer.load(); + console.log('开始上传文件'); + layer.msg('上传中...', {time:3000000}); } - , done: function(res){ - layer.closeAll('loading'); - if(res.code == 1){ - $('#image_pic').val(res.file); - $('#pic_preview').html(''); - layer.msg('上传成功'); - } else { - layer.msg(res.msg || '上传失败'); + , done: function(res, index, upload) { + var obj = this.item; + console.log('上传返回:', res); // 调试信息 + if (res.code == 0) { + layer.closeAll(); + layer.msg(res.msg); + return false; + } + layer.closeAll(); + var input = $(obj).parent().parent().find('.upload-input'); + if ($(obj).attr('lay-type') == 'image') { + input.siblings('img').attr('src', res.data.file).show(); } + input.val(res.data.file); + layer.msg('上传成功'); } , error: function(){ - layer.closeAll('loading'); + layer.closeAll(); layer.msg('上传失败'); } }); diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index 548909483..5e727db9b 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -685,7 +685,7 @@ public function get_app_images(Request $request) return json([ 'code' => 1, 'msg' => '获取成功', - 'data' => $res['list'] ?? [] + 'info' => $res['list'] ?? [] ]); } } \ No newline at end of file From cde953d8a7c0cc71c964e32f0df1298de1a38339 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Mon, 9 Feb 2026 17:21:34 +0800 Subject: [PATCH 12/20] =?UTF-8?q?get=5Fvod=5Flist=20=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Ajax.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index 5e727db9b..db5879ce9 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -587,6 +587,10 @@ public function get_vod_list(Request $request) $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; // $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field, []); $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field); + //把vod_time 字段转换为时间字符串 + foreach ($list as &$value) { + $value['vod_time'] = date('Y-m-d H:i:s', $value['vod_time']); + } } // 返回 return json([ From 1873fd8500f4dcbcdf80bc654158ec7785ed1065 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Tue, 10 Feb 2026 10:58:29 +0800 Subject: [PATCH 13/20] =?UTF-8?q?get=5Fvod=5Flist=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index db5879ce9..e1d3c0be9 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -549,7 +549,7 @@ public function get_vod_list(Request $request) $where['type_id'] = (int)$param['type_id']; } if (isset($param['id'])) { - $where['vod_id'] = $param['id']; + $where['vod_id'] =(int) $param['id']; } // if (isset($param['type_id_1'])) { // $where['type_id_1'] = (int)$param['type_id_1']; @@ -561,7 +561,7 @@ public function get_vod_list(Request $request) $where['vod_tag'] = ['like', '%' . $this->format_sql_string($param['vod_tag']) . '%']; } if (isset($param['vod_name']) && strlen($param['vod_name']) > 0) { - $where['vod_name'] = ['like', '%'.$param['vod_name'].'%']; + $where['vod_name'] = ['like', '%'.$this->format_sql_string($param['vod_name']).'%']; } if (isset($param['vod_blurb']) && strlen($param['vod_blurb']) > 0) { $where['vod_blurb'] = ['like', '%' . $this->format_sql_string($param['vod_blurb']) . '%']; From d11f48bb98e38e39ee40e39b7ebbfab490d688d6 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Tue, 10 Feb 2026 11:10:36 +0800 Subject: [PATCH 14/20] =?UTF-8?q?Vod.get=5Flist=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Vod.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/controller/Vod.php b/application/api/controller/Vod.php index e05475be7..46aae6e9a 100644 --- a/application/api/controller/Vod.php +++ b/application/api/controller/Vod.php @@ -48,7 +48,7 @@ public function get_list(Request $request) $where['type_id'] = (int)$param['type_id']; } if (isset($param['id'])) { - $where['vod_id'] = $param['id']; + $where['vod_id'] = (int)$param['id']; } // if (isset($param['type_id_1'])) { // $where['type_id_1'] = (int)$param['type_id_1']; @@ -60,7 +60,7 @@ public function get_list(Request $request) $where['vod_tag'] = ['like', '%' . $this->format_sql_string($param['vod_tag']) . '%']; } if (isset($param['vod_name']) && strlen($param['vod_name']) > 0) { - $where['vod_name'] = ['like', '%'.$param['vod_name'].'%']; + $where['vod_name'] = ['like', '%'.$this->format_sql_string($param['vod_name']).'%']; } if (isset($param['vod_blurb']) && strlen($param['vod_blurb']) > 0) { $where['vod_blurb'] = ['like', '%' . $this->format_sql_string($param['vod_blurb']) . '%']; From ab99a01c116cc073b568ca5471773d456aadfeca Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Tue, 10 Feb 2026 11:50:05 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Comment.php | 89 +++++++++++++++++++++++- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/application/index/controller/Comment.php b/application/index/controller/Comment.php index 58d5d25bd..8f874701d 100644 --- a/application/index/controller/Comment.php +++ b/application/index/controller/Comment.php @@ -35,6 +35,92 @@ public function ajax() { } public function saveData() { + $param = input(); + if($GLOBALS['config']['comment']['verify'] == 1){ + if(!captcha_check($param['verify'])){ + return ['code'=>1002,'msg'=>lang('verify_err')]; + } + } + if($GLOBALS['config']['comment']['login'] ==1){ + if(empty(cookie('user_id'))){ + return ['code' => 1003, 'msg' =>lang('index/require_login')]; + } + $res = model('User')->checkLogin(); + if($res['code']>1) { + return ['code' => 1003, 'msg' => lang('index/require_login')]; + } + } + + if(empty($param['comment_content'])){ + return ['code'=>1004,'msg'=>lang('index/require_content')]; + } + + $cookie = 'comment_timespan'; + if(!empty(cookie($cookie))){ + return ['code'=>1005,'msg'=>lang('frequently')]; + } + + $param['comment_content']= htmlentities(mac_filter_words($param['comment_content'])); + // if(!preg_match('/[^\x00-\x80]/',$param['comment_content'])){ + // return ['code'=>1005,'msg'=>lang('index/require_cn')]; + // } + + if(!in_array($param['comment_mid'],['1','2','3','8','9','11'])){ + return ['code'=>1006,'msg'=>lang('index/mid_err')]; + } + + if(empty(cookie('user_id'))){ + $param['comment_name'] = lang('controller/visitor'); + } + else{ + $param['comment_name'] = cookie('user_name'); + $param['user_id'] = intval(cookie('user_id')); + $user_data = model('User')->field('user_nick_name')->where(['user_id' => $param['user_id']])->find(); + if (!empty($user_data['user_nick_name'])) { + $param['comment_name'] = $user_data['user_nick_name']; + } + } + $param['comment_name'] = htmlentities(trim($param['comment_name'])); + $param['comment_rid'] = intval($param['comment_rid']); + $param['comment_pid'] = intval($param['comment_pid']); + if($GLOBALS['config']['comment']['audit'] ==1){ + $param['comment_status'] = 0; + } + + $param['comment_ip'] = mac_get_ip_long(); + $blcaks = config('blacks'); + //判断黑名单关键字是否为空 不为空并且大于0则循环判断是否包含黑名单关键字 + if(!empty($blcaks['black_keyword_list']) && count($blcaks['black_keyword_list']) > 0){ + foreach ($blcaks['black_keyword_list'] as $key => $value) { + if(strpos($param['comment_content'], $value) !== false){ + return ['code'=>1007,'msg'=>lang('index/blacklist_keyword')]; + } + } + } + //判断黑名单IP是否为空 不为空并且大于0则循环判断客户端ip是否包含黑名单ip + if(!empty($blcaks['black_ip_list']) && count($blcaks['black_ip_list']) > 0){ + $client_ip = long2ip($param['comment_ip']); + if (in_array($client_ip, $blcaks['black_ip_list'])){ + return ['code'=>1008,'msg'=>lang('index/blacklist_ip')]; + } + } + + $res = model('Comment')->saveData($param); + if($res['code']>1){ + return $res; + } + else{ + cookie($cookie, 't', $GLOBALS['config']['comment']['timespan']); + if($GLOBALS['config']['comment']['audit'] ==1){ + $res['msg'] = lang('index/thanks_msg_audit'); + } + else{ + $res['msg'] = lang('index/thanks_msg'); + } + return $res; + } + } + public function saveAppData() { $param = input(); if($GLOBALS['config']['comment']['verify'] == 1){ if(!captcha_check($param['verify'])){ @@ -106,7 +192,6 @@ public function saveData() { } $res = model('Comment')->saveData($param); - slog('评论保存结果: ' . json_encode($res)); if($res['code']>1){ return json($res); } @@ -118,11 +203,9 @@ public function saveData() { else{ $res['msg'] = lang('index/thanks_msg'); } - slog('最终返回结果: ' . json_encode($res)); return json($res); } } - public function report() { $param = input(); From bb119ca52fd994874e9bc14a01b03f2db0ad0ae6 Mon Sep 17 00:00:00 2001 From: tomas123 Date: Tue, 10 Feb 2026 22:12:02 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Type.php | 2 +- application/api/controller/Vod.php | 4 +- application/common/validate/Ajax.php | 20 +-- application/common/validate/Type.php | 4 + application/common/validate/Vod.php | 26 ++++ application/index/controller/Ajax.php | 176 +------------------------- application/index/controller/Type.php | 59 +++++++++ application/index/controller/Vod.php | 122 ++++++++++++++++++ 8 files changed, 217 insertions(+), 196 deletions(-) create mode 100644 application/index/controller/Type.php diff --git a/application/api/controller/Type.php b/application/api/controller/Type.php index 5992d52d0..966234d26 100644 --- a/application/api/controller/Type.php +++ b/application/api/controller/Type.php @@ -57,7 +57,7 @@ public function get_list(Request $request) foreach ($list as $index => $item) { $child_total = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->count(); if ($child_total > 0) { - $child = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->order('type_sort ASC')->select(); + $child = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->select(); $list[$index]['child'] = $child; } } diff --git a/application/api/controller/Vod.php b/application/api/controller/Vod.php index 46aae6e9a..9e6206988 100644 --- a/application/api/controller/Vod.php +++ b/application/api/controller/Vod.php @@ -60,7 +60,7 @@ public function get_list(Request $request) $where['vod_tag'] = ['like', '%' . $this->format_sql_string($param['vod_tag']) . '%']; } if (isset($param['vod_name']) && strlen($param['vod_name']) > 0) { - $where['vod_name'] = ['like', '%'.$this->format_sql_string($param['vod_name']).'%']; + $where['vod_name'] = ['like', '%' . $this->format_sql_string($param['vod_name']) . '%']; } if (isset($param['vod_blurb']) && strlen($param['vod_blurb']) > 0) { $where['vod_blurb'] = ['like', '%' . $this->format_sql_string($param['vod_blurb']) . '%']; @@ -83,7 +83,7 @@ public function get_list(Request $request) if (strlen($param['orderby']) > 0) { $order = 'vod_' . $param['orderby'] . " DESC"; } - $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; + $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year'; // $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field, []); $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field); } diff --git a/application/common/validate/Ajax.php b/application/common/validate/Ajax.php index 81a15d5fe..60c9f7157 100644 --- a/application/common/validate/Ajax.php +++ b/application/common/validate/Ajax.php @@ -25,24 +25,6 @@ class Ajax extends Validate ]; protected $scene = [ - 'get_list' => [ - 'type_id', - ], - 'get_vod_list' => [ - 'id', - 'offset', - 'limit', - 'orderby', - 'type_id', -// 'type_id_1', - 'vod_letter', - 'vod_name', - 'vod_tag', - 'vod_blurb', - 'vod_class', - ], - 'get_vod_detail' => [ - 'vod_id', - ], + ]; } \ No newline at end of file diff --git a/application/common/validate/Type.php b/application/common/validate/Type.php index 1e5a43989..ea72d8b58 100644 --- a/application/common/validate/Type.php +++ b/application/common/validate/Type.php @@ -5,6 +5,7 @@ class Type extends Validate { protected $rule = [ + 'type_id' => 'number|between:1,' . PHP_INT_MAX, 'type_name' => 'require', ]; @@ -14,6 +15,9 @@ class Type extends Validate ]; protected $scene = [ + 'get_list' => [ + 'type_id', + ], 'add'=> ['type_name'], 'edit'=> ['type_name'], ]; diff --git a/application/common/validate/Vod.php b/application/common/validate/Vod.php index 755966b09..f01315b8e 100644 --- a/application/common/validate/Vod.php +++ b/application/common/validate/Vod.php @@ -7,6 +7,17 @@ class Vod extends Validate protected $rule = [ 'vod_name' => 'require', 'type_id' => 'require', + 'type_id' => 'number|between:1,' . PHP_INT_MAX, + 'vod_id' => 'require|number|between:0,' . PHP_INT_MAX, + 'id' => 'number|between:0,' . PHP_INT_MAX, + 'offset' => 'number|between:0,' . PHP_INT_MAX, + 'limit' => 'number|between:1,500', + 'orderby' => 'in:hits,up,pubdate,hits_week,hits_month,hits_day,score', + 'vod_letter' => 'max:1', + 'vod_name' => 'max:50', + 'vod_tag' => 'max:20', + 'vod_blurb' => 'max:20', + 'vod_class' => 'max:10', ]; protected $message = [ @@ -17,6 +28,21 @@ class Vod extends Validate protected $scene = [ 'add' => ['vod_name','type_id'], 'edit' => ['vod_name','type_id'], + 'get_vod_list' => [ + 'id', + 'offset', + 'limit', + 'orderby', + 'type_id', + 'vod_letter', + 'vod_name', + 'vod_tag', + 'vod_blurb', + 'vod_class', + ], + 'get_vod_detail' => [ + 'vod_id', + ], ]; diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index e1d3c0be9..85d5e70a0 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -470,180 +470,8 @@ public function verify_check() session($param['type'].'_verify','1'); return json(['code'=>1,'msg'=>lang('ok')]); } - /** - * 获取分类树 - * - * @param Request $request - * @return \think\response\Json - */ - public function get_list(Request $request) - { - // 参数校验 - // 参数校验 - $param = $request->param(); - $validate = validate($request->controller()); - if (!$validate->scene($request->action())->check($param)) { - return json([ - 'code' => 1001, - 'msg' => '参数错误: ' . $validate->getError(), - ]); - } - // 查询条件组装 - $where = []; - // 查询第一级 - $where['type_pid'] = 0; - - if (isset($param['type_id'])) { - $where['type_id'] = (int)$param['type_id']; - } - - // 数据获取 - $total = model('Type')->getCountByCond($where); - $list = []; - if ($total > 0) { - // 排序 - $order = "type_sort DESC"; - $field = '*'; - $list = model('Type')->getListByCond(0, PHP_INT_MAX, $where, $order, $field, []); - foreach ($list as $index => $item) { - $child_total = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->count(); - if ($child_total > 0) { - $child = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->order('type_sort ASC')->select(); - $list[$index]['child'] = $child; - } - } - } - // 返回 - return json([ - 'code' => 1, - 'msg' => '获取成功', - 'info' => [ - 'total' => $total, - 'rows' => $list, - ], - ]); - } - - /** - * 获取视频列表 - * - * @param Request $request - * @return \think\response\Json - */ - public function get_vod_list(Request $request) - { - // 参数校验 - $param = $request->param(); - $validate = validate($request->controller()); - if (!$validate->scene($request->action())->check($param)) { - return json([ - 'code' => 1001, - 'msg' => '参数错误: ' . $validate->getError(), - ]); - } - $offset = isset($param['offset']) ? (int)$param['offset'] : 0; - $limit = isset($param['limit']) ? (int)$param['limit'] : 20; - // 查询条件组装 - $where = []; - if (isset($param['type_id'])) { - $where['type_id'] = (int)$param['type_id']; - } - if (isset($param['id'])) { - $where['vod_id'] =(int) $param['id']; - } -// if (isset($param['type_id_1'])) { -// $where['type_id_1'] = (int)$param['type_id_1']; -// } - if (!empty($param['vod_letter'])) { - $where['vod_letter'] = $param['vod_letter']; - } - if (isset($param['vod_tag']) && strlen($param['vod_tag']) > 0) { - $where['vod_tag'] = ['like', '%' . $this->format_sql_string($param['vod_tag']) . '%']; - } - if (isset($param['vod_name']) && strlen($param['vod_name']) > 0) { - $where['vod_name'] = ['like', '%'.$this->format_sql_string($param['vod_name']).'%']; - } - if (isset($param['vod_blurb']) && strlen($param['vod_blurb']) > 0) { - $where['vod_blurb'] = ['like', '%' . $this->format_sql_string($param['vod_blurb']) . '%']; - } - if (isset($param['vod_class']) && strlen($param['vod_class']) > 0) { - $where['vod_class'] = ['like', '%' . $this->format_sql_string($param['vod_class']) . '%']; - } - if (isset($param['vod_area']) && strlen($param['vod_area']) > 0) { - $where['vod_area'] = $this->format_sql_string($param['vod_area']); - } - if (isset($param['vod_year']) && strlen($param['vod_year']) > 0) { - $where['vod_year'] = $this->format_sql_string($param['vod_year']); - } - // 数据获取 - $total = model('Vod')->getCountByCond($where); - $list = []; - if ($total > 0) { - // 排序 - $order = "vod_time DESC"; - if (strlen($param['orderby']) > 0) { - $order = 'vod_' . $param['orderby'] . " DESC"; - } - $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; -// $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field, []); - $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field); - //把vod_time 字段转换为时间字符串 - foreach ($list as &$value) { - $value['vod_time'] = date('Y-m-d H:i:s', $value['vod_time']); - } - } - // 返回 - return json([ - 'code' => 1, - 'msg' => '获取成功', - 'info' => [ - 'offset' => $offset, - 'limit' => $limit, - 'total' => $total, - 'rows' => $list, - ], - ]); - } - /** - * 视频详细信息 - * - * @param Request $request - * @return \think\response\Json - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\ModelNotFoundException - * @throws \think\exception\DbException - */ - public function get_vod_detail(Request $request) - { - $param = $request->param(); - $validate = validate($request->controller()); - if (!$validate->scene($request->action())->check($param)) { - return json([ - 'code' => 1001, - 'msg' => '参数错误: ' . $validate->getError(), - ]); - } - - $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->find(); - //判断vod_rel_vod 字段是否为空 - if (!empty($res['vod_rel_vod'])) { - $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; - $res['vod_rel_vod_list'] = Db::table('mac_vod')->where(['vod_id' => ['in', $res['vod_rel_vod']]])->field($field)->select(); - } - // 返回 - return json([ - 'code' => 1, - 'msg' => '获取成功', - 'info' => $res - ]); - } - protected function format_sql_string($str) - { - $str = preg_replace('/\b(SELECT|INSERT|UPDATE|DELETE|DROP|UNION|WHERE|FROM|JOIN|INTO|VALUES|SET|AND|OR|NOT|EXISTS|HAVING|GROUP BY|ORDER BY|LIMIT|OFFSET)\b/i', '', $str); - $str = preg_replace('/[^\w\s\-\.]/', '', $str); - $str = trim(preg_replace('/\s+/', ' ', $str)); - return $str; - } + + /** * 获取APP图片列表(启动页、Banner广告) diff --git a/application/index/controller/Type.php b/application/index/controller/Type.php new file mode 100644 index 000000000..ea591d293 --- /dev/null +++ b/application/index/controller/Type.php @@ -0,0 +1,59 @@ +param(); + $validate = validate($request->controller()); + if (!$validate->scene($request->action())->check($param)) { + return json([ + 'code' => 1001, + 'msg' => '参数错误: ' . $validate->getError(), + ]); + } + // 查询条件组装 + $where = []; + // 查询第一级 + $where['type_pid'] = 0; + + if (isset($param['type_id'])) { + $where['type_id'] = (int)$param['type_id']; + } + + // 数据获取 + $total = model('Type')->getCountByCond($where); + $list = []; + if ($total > 0) { + // 排序 + $order = "type_sort DESC"; + $field = '*'; + $list = model('Type')->getListByCond(0, PHP_INT_MAX, $where, $order, $field, []); + foreach ($list as $index => $item) { + $child_total = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->count(); + if ($child_total > 0) { + $child = Db::table('mac_type')->where(['type_pid' => $item['type_id']])->order('type_sort ASC')->select(); + $list[$index]['child'] = $child; + } + } + } + // 返回 + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'info' => [ + 'total' => $total, + 'rows' => $list, + ], + ]); + } +} diff --git a/application/index/controller/Vod.php b/application/index/controller/Vod.php index cb6456722..a85898d9f 100644 --- a/application/index/controller/Vod.php +++ b/application/index/controller/Vod.php @@ -1,6 +1,8 @@ label_fetch('vod/plot'); } + /** + * 获取视频列表 + * + * @param Request $request + * @return \think\response\Json + */ + public function get_vod_list(Request $request) + { + // 参数校验 + $param = $request->param(); + $validate = validate($request->controller()); + if (!$validate->scene($request->action())->check($param)) { + return json([ + 'code' => 1001, + 'msg' => '参数错误: ' . $validate->getError(), + ]); + } + $offset = isset($param['offset']) ? (int)$param['offset'] : 0; + $limit = isset($param['limit']) ? (int)$param['limit'] : 20; + // 查询条件组装 + $where = []; + if (isset($param['type_id'])) { + $where['type_id'] = (int)$param['type_id']; + } + if (isset($param['id'])) { + $where['vod_id'] =(int) $param['id']; + } +// if (isset($param['type_id_1'])) { +// $where['type_id_1'] = (int)$param['type_id_1']; +// } + if (!empty($param['vod_letter'])) { + $where['vod_letter'] = $param['vod_letter']; + } + if (isset($param['vod_tag']) && strlen($param['vod_tag']) > 0) { + $where['vod_tag'] = ['like', '%' . $this->format_sql_string($param['vod_tag']) . '%']; + } + if (isset($param['vod_name']) && strlen($param['vod_name']) > 0) { + $where['vod_name'] = ['like', '%'.$this->format_sql_string($param['vod_name']).'%']; + } + if (isset($param['vod_blurb']) && strlen($param['vod_blurb']) > 0) { + $where['vod_blurb'] = ['like', '%' . $this->format_sql_string($param['vod_blurb']) . '%']; + } + if (isset($param['vod_class']) && strlen($param['vod_class']) > 0) { + $where['vod_class'] = ['like', '%' . $this->format_sql_string($param['vod_class']) . '%']; + } + if (isset($param['vod_area']) && strlen($param['vod_area']) > 0) { + $where['vod_area'] = $this->format_sql_string($param['vod_area']); + } + if (isset($param['vod_year']) && strlen($param['vod_year']) > 0) { + $where['vod_year'] = $this->format_sql_string($param['vod_year']); + } + // 数据获取 + $total = model('Vod')->getCountByCond($where); + $list = []; + if ($total > 0) { + // 排序 + $order = "vod_time DESC"; + if (strlen($param['orderby']) > 0) { + $order = 'vod_' . $param['orderby'] . " DESC"; + } + $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; +// $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field, []); + $list = model('Vod')->getListByCond($offset, $limit, $where, $order, $field); + //把vod_time 字段转换为时间字符串 + foreach ($list as &$value) { + $value['vod_time'] = date('Y-m-d H:i:s', $value['vod_time']); + } + } + // 返回 + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'info' => [ + 'offset' => $offset, + 'limit' => $limit, + 'total' => $total, + 'rows' => $list, + ], + ]); + } + /** + * 视频详细信息 + * + * @param Request $request + * @return \think\response\Json + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ + public function get_vod_detail(Request $request) + { + $param = $request->param(); + $validate = validate($request->controller()); + if (!$validate->scene($request->action())->check($param)) { + return json([ + 'code' => 1001, + 'msg' => '参数错误: ' . $validate->getError(), + ]); + } + + $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->find(); + //判断vod_rel_vod 字段是否为空 + if (!empty($res['vod_rel_vod'])) { + $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; + $res['vod_rel_vod_list'] = Db::table('mac_vod')->where(['vod_id' => ['in', $res['vod_rel_vod']]])->field($field)->select(); + } + // 返回 + return json([ + 'code' => 1, + 'msg' => '获取成功', + 'info' => $res + ]); + } + protected function format_sql_string($str) + { + $str = preg_replace('/\b(SELECT|INSERT|UPDATE|DELETE|DROP|UNION|WHERE|FROM|JOIN|INTO|VALUES|SET|AND|OR|NOT|EXISTS|HAVING|GROUP BY|ORDER BY|LIMIT|OFFSET)\b/i', '', $str); + $str = preg_replace('/[^\w\s\-\.]/', '', $str); + $str = trim(preg_replace('/\s+/', ' ', $str)); + return $str; + } } From ad3f65e1e1af4bb806ec2fc874eb36386ec53799 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Wed, 11 Feb 2026 12:30:15 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Vod.php | 2 +- application/api/validate/Comment.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/api/controller/Vod.php b/application/api/controller/Vod.php index 9e6206988..e1d7bc825 100644 --- a/application/api/controller/Vod.php +++ b/application/api/controller/Vod.php @@ -120,7 +120,7 @@ public function get_detail(Request $request) ]); } - $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->find(); + $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->select(); //判断vod_rel_vod 字段是否为空 if (!empty($res['vod_rel_vod'])) { $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; diff --git a/application/api/validate/Comment.php b/application/api/validate/Comment.php index 301cf21ff..000b6621e 100644 --- a/application/api/validate/Comment.php +++ b/application/api/validate/Comment.php @@ -7,7 +7,7 @@ class Comment extends Validate { protected $rule = [ - 'offset' => 'number|between:0,' . PHP_INT_MAX, + 'offset' => 'number|between:1,' . PHP_INT_MAX, 'limit' => 'number|between:1,' . PHP_INT_MAX, 'rid' => 'number|between:1,' . PHP_INT_MAX, 'orderby' => 'in:time,up,down' From 7c729615da35ae20c5a6c9fbe6a7f362e8b11c8b Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Wed, 11 Feb 2026 16:13:10 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/common/auth.php | 28 ----- application/admin/controller/Appimage.php | 118 ------------------- application/admin/view/appimage/index.html | 116 ------------------- application/admin/view/appimage/info.html | 128 --------------------- application/common/model/AppImage.php | 79 ------------- application/common/validate/AppImage.php | 20 ---- application/data/update/database.php | 4 - application/index/controller/Ajax.php | 50 -------- application/install/sql/install.sql | 21 ---- 9 files changed, 564 deletions(-) delete mode 100644 application/admin/controller/Appimage.php delete mode 100644 application/admin/view/appimage/index.html delete mode 100644 application/admin/view/appimage/info.html delete mode 100644 application/common/model/AppImage.php delete mode 100644 application/common/validate/AppImage.php diff --git a/application/admin/common/auth.php b/application/admin/common/auth.php index 1bc3335e4..d6f789c40 100644 --- a/application/admin/common/auth.php +++ b/application/admin/common/auth.php @@ -449,34 +449,6 @@ 'controller' => 'images', 'action' => 'sync', ), - 37 => - array ( - 'show' => 1, - 'name' => '图片管理', - 'controller' => 'appimage', - 'action' => 'index', - ), - 3701 => - array ( - 'show' => 0, - 'name' => '--图片信息维护', - 'controller' => 'appimage', - 'action' => 'info', - ), - 3702 => - array ( - 'show' => 0, - 'name' => '--图片批量修改', - 'controller' => 'appimage', - 'action' => 'batch', - ), - 3703 => - array ( - 'show' => 0, - 'name' => '--图片删除', - 'controller' => 'appimage', - 'action' => 'del', - ), ), ), 5 => diff --git a/application/admin/controller/Appimage.php b/application/admin/controller/Appimage.php deleted file mode 100644 index cd4b11ed0..000000000 --- a/application/admin/controller/Appimage.php +++ /dev/null @@ -1,118 +0,0 @@ -_pagesize : $param['limit']; - $where=[]; - - if(!empty($param['wd'])){ - $param['wd'] = htmlspecialchars(urldecode($param['wd'])); - $where['image_title'] = ['like','%'.$param['wd'].'%']; - } - - if(isset($param['image_type']) && $param['image_type'] !== ''){ - $where['image_type'] = ['eq',$param['image_type']]; - } - - if(isset($param['image_status']) && $param['image_status'] !== ''){ - $where['image_status'] = ['eq',$param['image_status']]; - } - - $order='image_sort asc,image_id desc'; - $res = model('AppImage')->listData($where,$order,$param['page'],$param['limit']); - - $this->assign('list',$res['list']); - $this->assign('total',$res['total']); - $this->assign('page',$res['page']); - $this->assign('limit',$res['limit']); - - $param['page'] = '{page}'; - $param['limit'] = '{limit}'; - $this->assign('param',$param); - $this->assign('title','图片管理'); - return $this->fetch('admin@appimage/index'); - } - - public function info() - { - if (Request()->isPost()) { - $param = input(); - - // 处理图片上传 - if(empty($param['image_pic'])){ - return $this->error('请上传图片'); - } - - $res = model('AppImage')->saveData($param); - if($res['code']>1){ - return $this->error($res['msg']); - } - return $this->success($res['msg']); - } - - $id = input('id'); - $info = []; - if($id){ - $where=[]; - $where['image_id'] = ['eq',$id]; - $res = model('AppImage')->infoData($where); - $info = $res['info']; - } - - $this->assign('info',$info); - $this->assign('title','图片管理'); - return $this->fetch('admin@appimage/info'); - } - - public function del() - { - $param = input(); - $ids = $param['ids']; - - if(!empty($ids)){ - $where=[]; - $where['image_id'] = ['in',$ids]; - $res = model('AppImage')->delData($where); - if($res['code']>1){ - return $this->error($res['msg']); - } - return $this->success($res['msg']); - } - return $this->error(lang('param_err')); - } - - public function batch() - { - $param = input(); - $ids = $param['ids']; - $col = $param['col']; - $val = $param['val']; - - if(!empty($ids) && !empty($col)){ - $where = []; - $where['image_id'] = ['in',$ids]; - $data = []; - $data[$col] = $val; - $data['image_time'] = time(); - - $res = Db::name('AppImage')->where($where)->update($data); - if($res===false){ - return $this->error(lang('save_err')); - } - return $this->success(lang('save_ok')); - } - return $this->error(lang('param_err')); - } - -} diff --git a/application/admin/view/appimage/index.html b/application/admin/view/appimage/index.html deleted file mode 100644 index d452236a0..000000000 --- a/application/admin/view/appimage/index.html +++ /dev/null @@ -1,116 +0,0 @@ -{include file="../../../application/admin/view/public/head" /} -
- -
-
-
-
- -
-
- -
-
- -
- -
-
- - - -
- -
- - - - - - - - - - - - - - - - - {volist name="list" id="vo"} - - - - - - - - - - - - - {/volist} - -
ID排序类型标题图片跳转链接状态更新时间操作
{$vo.image_id} - {if condition="$vo.image_type eq 1"} - 启动页 - {elseif condition="$vo.image_type eq 2"/} - Banner - {/if} - {$vo.image_title} - {if condition="$vo.image_pic"} - - {/if} - {$vo.image_link} - - {$vo.image_time|date='Y-m-d H:i:s',###} - 编辑 - 删除 -
-
- -
-
-{include file="../../../application/admin/view/public/foot" /} - - - - - diff --git a/application/admin/view/appimage/info.html b/application/admin/view/appimage/info.html deleted file mode 100644 index 9595356fd..000000000 --- a/application/admin/view/appimage/info.html +++ /dev/null @@ -1,128 +0,0 @@ -{include file="../../../application/admin/view/public/head" /} - -
-
- - -
- -
- -
-
- -
- -
- -
-
-
- -
- -
-
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
-
- - -
-
-
- -
- -{include file="../../../application/admin/view/public/foot" /} - - - - - diff --git a/application/common/model/AppImage.php b/application/common/model/AppImage.php deleted file mode 100644 index 4e765c4bd..000000000 --- a/application/common/model/AppImage.php +++ /dev/null @@ -1,79 +0,0 @@ - 0 ? (int)$page : 1; - $limit = $limit ? (int)$limit : 20; - $start = $start ? (int)$start : 0; - if(!is_array($where)){ - $where = json_decode($where,true); - } - $limit_str = ($limit * ($page-1) + $start) .",".$limit; - $total = $this->where($where)->count(); - $list = Db::name('AppImage')->where($where)->order($order)->limit($limit_str)->select(); - - return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list]; - } - - public function infoData($where,$field='*') - { - if(!is_array($where)){ - $where = json_decode($where,true); - } - $info = Db::name('AppImage')->where($where)->field($field)->find(); - if(empty($info)){ - return ['code'=>1001,'msg'=>lang('data_not_exist')]; - } - return ['code'=>1,'msg'=>lang('data_info'),'info'=>$info]; - } - - public function saveData($data) - { - $validate = \think\Loader::validate('AppImage'); - if(!$validate->check($data)){ - return ['code'=>1001,'msg'=>lang('param_err').':'.$validate->getError() ]; - } - if(empty($data['image_id'])){ - $data['image_time_add'] = time(); - $data['image_time'] = time(); - $res = Db::name('AppImage')->insert($data); - } - else{ - $data['image_time'] = time(); - $res = Db::name('AppImage')->where('image_id',$data['image_id'])->update($data); - } - if(false === $res){ - return ['code'=>1002,'msg'=>lang('save_err')]; - } - return ['code'=>1,'msg'=>lang('save_ok')]; - } - - public function delData($where) - { - if(!is_array($where)){ - $where = json_decode($where,true); - } - $res = Db::name('AppImage')->where($where)->delete(); - if($res===false){ - return ['code'=>1001,'msg'=>lang('del_err')]; - } - return ['code'=>1,'msg'=>lang('del_ok')]; - } - -} diff --git a/application/common/validate/AppImage.php b/application/common/validate/AppImage.php deleted file mode 100644 index a4d29585f..000000000 --- a/application/common/validate/AppImage.php +++ /dev/null @@ -1,20 +0,0 @@ - 'require|in:1,2', - 'image_title' => 'require|max:255', - 'image_pic' => 'require', - ]; - - protected $message = [ - 'image_type.require' => '图片类型不能为空', - 'image_type.in' => '图片类型错误', - 'image_title.require'=> '图片标题不能为空', - 'image_title.max' => '图片标题最多255个字符', - 'image_pic.require' => '图片地址不能为空', - ]; -} diff --git a/application/data/update/database.php b/application/data/update/database.php index 72e82f4b5..4571b54c6 100644 --- a/application/data/update/database.php +++ b/application/data/update/database.php @@ -12,10 +12,6 @@ $sql .= "CREATE TABLE `mac_manga` ( `manga_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '漫画ID', `type_id` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '主分类ID', `type_id_1` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '副分类ID', `group_id` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '会员组ID', `manga_name` varchar(255) NOT NULL DEFAULT '' COMMENT '漫画名称', `manga_sub` varchar(255) NOT NULL DEFAULT '' COMMENT '副标题', `manga_en` varchar(255) NOT NULL DEFAULT '' COMMENT '英文名', `manga_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0=锁定,1=正常)', `manga_letter` char(1) NOT NULL DEFAULT '' COMMENT '首字母', `manga_color` varchar(6) NOT NULL DEFAULT '' COMMENT '标题颜色', `manga_from` varchar(30) NOT NULL DEFAULT '' COMMENT '来源', `manga_author` varchar(255) NOT NULL DEFAULT '' COMMENT '作者', `manga_tag` varchar(100) NOT NULL DEFAULT '' COMMENT '标签', `manga_class` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展分类', `manga_pic` varchar(1024) NOT NULL DEFAULT '' COMMENT '封面图', `manga_pic_thumb` varchar(1024) NOT NULL DEFAULT '' COMMENT '封面缩略图', `manga_pic_slide` varchar(1024) NOT NULL DEFAULT '' COMMENT '封面幻灯图', `manga_pic_screenshot` text DEFAULT NULL COMMENT '内容截图', `manga_blurb` varchar(255) NOT NULL DEFAULT '' COMMENT '简介', `manga_remarks` varchar(100) NOT NULL DEFAULT '' COMMENT '备注(例如:更新至xx话)', `manga_jumpurl` varchar(150) NOT NULL DEFAULT '' COMMENT '跳转URL', `manga_tpl` varchar(30) NOT NULL DEFAULT '' COMMENT '独立模板', `manga_level` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '推荐级别', `manga_lock` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '锁定状态(0=未锁,1=已锁)', `manga_points` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '点播所需积分', `manga_points_detail` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '每章所需积分', `manga_up` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '顶数', `manga_down` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '踩数', `manga_hits` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '总点击数', `manga_hits_day` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '日点击数', `manga_hits_week` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '周点击数', `manga_hits_month` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '月点击数', `manga_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', `manga_time_add` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `manga_time_hits` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点击时间', `manga_time_make` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '生成时间', `manga_score` decimal(3,1) unsigned NOT NULL DEFAULT '0.0' COMMENT '平均评分', `manga_score_all` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '总评分', `manga_score_num` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '评分次数', `manga_rel_manga` varchar(255) NOT NULL DEFAULT '' COMMENT '关联漫画', `manga_rel_vod` varchar(255) NOT NULL DEFAULT '' COMMENT '关联视频', `manga_pwd` varchar(10) NOT NULL DEFAULT '' COMMENT '访问密码', `manga_pwd_url` varchar(255) NOT NULL DEFAULT '' COMMENT '密码跳转URL', `manga_content` mediumtext DEFAULT NULL COMMENT '详细介绍', `manga_serial` varchar(20) NOT NULL DEFAULT '0' COMMENT '连载状态(文字)', `manga_total` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '总章节数', `manga_chapter_from` varchar(255) NOT NULL DEFAULT '' COMMENT '章节来源', `manga_chapter_url` mediumtext DEFAULT NULL COMMENT '章节URL列表', `manga_last_update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后更新时间戳', `manga_age_rating` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '年龄分级(0=全年龄,1=12+,2=18+)', `manga_orientation` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '阅读方向(1=左到右,2=右到左,3=垂直)', `manga_is_vip` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否VIP(0=否,1=是)', `manga_copyright_info` varchar(255) NOT NULL DEFAULT '' COMMENT '版权信息', PRIMARY KEY (`manga_id`), KEY `type_id` (`type_id`) USING BTREE, KEY `type_id_1` (`type_id_1`) USING BTREE, KEY `manga_level` (`manga_level`) USING BTREE, KEY `manga_hits` (`manga_hits`) USING BTREE, KEY `manga_time` (`manga_time`) USING BTREE, KEY `manga_letter` (`manga_letter`) USING BTREE, KEY `manga_down` (`manga_down`) USING BTREE, KEY `manga_up` (`manga_up`) USING BTREE, KEY `manga_tag` (`manga_tag`) USING BTREE, KEY `manga_name` (`manga_name`) USING BTREE, KEY `manga_en` (`manga_en`) USING BTREE, KEY `manga_hits_day` (`manga_hits_day`) USING BTREE, KEY `manga_hits_week` (`manga_hits_week`) USING BTREE, KEY `manga_hits_month` (`manga_hits_month`) USING BTREE, KEY `manga_time_add` (`manga_time_add`) USING BTREE, KEY `manga_time_make` (`manga_time_make`) USING BTREE, KEY `manga_lock` (`manga_lock`), KEY `manga_score` (`manga_score`), KEY `manga_score_all` (`manga_score_all`), KEY `manga_score_num` (`manga_score_num`) ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='漫画表';"; $sql .="\r"; } -if(empty($col_list[$pre.'app_image'])){ - $sql .= "CREATE TABLE `mac_app_image` ( `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '图片ID', `image_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '图片类型(1=启动页,2=Banner广告)', `image_title` varchar(255) NOT NULL DEFAULT '' COMMENT '图片标题', `image_pic` varchar(1024) NOT NULL DEFAULT '' COMMENT '图片地址', `image_link` varchar(500) NOT NULL DEFAULT '' COMMENT '跳转链接', `image_sort` int(10) NOT NULL DEFAULT '0' COMMENT '排序', `image_status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(0=禁用,1=启用)', `image_remarks` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', `image_time_add` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', `image_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`image_id`), KEY `image_type` (`image_type`), KEY `image_status` (`image_status`), KEY `image_sort` (`image_sort`)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='APP图片管理表';"; - $sql .="\r"; -} /*updates*/ if(empty($col_list[$pre.'art']['art_pic_screenshot'])){ $sql .= "ALTER TABLE `mac_art` ADD `art_pic_screenshot` text;"; diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index 85d5e70a0..0d4d3624f 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -470,54 +470,4 @@ public function verify_check() session($param['type'].'_verify','1'); return json(['code'=>1,'msg'=>lang('ok')]); } - - - - /** - * 获取APP图片列表(启动页、Banner广告) - * - * @param Request $request - * @return \think\response\Json - */ - public function get_app_images(Request $request) - { - $param = $request->param(); - - // 查询条件 - $where = []; - $where['image_status'] = ['eq', 1]; // 只获取启用的图片 - - // 图片类型: 1=启动页, 2=Banner广告 - if (isset($param['image_type']) && in_array($param['image_type'], ['1', '2'])) { - $where['image_type'] = ['eq', $param['image_type']]; - } - - // 排序 - $order = 'image_sort asc, image_id desc'; - - // 获取数据 - $res = model('AppImage')->listData($where, $order, 1, 100); - - if ($res['code'] == 1 && !empty($res['list'])) { - foreach ($res['list'] as &$item) { - // 处理图片地址 - $item['image_pic'] = mac_url_img($item['image_pic']); - // 只返回必要字段 - $item = [ - 'id' => $item['image_id'], - 'type' => $item['image_type'], - 'title' => $item['image_title'], - 'pic' => $item['image_pic'], - 'link' => $item['image_link'], - 'sort' => $item['image_sort'], - ]; - } - } - - return json([ - 'code' => 1, - 'msg' => '获取成功', - 'info' => $res['list'] ?? [] - ]); - } } \ No newline at end of file diff --git a/application/install/sql/install.sql b/application/install/sql/install.sql index d2735e91c..b868b0524 100644 --- a/application/install/sql/install.sql +++ b/application/install/sql/install.sql @@ -962,27 +962,6 @@ CREATE TABLE `mac_website` ( ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ; --- ---------------------------- --- Table structure for mac_app_image --- ---------------------------- -DROP TABLE IF EXISTS `mac_app_image`; -CREATE TABLE `mac_app_image` ( - `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '图片ID', - `image_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '图片类型(1=启动页,2=Banner广告)', - `image_title` varchar(255) NOT NULL DEFAULT '' COMMENT '图片标题', - `image_pic` varchar(1024) NOT NULL DEFAULT '' COMMENT '图片地址', - `image_link` varchar(500) NOT NULL DEFAULT '' COMMENT '跳转链接', - `image_sort` int(10) NOT NULL DEFAULT '0' COMMENT '排序', - `image_status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(0=禁用,1=启用)', - `image_remarks` varchar(255) NOT NULL DEFAULT '' COMMENT '备注', - `image_time_add` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间', - `image_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间', - PRIMARY KEY (`image_id`), - KEY `image_type` (`image_type`), - KEY `image_status` (`image_status`), - KEY `image_sort` (`image_sort`) -) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='APP图片管理表'; - -- ---------------------------- -- Table structure for mac_vod_search From 6e407e4858e1776e4295c1a20d7d2d93617ff877 Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Thu, 12 Feb 2026 10:22:52 +0800 Subject: [PATCH 19/20] =?UTF-8?q?index=20=E4=B8=8B=E9=9D=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0config=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Config.php | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 application/index/controller/Config.php diff --git a/application/index/controller/Config.php b/application/index/controller/Config.php new file mode 100644 index 000000000..923d345b4 --- /dev/null +++ b/application/index/controller/Config.php @@ -0,0 +1,36 @@ + &$v) { + $v = mac_url_img($v); + } + } + + $res = [ + 'code' => 1, + 'msg' => '获取成功', + 'info' => [ + 'site_banner' => $banner_list, + 'site_app_launch_image' => isset($config['site']['site_app_launch_image']) ? mac_url_img($config['site']['site_app_launch_image']) : '', + ] + ]; + return json($res)->options(['json_encode_param' => JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE]); + } +} From 70ca6bbb6ba917abc942a7245c974da57c97d00e Mon Sep 17 00:00:00 2001 From: tomas123 <666666@qq.com> Date: Thu, 12 Feb 2026 10:34:55 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=E9=80=80=E5=9B=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Vod.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/application/api/controller/Vod.php b/application/api/controller/Vod.php index e1d7bc825..823739b4f 100644 --- a/application/api/controller/Vod.php +++ b/application/api/controller/Vod.php @@ -121,11 +121,6 @@ public function get_detail(Request $request) } $res = Db::table('mac_vod')->where(['vod_id' => $param['vod_id']])->select(); - //判断vod_rel_vod 字段是否为空 - if (!empty($res['vod_rel_vod'])) { - $field = 'vod_id,vod_name,vod_actor,vod_hits,vod_hits_day,vod_hits_week,vod_hits_month,vod_time,vod_remarks,vod_score,vod_area,vod_year,vod_tag,vod_pic,vod_pic_thumb,vod_pic_slide,vod_douban_score'; - $res['vod_rel_vod_list'] = Db::table('mac_vod')->where(['vod_id' => ['in', $res['vod_rel_vod']]])->field($field)->select(); - } // 返回 return json([ 'code' => 1,