aerwen_u_api/app/api/controller/Banners/Poster.php
2024-05-05 16:58:22 +08:00

45 lines
1.2 KiB
PHP

<?php
namespace app\api\controller\Banners;
use app\BaseController;
use app\common\model\Banners\Poster as ModelPoster;
use app\Request;
use think\Validate;
use think\exception\ValidateException;
use think\facade\Filesystem;
use app\common\arw\adjfut\src\Excel;
use app\common\arw\adjfut\src\UploadFile;
use think\facade\Db;
use app\common\exception\Tool;
use think\facade\Env;
class Poster extends BaseController
{
/**
* 获取海报详情
*/
public function getPoster(Request $request): array
{
$params = $request->param();
$this->validate($params, ['poster_location|海报位置' => 'require', 'locale' => 'require']);
$con = Tool::getOptionalQuery(
['c.i18n_lang_type_code', '=', 'locale'], //i18n,
['a.poster_location', '=', 'poster_location']
);
$find = ModelPoster::field([
'a.poster_img' => 'imgSrc',
'a.poster_title' => 'title',
'a.poster_describe' => 'text',
])
->where($con)
->alias('a')
->leftjoin('i18n_lang_type c', 'a.i18n_lang_type_guid = c.i18n_lang_type_guid') //i18n
->find();
return msg(0, '获取海报详情成功!', ['data' => $find]);
}
}