|
@@ -58,27 +58,34 @@ class Journal extends Core
|
|
|
{
|
|
|
$cate = $this->getCate();
|
|
|
|
|
|
- if (isset($cate['journal_id'])) {
|
|
|
- $this->data['push'] = Dever::db('journal/info')->getOne($cate['journal_id']);
|
|
|
- } else {
|
|
|
-
|
|
|
- $this->data['push'] = Dever::db('journal/info')->getNew(array('time' => time()));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- $this->data['push'] = $this->ding($this->data['push']);
|
|
|
+ $time = time();
|
|
|
+ $day = (7 * 86400);
|
|
|
|
|
|
|
|
|
$where = array();
|
|
|
if (isset($cate['id'])) {
|
|
|
$where['cate_id'] = $cate['id'];
|
|
|
}
|
|
|
-
|
|
|
if ($this->app) {
|
|
|
$where['cate_id_1'] = 1;
|
|
|
- $where['time'] = time() - (7 * 86400);
|
|
|
+ $where['time'] = $time - $day;
|
|
|
+
|
|
|
+
|
|
|
+ $this->data['push'] = Dever::db('journal/info')->getNew($where);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (isset($cate['journal_id'])) {
|
|
|
+ $this->data['push'] = Dever::db('journal/info')->getOne($cate['journal_id']);
|
|
|
+ } else {
|
|
|
+
|
|
|
+ $this->data['push'] = Dever::db('journal/info')->getNew();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ $this->data['push'] = $this->ding($this->data['push']);
|
|
|
+
|
|
|
+
|
|
|
$data = Dever::db('journal/info')->getAllByPage($where);
|
|
|
|
|
|
if ($data) {
|