@ -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("< h2 style = 'text-align: center;' > {$result['title']}< / h2 > ".$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'));