fix : 修改接口为ssr
This commit is contained in:
parent
a04289c668
commit
a2bd1d16ee
@ -47,7 +47,7 @@ class Signup extends BaseController
|
||||
$params = $request->param();
|
||||
$this->validate($params, [
|
||||
'signup_user_name|报名用户名称' => 'require',
|
||||
// 'captcha|验证码' => 'require|captcha',
|
||||
'captcha|验证码' => 'require|captcha',
|
||||
'signup_user_phone|报名用户电话' => 'require',
|
||||
'signup_user_parents_phone|报名用户家长电话' => 'require',
|
||||
'signup_user_home_address|报名用户家庭地址' => 'require',
|
||||
|
@ -4,6 +4,7 @@ namespace app\api\controller\ExaminationInformation;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\ExaminationInformation\InfoArticle as ModelinfoArticle;
|
||||
use app\common\model\ExaminationInformation\InfoArticleType as ModelinfoArticleType;
|
||||
use app\Request;
|
||||
use think\Validate;
|
||||
use think\exception\ValidateException;
|
||||
@ -20,17 +21,35 @@ class InfoArticle extends BaseController
|
||||
/**
|
||||
* 获取资讯文章列表
|
||||
*/
|
||||
public function getinfoArticleList(Request $request): array
|
||||
public function getinfoArticleList(Request $request)
|
||||
{
|
||||
$params = $request->param();
|
||||
$con = [];
|
||||
|
||||
$this->validate($params, [
|
||||
'info_article_type_id|文章类型id' => 'require',
|
||||
'idx|文章类型id' => 'require',
|
||||
]);
|
||||
$con = Tool::getOptionalQuery(['b.info_article_type_id', '='],);
|
||||
|
||||
$query = ModelinfoArticle::where($con)
|
||||
$type = ModelinfoArticleType::
|
||||
field([
|
||||
'info_article_type_id',
|
||||
'info_article_type_name' => 'name',
|
||||
])
|
||||
->order('info_article_type_sort', 'asc')
|
||||
->select();
|
||||
|
||||
$idx = $params['idx'];
|
||||
$params['info_article_type_id'] = null;
|
||||
foreach ($type as $key => $value) {
|
||||
if($key == $params['idx']){
|
||||
$params['info_article_type_id'] = $value['info_article_type_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!$params['info_article_type_id']) throwErrorMsg("传值不正确!");
|
||||
|
||||
|
||||
$query = ModelinfoArticle::where('b.info_article_type_id',$params['info_article_type_id'])
|
||||
->field([
|
||||
'a.info_article_id',
|
||||
'a.info_article_type_guid',
|
||||
|
@ -4,6 +4,7 @@ namespace app\api\controller\TeachersStrength;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\TeachersStrength\Teacher as ModelTeachers;
|
||||
use app\common\model\TeachersStrength\Subject as ModelSubject;
|
||||
use app\Request;
|
||||
use think\Validate;
|
||||
use think\exception\ValidateException;
|
||||
@ -25,7 +26,26 @@ class Teachers extends BaseController
|
||||
$params = $request->param();
|
||||
$con = [];
|
||||
|
||||
$con = Tool::getOptionalQuery(['teacher_name', 'LIKE'], ['b.subject_id', '='],);
|
||||
$subject = ModelSubject::where($con)
|
||||
->field([
|
||||
'subject_id',
|
||||
'subject_name' => 'name',
|
||||
])
|
||||
->order('subject_sort', 'asc')
|
||||
->select();
|
||||
|
||||
$params['subject_id'] = null;
|
||||
foreach ($subject as $key => $value) {
|
||||
if ($key == $params['idx']) {
|
||||
$params['subject_id'] = $value['subject_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$con = Tool::getOptionalQuery(
|
||||
['params'=> $params],
|
||||
['teacher_name', 'LIKE'],
|
||||
['b.subject_id', '='],
|
||||
);
|
||||
|
||||
$query = ModelTeachers::where($con)
|
||||
->field([
|
||||
|
Loading…
Reference in New Issue
Block a user