You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\common\model\Banner;
|
|
|
|
use app\common\model\UploadFile;
|
|
|
|
/**
|
|
|
|
* 默认控制器
|
|
|
|
* Class Index
|
|
|
|
* @package app\api\controller
|
|
|
|
*/
|
|
|
|
class Index extends Controller
|
|
|
|
{
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
echo '当前访问的index.php,请将index.html设为默认站点入口';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getBannerList(){
|
|
|
|
$list = Banner::where("status", 10)->select()->toArray();
|
|
|
|
foreach ($list as &$value) {
|
|
|
|
$file_path = UploadFile::where('file_id', $value['image_id'])->field('file_path')->find()->file_path;
|
|
|
|
$value['image'] = getUrl($file_path);
|
|
|
|
}
|
|
|
|
return $this->renderSuccess($list);
|
|
|
|
}
|
|
|
|
}
|