blog limit

This commit is contained in:
CHIEFSOFT\ameye
2023-06-30 19:29:58 -04:00
parent 295c9313c6
commit bac35fe779
+15
View File
@@ -67,6 +67,10 @@ class WrenchBlog extends BaseController
public function website(){
// echo "EXYTACT INPUT DATA HERE";
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$endpoint = "WRENCH_BLOG_DATA";
$res1 = $this->getCache($endpoint);
if (count($res1)==0){
@@ -75,6 +79,17 @@ class WrenchBlog extends BaseController
$this->saveCache($endpoint,$res1);
}
$limit = isset($in['limit']) ? $in['limit']: 0;
if ($limit> 0){
$res1['blogdata'] = array_slice($res1['blogdata'], 0, $limit);
}
$res1['blogconfig'] = [
"media_url" => "https://blog.wrenchboard.com",
"other_cofig1" => "NONE",
"other_cofig2" => "NONE",
];
return $this->response->setJson($res1);
}