Commit 14297e0c authored by hujun's avatar hujun

feed 详情

parent 0266da8e
......@@ -29,7 +29,7 @@ class Feed extends Basic
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$field = 'id,report_id,house_id,title,content,link,read_num,click_num,house_title,create_time';
$field = 'id,house_id,title,content,link,house_title';
$where = [];
$where['type'] = 0;
......@@ -63,4 +63,26 @@ class Feed extends Basic
return $this->response(200, "");
}
/**
* feed 详情
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getFeedInfo() {
$push = new PushFeed();
$field = 'id,create_time,house_title';
if (empty($this->params['id'])) {
return $this->response(101, "Id is null!");
}
$where['id'] = $this->params['id'];
$where['status'] = 0;
$data = $push->getFeedInfo($field, $where);
return $this->response(200, "", $data);
}
}
\ No newline at end of file
......@@ -30,4 +30,20 @@ class PushFeed extends BaseModel
}
return $result;
}
/**
* feed流详情
*
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getFeedInfo($field = '', $params = '') {
return $this->field($field)
->where($params)
->find();
}
}
\ No newline at end of file
......@@ -423,6 +423,7 @@ Route::group('broker', [
'qrCode' => ['api_broker/broker/qrCode', [ 'method' => 'get' ] ], //生成二维码
'feedList' => ['api_broker/Feed/feedList', [ 'method' => 'get' ] ], //首页feed喜报
'editFeedClick' => ['api_broker/Feed/editFeedClick', [ 'method' => 'post' ] ], //feed流喜报点赞和页面浏览数量
'getFeedInfo' => ['api_broker/Feed/getFeedInfo', [ 'method' => 'get' ] ], //feed流喜报详情
......
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