|
@@ -88,6 +88,30 @@ class stat_dailyControl extends SystemControl
|
|
|
|
|
|
Tpl::showpage('stat.interactive.special');
|
|
|
}
|
|
|
+
|
|
|
+ public function interactive_searchOp()
|
|
|
+ {
|
|
|
+ if(empty( $_GET['date_id'])) {
|
|
|
+ $date_id = strtotime(date('Y-m-d',time()));
|
|
|
+ } else {
|
|
|
+ $date_id = $_GET['date_id'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $mod_stat = Model('stat');
|
|
|
+ $stat_list = $mod_stat->statDailyList(['date_id' => $date_id], 'date_id,call_record');
|
|
|
+ if(empty($stat_list) || empty($stat_list[0]['call_record'])) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $record = json_decode($stat_list[0]['call_record'],true);
|
|
|
+ $words = $this->all_keyword($record);
|
|
|
+
|
|
|
+ Tpl::output('words',$words);
|
|
|
+ Tpl::output('word_colomns',$this->word_colomns());
|
|
|
+
|
|
|
+ Tpl::showpage('stat.interactive.search');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private function special_colomns()
|
|
|
{
|
|
|
return ['序号','专题编号','名称','点击量','子专题'];
|
|
@@ -98,6 +122,57 @@ class stat_dailyControl extends SystemControl
|
|
|
return ['序号','商品编号','商品货架号','名称','点击量'];
|
|
|
}
|
|
|
|
|
|
+ private function brand_colomns()
|
|
|
+ {
|
|
|
+ return ['序号','品牌编号','名称','点击量'];
|
|
|
+ }
|
|
|
+ private function word_colomns()
|
|
|
+ {
|
|
|
+ return ['序号','关键词','搜索量'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function compatible_decode($unicode)
|
|
|
+ {
|
|
|
+ $str = '';
|
|
|
+ $arr = array_filter(explode('u', $unicode));
|
|
|
+ foreach ($arr as $k => $v) {
|
|
|
+ if (strlen($v) == 4) {
|
|
|
+ $num = (int)hexdec($v);
|
|
|
+ $ord_1 = decbin(0xe0 | ($num >> 12));
|
|
|
+ $ord_2 = decbin(0x80 | (($num >> 6) & 0x3f));
|
|
|
+ $ord_3 = decbin(0x80 | ($num & 0x3f));
|
|
|
+ $str .= chr(bindec($ord_1)) . chr(bindec($ord_2)) . chr(bindec($ord_3));
|
|
|
+ }else{
|
|
|
+ $str .= chr(hexdec($v));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $str;
|
|
|
+ }
|
|
|
+
|
|
|
+ private function all_keyword($record)
|
|
|
+ {
|
|
|
+ $other = $record['other'];
|
|
|
+ if(empty($other)) return false;
|
|
|
+
|
|
|
+ $words = [];
|
|
|
+ foreach ($other as $key => $value)
|
|
|
+ {
|
|
|
+ $params = preg_split('/_/', $key);
|
|
|
+ if($params != false && count($params) == 2)
|
|
|
+ {
|
|
|
+ if($params[0] == 'keyword') {
|
|
|
+ $keyword = $this->compatible_decode($params[1]);
|
|
|
+ $count = $value['count'];
|
|
|
+ $words[] = array('keyword' => $keyword,'count' => $count);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!empty($words)) {
|
|
|
+// uasort($words,['special_item','count_desc']);
|
|
|
+ }
|
|
|
+ return $words;
|
|
|
+ }
|
|
|
+
|
|
|
private function all_special($record)
|
|
|
{
|
|
|
$other = $record['other'];
|
|
@@ -254,6 +329,11 @@ class special_item
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class search_item
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
class call_item
|
|
|
{
|
|
|
private $mDateID;
|