feat : 对接师资力量
This commit is contained in:
parent
81c1b96590
commit
2af1859406
@ -37,6 +37,7 @@ class CompanyProfile extends BaseController
|
|||||||
'company_profile_id',
|
'company_profile_id',
|
||||||
'company_profile_guid',
|
'company_profile_guid',
|
||||||
'company_profile_img',
|
'company_profile_img',
|
||||||
|
'company_profile_color',
|
||||||
'company_profile_content',
|
'company_profile_content',
|
||||||
'company_profile_order'
|
'company_profile_order'
|
||||||
])
|
])
|
||||||
@ -69,6 +70,7 @@ class CompanyProfile extends BaseController
|
|||||||
$model->allowField([
|
$model->allowField([
|
||||||
'company_profile_update_user_guid',
|
'company_profile_update_user_guid',
|
||||||
'company_profile_img',
|
'company_profile_img',
|
||||||
|
'company_profile_color',
|
||||||
'company_profile_content',
|
'company_profile_content',
|
||||||
'company_profile_order'
|
'company_profile_order'
|
||||||
])->save($params);
|
])->save($params);
|
||||||
@ -104,6 +106,7 @@ class CompanyProfile extends BaseController
|
|||||||
'company_profile_create_user_guid',
|
'company_profile_create_user_guid',
|
||||||
'company_profile_update_user_guid',
|
'company_profile_update_user_guid',
|
||||||
'company_profile_img',
|
'company_profile_img',
|
||||||
|
'company_profile_color',
|
||||||
'company_profile_content',
|
'company_profile_content',
|
||||||
'company_profile_order'
|
'company_profile_order'
|
||||||
]);
|
]);
|
||||||
|
@ -41,7 +41,7 @@ class Teacher extends BaseController
|
|||||||
])
|
])
|
||||||
->alias('a')
|
->alias('a')
|
||||||
->leftJoin('subject b', 'a.subject_guid = b.subject_guid')
|
->leftJoin('subject b', 'a.subject_guid = b.subject_guid')
|
||||||
->order('teacher_update_time', 'desc');
|
->order('teacher_order', 'asc');
|
||||||
|
|
||||||
return msg("获取教师列表成功!", $query);
|
return msg("获取教师列表成功!", $query);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ class TeachingEnvirType extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function getTeachingEnvirTypeList(Request $request): array
|
public function getTeachingEnvirTypeList(Request $request): array
|
||||||
{
|
{
|
||||||
$select = ModelTeachingEnvirType::field(['teaching_envir_type_id', 'teaching_envir_type_name'])
|
$select = ModelTeachingEnvirType::field(['teaching_envir_type_id', 'teaching_envir_type_name' => 'name'])
|
||||||
->where('teaching_envir_type_parent_guid', "0")
|
->where('teaching_envir_type_parent_guid', "0")
|
||||||
->order('teaching_envir_type_order')
|
->order('teaching_envir_type_order')
|
||||||
->select();
|
->select();
|
||||||
|
@ -36,15 +36,14 @@ class InfoArticle extends BaseController
|
|||||||
'a.info_article_type_guid',
|
'a.info_article_type_guid',
|
||||||
'b.info_article_type_name',
|
'b.info_article_type_name',
|
||||||
'a.info_article_title',
|
'a.info_article_title',
|
||||||
|
'a.info_article_create_time',
|
||||||
'a.info_article_cover',
|
'a.info_article_cover',
|
||||||
])
|
])
|
||||||
->alias('a')
|
->alias('a')
|
||||||
->leftjoin('info_article_type b','a.info_article_type_guid = b.info_article_type_guid')
|
->leftjoin('info_article_type b', 'a.info_article_type_guid = b.info_article_type_guid')
|
||||||
->hidden(['info_article_type_guid'])
|
->hidden(['info_article_type_guid'])
|
||||||
->order('info_article_order', 'asc');
|
->order('info_article_order', 'asc');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return msg("获取资讯文章列表成功!", $query);
|
return msg("获取资讯文章列表成功!", $query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,16 +54,15 @@ class InfoArticle extends BaseController
|
|||||||
{
|
{
|
||||||
$params = $request->param();
|
$params = $request->param();
|
||||||
|
|
||||||
$this->validate($params, ['info_article_guid' => 'require']);
|
$this->validate($params, ['info_article_id' => 'require']);
|
||||||
|
|
||||||
$find = ModelinfoArticle::field([
|
$find = ModelinfoArticle::field([
|
||||||
'info_article_id',
|
'info_article_id',
|
||||||
'info_article_title',
|
'info_article_title',
|
||||||
'info_article_cover',
|
|
||||||
'info_article_content',
|
'info_article_content',
|
||||||
'info_article_order'
|
'info_article_create_time',
|
||||||
])
|
])
|
||||||
->where('info_article_guid', $params['info_article_guid'])
|
->where('info_article_id', $params['info_article_id'])
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
return msg(0, '获取资讯文章详情成功!', ['data' => $find]);
|
return msg(0, '获取资讯文章详情成功!', ['data' => $find]);
|
||||||
|
@ -30,7 +30,7 @@ class InfoArticleType extends BaseController
|
|||||||
$query = ModelinfoArticleType::where($con)
|
$query = ModelinfoArticleType::where($con)
|
||||||
->field([
|
->field([
|
||||||
'info_article_type_id',
|
'info_article_type_id',
|
||||||
'info_article_type_name',
|
'info_article_type_name' => 'name',
|
||||||
])
|
])
|
||||||
->order('info_article_type_sort', 'asc')
|
->order('info_article_type_sort', 'asc')
|
||||||
->select();
|
->select();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace app\api\controller\Subject\TeachersStrength;
|
namespace app\api\controller\TeachersStrength;
|
||||||
|
|
||||||
use app\BaseController;
|
use app\BaseController;
|
||||||
use app\common\model\TeachersStrength\Subject as ModelSubject;
|
use app\common\model\TeachersStrength\Subject as ModelSubject;
|
||||||
@ -28,11 +28,11 @@ class Subject extends BaseController
|
|||||||
$query = ModelSubject::where($con)
|
$query = ModelSubject::where($con)
|
||||||
->field([
|
->field([
|
||||||
'subject_id',
|
'subject_id',
|
||||||
'subject_guid',
|
'subject_name' => 'name',
|
||||||
'subject_name',
|
|
||||||
'subject_sort'
|
|
||||||
])
|
])
|
||||||
->order('subject_sort', 'asc');
|
->order('subject_sort', 'asc')
|
||||||
|
->select()
|
||||||
|
;
|
||||||
|
|
||||||
return msg(0, "获取授课科目列表成功!", [
|
return msg(0, "获取授课科目列表成功!", [
|
||||||
'data' => $query,
|
'data' => $query,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace app\api\controller\Teachers\TeachersStrength;
|
namespace app\api\controller\TeachersStrength;
|
||||||
|
|
||||||
use app\BaseController;
|
use app\BaseController;
|
||||||
use app\common\model\TeachersStrength\Teacher as ModelTeachers;
|
use app\common\model\TeachersStrength\Teacher as ModelTeachers;
|
||||||
@ -25,24 +25,29 @@ class Teachers extends BaseController
|
|||||||
$params = $request->param();
|
$params = $request->param();
|
||||||
$con = [];
|
$con = [];
|
||||||
|
|
||||||
$con = Tool::getOptionalQuery(['teacher_name', 'LIKE'], ['subject_guid', '='],);
|
$con = Tool::getOptionalQuery(['teacher_name', 'LIKE'], ['b.subject_id', '='],);
|
||||||
|
|
||||||
$query = ModelTeachers::where($con)
|
$query = ModelTeachers::where($con)
|
||||||
->field([
|
->field([
|
||||||
'teacher_id',
|
'a.teacher_id',
|
||||||
'teacher_guid',
|
'a.teacher_name',
|
||||||
'teacher_name',
|
'a.teacher_position',
|
||||||
'teacher_position',
|
'a.teacher_img',
|
||||||
'teacher_img',
|
'a.subject_guid',
|
||||||
'subject_guid',
|
'b.subject_name',
|
||||||
'teacher_intro',
|
'a.teacher_order'
|
||||||
'teacher_order'
|
|
||||||
])
|
])
|
||||||
->order('teacher_update_time', 'desc');
|
->alias('a')
|
||||||
|
->leftjoin('subject b', 'a.subject_guid = b.subject_guid')
|
||||||
|
->append(['teacher_eng_name'])
|
||||||
|
->hidden(['subject_guid', 'teacher_order'])
|
||||||
|
->order('teacher_order', 'asc')
|
||||||
|
->select();
|
||||||
|
|
||||||
|
return msg(0, "获取教师列表成功!", [
|
||||||
|
'count' => count($query),
|
||||||
return msg("获取教师列表成功!", $query);
|
'data' => $query,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,19 +57,23 @@ class Teachers extends BaseController
|
|||||||
{
|
{
|
||||||
$params = $request->param();
|
$params = $request->param();
|
||||||
|
|
||||||
$this->validate($params, ['teacher_guid' => 'require']);
|
$this->validate($params, ['teacher_id|教师id' => 'require']);
|
||||||
|
|
||||||
$find = ModelTeachers::field([
|
$find = ModelTeachers::field([
|
||||||
'teacher_id',
|
'a.teacher_id',
|
||||||
'teacher_guid',
|
'a.teacher_name',
|
||||||
'teacher_name',
|
'a.teacher_position',
|
||||||
'teacher_position',
|
'a.teacher_img',
|
||||||
'teacher_img',
|
'a.subject_guid',
|
||||||
'subject_guid',
|
'b.subject_name',
|
||||||
'teacher_intro',
|
'a.teacher_intro',
|
||||||
'teacher_order'
|
'a.teacher_order'
|
||||||
])
|
])
|
||||||
->where('teacher_guid', $params['teacher_guid'])
|
->alias('a')
|
||||||
|
->leftjoin('subject b', 'a.subject_guid = b.subject_guid')
|
||||||
|
->append(['teacher_eng_name'])
|
||||||
|
->hidden(['subject_guid', 'teacher_order'])
|
||||||
|
->where('teacher_id', $params['teacher_id'])
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
return msg(0, '获取教师详情成功!', ['data' => $find]);
|
return msg(0, '获取教师详情成功!', ['data' => $find]);
|
||||||
|
@ -57,6 +57,7 @@ class Works extends BaseController
|
|||||||
->where($con)
|
->where($con)
|
||||||
->leftJoin('works_type', 'works_type.works_type_guid = works.works_type_guid')
|
->leftJoin('works_type', 'works_type.works_type_guid = works.works_type_guid')
|
||||||
->leftJoin('classes', 'classes.classes_guid = works.classes_guid')
|
->leftJoin('classes', 'classes.classes_guid = works.classes_guid')
|
||||||
|
->append(['isLike', 'likeSrc'])
|
||||||
->order('works_order', 'asc')
|
->order('works_order', 'asc')
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
@ -65,4 +66,28 @@ class Works extends BaseController
|
|||||||
'data' => $data,
|
'data' => $data,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞接口
|
||||||
|
*/
|
||||||
|
public function WorksLike(Request $request): array
|
||||||
|
{
|
||||||
|
$params = $request->param();
|
||||||
|
$this->validate($params, [
|
||||||
|
'works_id|作品id' => 'require',
|
||||||
|
]);
|
||||||
|
$model = ModelWorks::where('works_id', $params['works_id'])->find();
|
||||||
|
if (!$model) throwErrorMsg("该作品不存在", 1);
|
||||||
|
|
||||||
|
$rmsg = "";
|
||||||
|
try {
|
||||||
|
$rmsg = $params['isLike'] == true ? "成功" : "取消";
|
||||||
|
$model->allowField([
|
||||||
|
'works_likes_count',
|
||||||
|
])->save($params);
|
||||||
|
return msg('点赞' . $rmsg . "!");
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
return throwErrorMsg("点赞失败" . $th, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ class CompanyProfile extends BaseModel
|
|||||||
"company_profile_guid" => "string",
|
"company_profile_guid" => "string",
|
||||||
"company_profile_img" => "string",
|
"company_profile_img" => "string",
|
||||||
"company_profile_content" => "string",
|
"company_profile_content" => "string",
|
||||||
|
"company_profile_color" => "string",
|
||||||
"company_profile_order" => "int",
|
"company_profile_order" => "int",
|
||||||
"company_profile_create_time" => "datetime",
|
"company_profile_create_time" => "datetime",
|
||||||
"company_profile_create_user_guid" => "string",
|
"company_profile_create_user_guid" => "string",
|
||||||
|
@ -113,14 +113,32 @@ class Flow extends BaseModel
|
|||||||
// $res_url = explode('/',$url)[1];
|
// $res_url = explode('/',$url)[1];
|
||||||
$match_res_pool = [
|
$match_res_pool = [
|
||||||
'index'=>'首页',
|
'index'=>'首页',
|
||||||
'about-intro'=>'关于我们-厚德简介',
|
|
||||||
'about-env'=>'关于我们-教学环境',
|
'about-intro-idx'=>'关于我们-厚德简介',
|
||||||
'about-history'=>'关于我们-发展历程',
|
'about-env-idx-type'=>'关于我们-教学环境',
|
||||||
'teachers'=>'师资力量',
|
'about-history-idx'=>'关于我们-发展历程',
|
||||||
|
|
||||||
|
'signUp-signUp_introduction-idx-page'=>'招生报名-招生简介',
|
||||||
|
'signUp-classes_intro-idx-page'=>'招生报名-班型介绍',
|
||||||
|
'signUp-enrol_aq-idx'=>'招生报名-招生回答',
|
||||||
|
'signUp-classes_intro-idx-page'=>'招生报名-班型介绍',
|
||||||
|
'signUp-signup_way-idx'=>'招生报名-报名方式',
|
||||||
|
|
||||||
|
'teachers-idx'=>'师资力量',
|
||||||
'teachers-details-id'=>'师资力量-详情页',
|
'teachers-details-id'=>'师资力量-详情页',
|
||||||
'achievement-school_achievement'=>'荣誉成绩-录取院校',
|
|
||||||
'achievement-joint_achievement-page'=>'荣誉成绩-联考成绩',
|
'achievement-school_achievement-idx'=>'荣誉成绩-录取院校',
|
||||||
|
'achievement-joint_achievement-idx-page'=>'荣誉成绩-联考成绩',
|
||||||
'achievement-joint_achievement-details-id'=>'荣誉成绩-联考成绩-详情页',
|
'achievement-joint_achievement-details-id'=>'荣誉成绩-联考成绩-详情页',
|
||||||
|
|
||||||
|
'works-idx'=>'作品欣赏',
|
||||||
|
|
||||||
|
'news-idx-page'=>'艺考咨询',
|
||||||
|
|
||||||
|
'contactUs-contact_info-idx'=>'联系我们-联系方式',
|
||||||
|
'contactUs-signup-idx'=>'联系我们-在线报名',
|
||||||
|
'contactUs-leave_message-idx'=>'联系我们-用户留言',
|
||||||
|
'contactUs-join_apply-idx'=>'联系我们-合作加盟',
|
||||||
];
|
];
|
||||||
if(!isset($match_res_pool[$url])){
|
if(!isset($match_res_pool[$url])){
|
||||||
return '未知页面';
|
return '未知页面';
|
||||||
|
@ -9,6 +9,7 @@ use app\common\arw\adjfut\src\Excel;
|
|||||||
use app\Request;
|
use app\Request;
|
||||||
use app\common\exception\Tool;
|
use app\common\exception\Tool;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
use Overtrue\Pinyin\Pinyin;
|
||||||
use app\common\model\TeachersStrength\Subject as ModelSubject;
|
use app\common\model\TeachersStrength\Subject as ModelSubject;
|
||||||
|
|
||||||
class Teacher extends BaseModel
|
class Teacher extends BaseModel
|
||||||
@ -201,4 +202,21 @@ class Teacher extends BaseModel
|
|||||||
$model['subject_name'] = $subject->subject_name;
|
$model['subject_name'] = $subject->subject_name;
|
||||||
return $model;
|
return $model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取器 - 中文转拼音(全部大写)
|
||||||
|
public function getTeacherEngNameAttr($value, $data)
|
||||||
|
{
|
||||||
|
$teacher_name = $data['teacher_name'];
|
||||||
|
|
||||||
|
// 实例化拼音转换库
|
||||||
|
$pinyin = new Pinyin();
|
||||||
|
|
||||||
|
// 将中文转换为拼音
|
||||||
|
$teacher_eng_name = $pinyin->abbr($teacher_name);
|
||||||
|
|
||||||
|
// 将拼音转换为大写字母
|
||||||
|
$teacher_eng_name = strtoupper("$teacher_eng_name");
|
||||||
|
|
||||||
|
return $teacher_eng_name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,6 +85,7 @@ class Works extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public static function onBeforeUpdate(self $model): void
|
public static function onBeforeUpdate(self $model): void
|
||||||
{
|
{
|
||||||
|
BaseModel::setUserGuid(false);
|
||||||
Tool::sortEditProc(self::class, $model->works_guid, $model->works_order, ['works_type_guid' => $model->works_type_guid]);
|
Tool::sortEditProc(self::class, $model->works_guid, $model->works_order, ['works_type_guid' => $model->works_type_guid]);
|
||||||
$model->completeUpdateField();
|
$model->completeUpdateField();
|
||||||
}
|
}
|
||||||
@ -178,4 +179,9 @@ class Works extends BaseModel
|
|||||||
'works_order' => $works_order,
|
'works_order' => $works_order,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getLikeSrcAttr()
|
||||||
|
{
|
||||||
|
return "/img/business/works/like1.png";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
BIN
public/excel/字典/Tdk.xlsx
Normal file
BIN
public/excel/字典/Tdk.xlsx
Normal file
Binary file not shown.
BIN
public/excel/字典/海报位置.xlsx
Normal file
BIN
public/excel/字典/海报位置.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user