From 3ed5eedc0710ee0527d01a04a9542e94f64a61a7 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Wed, 8 Apr 2020 13:49:05 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 60 +++++++++ .../Home/View/default/Promote/index.html | 34 +++++ .../default/Promote/pop_newrule_detail.html | 123 ++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 Application/Home/View/default/Promote/pop_newrule_detail.html diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index e0e924abe..f9c576a4b 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -232,6 +232,26 @@ class PromoteController extends BaseController $this->assign("rules", $rules); $this->assign("rules_count", count($rules)); + $promoteBelong = M('promote', 'tab_')->where(['id'=>get_pid()])->getField('company_belong'); + if (intval($promoteBelong) == 1) { + $redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]); + $newcacheKey = "pop:newrule:set"; + if (!$redis->sIsMember($newcacheKey, get_pid())) { + $currentTime = strtotime(date('Y-m-d')); + $weekArray = [7,1,2,3,4,5,6]; + $week = $weekArray[date("w")]; + $match_newrules = M("document_pop_rules") + ->field('id') + ->where(['id' => 2]) + ->order("sort asc, id desc") + ->select(); + } else { + $match_newrules = []; + } + } else { + $match_newrules = []; + } + $redis = new \Org\RedisSDK\Redis(['host'=>'127.0.0.1','port'=>6379],[]); $cacheKey = "pop:rule:set"; if (!$redis->sIsMember($cacheKey, get_pid())) { @@ -246,9 +266,11 @@ class PromoteController extends BaseController } else { $match_rules = []; } + $this->assign("match_rules_id", $match_rules ? json_encode(array_column($match_rules, 'id')) : 'null'); + $this->assign("match_newrules_id", $match_newrules ? json_encode(array_column($match_newrules, 'id')) : 'null'); $this->assign("user_count", $user_count); $this->assign("total_money", $total_money); @@ -300,6 +322,44 @@ class PromoteController extends BaseController $this->display('pop_rule_detail'); } + public function popNewRuleDetail($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("