From c88e759e3b94d88fa59d023fed63a9fbd9adba5c Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Fri, 15 Nov 2019 11:03:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=90=8E=E5=8F=B0bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 25 ++++++++++++------- .../View/default/Public/promote_base.html | 4 ++- .../Home/View/default/Query/recharge.html | 4 +-- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 5f50d1d8a..7ffce8e36 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -60,8 +60,14 @@ class PromoteController extends BaseController ->select(); $game_list = M("game", "tab_")->field("id,game_name")->order("id desc")->select(); - $gg_list = M("document", "sys_")->limit('0,5')->where("category_id=56 and status=1")->order("update_time desc")->select(); //游戏公告 - $zx_list = M("document", "sys_")->limit('0,5')->where("category_id=51 and status=1")->order("update_time desc")->select(); //游戏咨询 + $gg_list = M("document", "sys_") + ->join("left join sys_document_article a on a.id=sys_document.id") + ->limit('0,5')->where("category_id=56 and status=1 and a.id is not null")->order("update_time desc")->select(); //游戏公告 + $zx_list = M("document", "sys_") + ->join("left join sys_document_article a on a.id=sys_document.id") + ->limit('0,5')->where("category_id=51 and status=1 and a.id is not null")->order("update_time desc")->select(); //游戏咨询 + +// echo M("document", "sys_")->_sql();die(); $promote_id = get_pid(); $field = 'id,game_name,server_name,user_account,nickname,promote_account,detail,create_time as update_time'; @@ -70,7 +76,7 @@ class PromoteController extends BaseController $logCount = M('protect_log', 'tab_')->where("promote_id = {$promote_id}")->count(); $readLogCount = M('protect_log_read', 'tab_')->where("promote_id = {$promote_id}")->count(); - $gg_data = M("document", "sys_")->where("category_id=56 and status=1")->order("update_time desc")->select(); + $gg_data = M("document", "sys_")->join("left join sys_document_article a on a.id=sys_document.id")->where("category_id=56 and status=1 and a.id is not null")->order("update_time desc")->select(); $gg_Count = count($gg_data); $gg_data = implode(',', array_column($gg_data, 'id')); @@ -82,7 +88,7 @@ class PromoteController extends BaseController // var_dump($gg_ReadDocument);die(); - $zx_data = M("document", "sys_")->where("category_id=51 and status=1")->order("update_time desc")->select(); + $zx_data = M("document", "sys_")->join("left join sys_document_article a on a.id=sys_document.id")->where("category_id=51 and status=1 and a.id is not null")->order("update_time desc")->select(); $zx_Count = count($zx_data); $zx_data = implode(',', array_column($zx_data, 'id')); $zx_where = "promote_id = {$promote_id} and category_id=51"; @@ -528,7 +534,7 @@ class PromoteController extends BaseController } $page = $p ? $p : 1; //默认显示第一页数据 if ($type == 51) { - $data_list = M("document", "sys_")->where("category_id=51 and status=1")->order("update_time desc")->page($page, $row)->select(); //游戏咨询 + $data_list = M("document", "sys_")->join("left join sys_document_article a on a.id=sys_document.id")->where("category_id=51 and status=1 and a.id is not null")->order("update_time desc")->page($page, $row)->select(); //游戏咨询 $count = M("document", "sys_")->where("category_id=51 and status=1")->count(); } elseif ($type == 50) { $data_list = null; @@ -543,14 +549,15 @@ class PromoteController extends BaseController $count = M("protect_log","tab_")->field($field)->count(); }*/ else { - $data_list = M("document", "sys_")->limit('0,50')->where("category_id=56 and status=1")->order("update_time desc")->page($page, $row)->select(); //游戏公告 + $data_list = M("document", "sys_")->join("left join sys_document_article a on a.id=sys_document.id")->limit('0,50')->where("category_id=56 and status=1 and a.id is not null")->order("update_time desc")->page($page, $row)->select(); //游戏公告 $count = M("document", "sys_")->where("category_id=56 and status=1")->count(); } $promote_id = get_pid(); - $logCount = M('protect_log', 'tab_')->count(); + $logCount = M('protect_log', 'tab_')->where("promote_id = {$promote_id}")->count(); $readLogCount = M('protect_log_read', 'tab_')->where("promote_id = {$promote_id}")->count(); - $gg_data = M("document", "sys_")->where("category_id=56 and status=1")->order("update_time desc")->select(); + $gg_data = M("document", "sys_")->join("left join sys_document_article a on a.id=sys_document.id")->where("category_id=56 and status=1 and a.id is not null")->order("update_time desc")->select(); +// echo M("document", "sys_")->_sql();die(); $gg_Count = count($gg_data); $gg_data = implode(',', array_column($gg_data, 'id')); @@ -562,7 +569,7 @@ class PromoteController extends BaseController // var_dump($gg_ReadDocument);die(); - $zx_data = M("document", "sys_")->where("category_id=51 and status=1")->order("update_time desc")->select(); + $zx_data = M("document", "sys_")->join("left join sys_document_article a on a.id=sys_document.id")->where("category_id=51 and status=1 and a.id is not null")->order("update_time desc")->select(); $zx_Count = count($zx_data); $zx_data = implode(',', array_column($zx_data, 'id')); $zx_where = "promote_id = {$promote_id} and category_id=51"; diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index 6102ce6da..9ddb4b635 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -93,7 +93,7 @@