51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller\AboutUs;
|
|
|
|
use app\BaseController;
|
|
use app\common\model\AboutUs\AboutUs as ModelAboutUs;
|
|
use app\Request;
|
|
use think\Validate;
|
|
use think\exception\ValidateException;
|
|
use think\facade\Filesystem;
|
|
use app\common\exception\Tool;
|
|
|
|
|
|
class AboutUs extends BaseController
|
|
{
|
|
/**
|
|
* 获取关于我们内容
|
|
*/
|
|
public function getAboutUs(Request $request): array
|
|
{
|
|
$params = $request->param();
|
|
|
|
$this->validate($params, ['locale' => 'require']);
|
|
|
|
$con = Tool::getOptionalQuery(['c.i18n_lang_type_code', '=', 'locale']);
|
|
|
|
$query = ModelAboutUs::where($con)
|
|
->field([
|
|
'c.i18n_lang_type_code',
|
|
'a.i18n_lang_type_guid',
|
|
'about_us_id',
|
|
'about_us_guid',
|
|
'about_us_profile',
|
|
'about_us_profile_history',
|
|
'about_us_honor',
|
|
'about_us_honor_more',
|
|
'about_us_factory',
|
|
'about_us_exhibition',
|
|
])
|
|
->alias('a')
|
|
->leftjoin('i18n_lang_type c', 'a.i18n_lang_type_guid = c.i18n_lang_type_guid') //i18n
|
|
->find();
|
|
|
|
return [
|
|
'code' => 0,
|
|
'data' => $query,
|
|
'msg' => 'ok'
|
|
];
|
|
}
|
|
}
|