diff --git a/Application/Admin/View/Article/pop_rule_edit.html b/Application/Admin/View/Article/pop_rule_edit.html index 6c906281b..6385b498e 100644 --- a/Application/Admin/View/Article/pop_rule_edit.html +++ b/Application/Admin/View/Article/pop_rule_edit.html @@ -15,8 +15,9 @@
  • - - + + + *排序越小越靠前
  • diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index 87937b618..a1eed9ebd 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -221,6 +221,24 @@ class PromoteController extends BaseController $this->assign('todayAddSpendData', $todayAddSpendData); $this->assign('mounthAddSpendData', $mounthAddSpendData); + // 规则弹窗事宜 + $rules = M("document_pop_rules") + //->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week})") + ->order("sort asc, id desc") + ->limit('0, 5') + ->select(); + $this->assign("rules", $rules); + $this->assign("rules_count", count($rules)); + + $currentTime = strtotime(date('Y-m-d')); + $weekArray = [7,1,2,3,4,5,6]; + $week = $weekArray[date("w")]; + $match_rules = M("document_pop_rules") + ->field('id') + ->where("(type = 1 and pop_time = {$currentTime}) or (type = 2 and pop_time = {$week})") + ->order("sort asc, id desc") + ->select(); + $this->assign("match_rules_id", $match_rules ? json_encode(array_column($match_rules, 'id')) : []); $this->assign("user_count", $user_count); $this->assign("total_money", $total_money); @@ -248,6 +266,30 @@ class PromoteController extends BaseController $this->display(); } + public function popRuleDetail($id=0, $p=1, $row=1, $force=false) + { + $result = M("document_pop_rules")->where("id in ({$id})")->page($p, $row)->select(); + if (empty($result)) { + return $this->error("未找到数据", [], true); + } + $count = M("document_pop_rules")->where("id in ({$id})")->count(); + if ($p + 1 <= $count) { + $this->assign("next_page",$p+1); + } + if ($p - 1 >= 0) { + $this->assign("preview_page",$p-1); + } + if ($p + 1 > $count) { + $this->assign("close_btn", true); + } + $this->assign("count", $count); + $this->assign("force", $force); + // return $this->success("获取数据成功", $result, true); + //$this->show("

    {$result['title']}

    ".$result['content']); + $this->assign("rule",$result[0]); + $this->display('pop_rule_detail'); + } + private function caculateSpend($pay_time, $condition, $create = [], $type = 0) { $map['promote_id'] = array('egt', 0); @@ -553,7 +595,12 @@ class PromoteController extends BaseController } $count = M("protect_log","tab_")->field($field)->count(); - }*/ else { + }*/ + else if ($type == 57) { + $data_list = M('document_pop_rules')->order("sort asc, id desc")->page($p, $row)->select(); + $count = count(M('document_pop_rules')->count()); + } + else { $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(); } @@ -573,7 +620,6 @@ class PromoteController extends BaseController $gg_ReadDocument = M("document_read", "sys_")->where($gg_where)->count(); // var_dump($gg_ReadDocument);die(); - $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')); diff --git a/Application/Home/View/default/Promote/index.html b/Application/Home/View/default/Promote/index.html index 6099c49a4..59df4d361 100644 --- a/Application/Home/View/default/Promote/index.html +++ b/Application/Home/View/default/Promote/index.html @@ -72,6 +72,13 @@ + 平台规则 + + + +
    查看更多> @@ -123,6 +130,18 @@ +
    + + 暂无平台规则 + + +

    + {$rule.title} + {$rule.operate_time|date="Y/m/d",###} +

    +
    +
    +
  • @@ -203,6 +222,46 @@ yes:function(){window.location.href="{:U('Safe/modifyBaseInfo')}"}, }); + var pop_ids = {$match_rules_id}; + function pop_rulus_content(id, force = false) + { + if (id instanceof Array) { + console.log(id) + var index = 0; + layer.open({ + type: 2, + title: '平台规则', + area:['60%', '80%'], + closeBtn: 0, + shadeClose: false, + skin: 'yourclass', + content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force + }); + } else { + layer.open({ + type: 2, + title: '平台规则', + area:['60%', '80%'], + closeBtn: 0, + shadeClose: false, + skin: 'yourclass', + //btn:['返回'], + content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force, + end:function(){ + return false; + } + }); + } + } + if (pop_ids && !getCookie('pop_over')) {pop_rulus_content(pop_ids, true);} + + function getCookie(name) + { + var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)"); + if(arr=document.cookie.match(reg)) + return unescape(arr[2]); + else + return null; } $(function(){ $(".select_gallery").select2(); diff --git a/Application/Home/View/default/Promote/msg_list.html b/Application/Home/View/default/Promote/msg_list.html index 2fcbebbd7..c55d386c5 100644 --- a/Application/Home/View/default/Promote/msg_list.html +++ b/Application/Home/View/default/Promote/msg_list.html @@ -41,6 +41,13 @@ + curr">平台规则 + + + +
    @@ -48,12 +55,14 @@

    - + {$data.title} - + + {$data.title} + {$data.title} + {$data.update_time|date="Y/m/d",###} - {$data.update_time|date="Y/m/d",###}

    @@ -73,5 +82,35 @@ $(function () { setValue('row', '{:I("row",10)}'); }) + function pop_rulus_content(id, force = false) + { + if (id instanceof Array) { + console.log(id) + var index = 0; + layer.open({ + type: 2, + title: '平台规则', + area:['60%', '80%'], + closeBtn: 0, + shadeClose: false, + skin: 'yourclass', + content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force + }); + } else { + layer.open({ + type: 2, + title: '平台规则', + area:['60%', '80%'], + closeBtn: 0, + shadeClose: false, + skin: 'yourclass', + //btn:['返回'], + content: "{:U('Promote/popRuleDetail')}&id="+id+"&force="+force, + end:function(){ + return false; + } + }); + } + } \ No newline at end of file diff --git a/Application/Home/View/default/Promote/pop_rule_detail.html b/Application/Home/View/default/Promote/pop_rule_detail.html new file mode 100644 index 000000000..ae07b7b33 --- /dev/null +++ b/Application/Home/View/default/Promote/pop_rule_detail.html @@ -0,0 +1,129 @@ + + + + + + + 充值查询列表|----软件管理平台 + + + + + + + + + + + + + +
    + + + + +

    {$rule.title}

    +
    {$rule.content}
    +
    + + + + if(C('COLOR_STYLE')=='blue_color') echo ' + + '; + + + + + + + \ No newline at end of file