generated from php/site_api
52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller\Tdk;
|
|
|
|
use app\BaseController;
|
|
use app\common\model\Tdk\Tdk as ModelTdk;
|
|
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 Tdk extends BaseController
|
|
{
|
|
|
|
/**
|
|
* 获取网站tdk详情
|
|
*/
|
|
public function getTdkInfo(Request $request): array
|
|
{
|
|
$params = $request->param();
|
|
|
|
$this->validate($params, ['tdk_type' => 'require','locale' => 'require']);
|
|
|
|
$con = Tool::getOptionalQuery(
|
|
['tdk_type', '='],
|
|
['c.i18n_lang_type_code', '=' , 'locale'] //i18n
|
|
);
|
|
|
|
$find = ModelTdk::field([
|
|
'c.i18n_lang_type_code',
|
|
'a.i18n_lang_type_guid',
|
|
'a.tdk_id',
|
|
'a.tdk_type',
|
|
'a.tdk_title',
|
|
'a.tdk_description',
|
|
'a.tdk_keyword'
|
|
])
|
|
->where($con)
|
|
->alias('a')
|
|
->leftjoin('i18n_lang_type c', 'a.i18n_lang_type_guid = c.i18n_lang_type_guid') //i18n
|
|
->find();
|
|
|
|
return msg(0, '获取网站tdk详情成功!', ['data' => $find]);
|
|
}
|
|
}
|