|
@ -36,13 +36,24 @@ class mWeiboBehavior extends mBase { |
|
|
return $this->obj->delete($this->tbl_delta, array('sql' => "`date`<?", 'vals' => array($date)));
|
|
|
return $this->obj->delete($this->tbl_delta, array('sql' => "`date`<?", 'vals' => array($date)));
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getSpiderBehavior($date, $page_num, $page_size) { |
|
|
public function getSpiderBehavior($date, $uid, $page_num, $page_size) { |
|
|
|
|
|
$where = array('sql' => "`date`=?", 'vals' => array($date)); |
|
|
|
|
|
if ($uid > 0) { |
|
|
|
|
|
$where['sql'] .= " AND `uid`=?"; |
|
|
|
|
|
$where['vals'][] = $uid; |
|
|
|
|
|
} |
|
|
$offset = ($page_num - 1) * $page_size; |
|
|
$offset = ($page_num - 1) * $page_size; |
|
|
return $this->obj->selectAll($this->tbl_data, array('sql' => "`date`=?", 'vals' => array($date)), 'created_at desc', array($offset, $page_size)); |
|
|
|
|
|
|
|
|
return $this->obj->selectAll($this->tbl_data, $where, 'created_at desc', array($offset, $page_size)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getSpiderBehaviorTotal($date) { |
|
|
public function getSpiderBehaviorTotal($date, $uid) { |
|
|
return $this->obj->count($this->tbl_data, array('sql' => "`date`=?", 'vals' => array($date))); |
|
|
$where = array('sql' => "`date`=?", 'vals' => array($date)); |
|
|
|
|
|
if ($uid > 0) { |
|
|
|
|
|
$where['sql'] .= " AND `uid`=?"; |
|
|
|
|
|
$where['vals'][] = $uid; |
|
|
|
|
|
} |
|
|
|
|
|
return $this->obj->count($this->tbl_data, $where); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getHotBehavior($type, $sdate, $edate, $page_num, $page_size) { |
|
|
public function getHotBehavior($type, $sdate, $edate, $page_num, $page_size) { |
|
|