Commit 20ab829a authored by hujun's avatar hujun

公告

parent 96cd1b8e
......@@ -33,8 +33,8 @@ class Feed extends Basic
$where_0['type'] = 1;
$where_1['status'] = 0;
$where_1['type'] = 0;
$data[0] = $push->getList(1, 1, 'id DESC', $field, $where_0);
$data[1] = $push->getList(1, 1, 'id DESC', $field, $where_1);
$data[0] = $push->getFeedInfo($field, $where_0, 'id desc');
$data[1] = $push->getFeedInfo($field, $where_1, 'id desc');
} else {
//列表页
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
......
......@@ -87,7 +87,7 @@ class Notice extends Basic
$num = $this->m_push->editData($data);
if ($num > 0) {
return $this->response(101, '内容为空!');
return $this->response(101, '新增公告失败!');
}
return $this->response(200, '新增成功!');
......
......@@ -37,14 +37,16 @@ class PushFeed extends BaseModel
*
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @param string $order
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getFeedInfo($field = '', $params = '') {
public function getFeedInfo($field = '', $params = '', $order = 'id ASC') {
return $this->field($field)
->where($params)
->order($order)
->find();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment