feat:完成关于我们模块、作品鉴赏模块、联系我们模块-新增在线报名,获取毕业类型、公共模块-获取验证码接口
This commit is contained in:
parent
a21e1d2ff8
commit
cec83457c5
@ -18,7 +18,13 @@ use think\facade\Env;
|
||||
class DevelopmentHistory extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取发展历程列表
|
||||
* 获取发展历程列表接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-24
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getDevelopmentHistoryList(Request $request): array
|
||||
{
|
||||
@ -26,20 +32,30 @@ class DevelopmentHistory extends BaseController
|
||||
$this->validate($params, [
|
||||
'sort|排序' => 'require',
|
||||
]);
|
||||
$query = ModelDevelopmentHistory::field([
|
||||
$select = ModelDevelopmentHistory::field([
|
||||
'development_history_id',
|
||||
'development_history_guid',
|
||||
'development_history_year',
|
||||
'development_history_title',
|
||||
'development_history_content'
|
||||
])
|
||||
->order('development_history_year', $params['sort']);
|
||||
->order('development_history_year', $params['sort'])
|
||||
->select();
|
||||
|
||||
return msg("获取发展历程列表成功!", $query);
|
||||
return msg(0, "获取发展历程列表成功!", [
|
||||
'count' => count($select),
|
||||
'data' => $select,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑发展历程
|
||||
* 编辑发展历程接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-24
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function editDevelopmentHistory(Request $request): array
|
||||
{
|
||||
@ -61,7 +77,13 @@ class DevelopmentHistory extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加发展历程
|
||||
* 添加发展历程接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-24
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function addDevelopmentHistory(Request $request): array
|
||||
{
|
||||
@ -83,7 +105,13 @@ class DevelopmentHistory extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发展历程
|
||||
* 删除发展历程接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-24
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function deleteDevelopmentHistory(Request $request): array
|
||||
{
|
||||
@ -99,7 +127,13 @@ class DevelopmentHistory extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出Excel
|
||||
* 导出Excel接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-24
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function exportExcel(Request $request): void
|
||||
{
|
||||
@ -119,7 +153,13 @@ class DevelopmentHistory extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载导入模板
|
||||
* 下载导入模板接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-24
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function downloadTemplate(Request $request): void
|
||||
{
|
||||
@ -132,7 +172,13 @@ class DevelopmentHistory extends BaseController
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入excel
|
||||
* 导入excel接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-24
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function importExcel(Request $request): array
|
||||
{
|
||||
|
44
app/api/controller/AboutUs/CompanyProfile.php
Normal file
44
app/api/controller/AboutUs/CompanyProfile.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\AboutUs;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\AboutUs\CompanyProfile as ModelCompanyProfile;
|
||||
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 app\common\exception\Tool;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
|
||||
|
||||
class CompanyProfile extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取公司简介列表接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-25
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCompanyProfileList(Request $request): array
|
||||
{
|
||||
$select = ModelCompanyProfile::field([
|
||||
'company_profile_img',
|
||||
'company_profile_content',
|
||||
'company_profile_order'
|
||||
])
|
||||
->order('company_profile_order', 'asc')
|
||||
->select();
|
||||
|
||||
return msg(0, "获取公司简介列表成功!", [
|
||||
'count' => count($select),
|
||||
'data' => $select,
|
||||
]);
|
||||
}
|
||||
}
|
44
app/api/controller/AboutUs/DevelopmentHistory.php
Normal file
44
app/api/controller/AboutUs/DevelopmentHistory.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\AboutUs;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\AboutUs\DevelopmentHistory as ModelDevelopmentHistory;
|
||||
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 app\common\exception\Tool;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
|
||||
|
||||
class DevelopmentHistory extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取发展历程列表接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-25
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getDevelopmentHistoryList(Request $request): array
|
||||
{
|
||||
$select = ModelDevelopmentHistory::field([
|
||||
'development_history_year',
|
||||
'development_history_title',
|
||||
'development_history_content'
|
||||
])
|
||||
->order('development_history_year', 'asc')
|
||||
->select();
|
||||
|
||||
return msg(0, "获取发展历程列表成功!", [
|
||||
'count' => count($select),
|
||||
'data' => $select,
|
||||
]);
|
||||
}
|
||||
}
|
57
app/api/controller/AboutUs/TeachingEnvir/TeachingEnvir.php
Normal file
57
app/api/controller/AboutUs/TeachingEnvir/TeachingEnvir.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\AboutUs\TeachingEnvir;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\AboutUs\TeachingEnvir\TeachingEnvir as ModelTeachingEnvir;
|
||||
use app\common\model\AboutUs\TeachingEnvir\TeachingEnvirType as ModelTeachingEnvirType;
|
||||
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 app\common\exception\Tool;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
|
||||
|
||||
class TeachingEnvir extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取教学环境列表接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-22
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getTeachingEnvirList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$this->validate($params, [
|
||||
'teaching_envir_type_id|教学环境类型id' => 'require',
|
||||
]);
|
||||
|
||||
$teaching_envir_type = ModelTeachingEnvirType::where('teaching_envir_type_id', $params['teaching_envir_type_id'])->find();
|
||||
if (!$teaching_envir_type) throwErrorMsg('该教学环境类型不存在!');
|
||||
|
||||
$con = [
|
||||
['teaching_envir.teaching_envir_type_guid', '=', $teaching_envir_type->teaching_envir_type_guid],
|
||||
['teaching_envir_type.teaching_envir_type_delete_time', 'NULL', null],
|
||||
];
|
||||
$find = ModelTeachingEnvir::where($con)
|
||||
->field([
|
||||
'teaching_envir_title',
|
||||
'teaching_envir_img',
|
||||
'teaching_envir_intro',
|
||||
'teaching_envir_details',
|
||||
'teaching_envir_type_name',
|
||||
])
|
||||
->leftJoin('teaching_envir_type', 'teaching_envir_type.teaching_envir_type_guid = teaching_envir.teaching_envir_type_guid')
|
||||
->find();
|
||||
|
||||
return msg(0, "获取教学环境列表成功!", ['data' => $find]);
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\AboutUs\TeachingEnvir;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\AboutUs\TeachingEnvir\TeachingEnvirType as ModelTeachingEnvirType;
|
||||
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 app\common\exception\Tool;
|
||||
use app\common\arw\adjfut\src\Traverse;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
|
||||
|
||||
class TeachingEnvirType extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取教学环境类型列表接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-22
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getTeachingEnvirTypeList(Request $request): array
|
||||
{
|
||||
$select = ModelTeachingEnvirType::field(['teaching_envir_type_id', 'teaching_envir_type_name'])
|
||||
->where('teaching_envir_type_parent_guid', "0")
|
||||
->order('teaching_envir_type_order')
|
||||
->select();
|
||||
|
||||
return msg(0, "获取环境类型列表成功!", [
|
||||
'data' => $select,
|
||||
'count' => count($select)
|
||||
]);
|
||||
}
|
||||
}
|
32
app/api/controller/CommonApi/CommonApi.php
Normal file
32
app/api/controller/CommonApi/CommonApi.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\CommonApi;
|
||||
|
||||
use app\BaseController;
|
||||
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 app\common\exception\Tool;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
use think\captcha\facade\Captcha;
|
||||
use think\helper\Arr;
|
||||
|
||||
class CommonApi extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取验证码接口
|
||||
*
|
||||
* @return \think\response\Html
|
||||
* @date 2023-04-26
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCaptcha(): \think\response\Html
|
||||
{
|
||||
return Captcha::create('verify');
|
||||
}
|
||||
}
|
96
app/api/controller/ContactUs/Signup.php
Normal file
96
app/api/controller/ContactUs/Signup.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\ContactUs;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\ContactUs\Signup as ModelSignup;
|
||||
use app\common\model\Dictionary\Dictionary as ModelDictionary;
|
||||
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 app\common\exception\Tool;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
use think\captcha\facade\Captcha;
|
||||
use think\helper\Arr;
|
||||
|
||||
class Signup extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取在线报名验证码接口
|
||||
*
|
||||
* @return \think\response\Html
|
||||
* @date 2023-04-25
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCaptcha(): \think\response\Html
|
||||
{
|
||||
return Captcha::create('verify');
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增在线报名接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-25
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function addSignup(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$this->validate($params, [
|
||||
'signup_user_name|报名用户名称' => 'require',
|
||||
'captcha|验证码' => 'require|captcha',
|
||||
'signup_user_phone|报名用户电话' => 'require',
|
||||
'signup_user_parents_phone|报名用户家长电话' => 'require',
|
||||
'signup_user_home_address|报名用户家庭地址' => 'require',
|
||||
'signup_user_original_school|报名用户原就读学校' => 'require',
|
||||
'signup_user_arrival_time|报名用户预计到校时间' => 'require',
|
||||
'classes_guid|报名用户选择班型' => 'require',
|
||||
'signup_user_grad_type|报名用户毕业类型' => 'require',
|
||||
]);
|
||||
|
||||
ModelSignup::create($params, [
|
||||
'signup_guid',
|
||||
'signup_status',
|
||||
'signup_create_user_guid',
|
||||
'signup_update_user_guid',
|
||||
'signup_user_name',
|
||||
'signup_user_phone',
|
||||
'signup_user_parents_phone',
|
||||
'signup_user_home_address',
|
||||
'signup_user_original_school',
|
||||
'signup_user_arrival_time',
|
||||
'classes_guid',
|
||||
'signup_user_grad_type',
|
||||
]);
|
||||
|
||||
return msg('提交成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取毕业类型接口
|
||||
*
|
||||
* @return array
|
||||
* @date 2023-04-25
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getGradType(): array
|
||||
{
|
||||
$data = ModelDictionary::getDictionaryData(
|
||||
'graduation_type',
|
||||
[
|
||||
'dictionary_name ' => 'graduation_type_name',
|
||||
'dictionary_value ' => ' graduation_type_value'
|
||||
]
|
||||
);
|
||||
return msg('获取毕业类型成功!', $data);
|
||||
}
|
||||
}
|
68
app/api/controller/Works/Works.php
Normal file
68
app/api/controller/Works/Works.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\Works;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\Works\Works as ModelWorks;
|
||||
use app\common\model\Works\WorksType as ModelWorksType;
|
||||
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 app\common\exception\Tool;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
|
||||
|
||||
class Works extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取作品列表接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-25
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getWorksList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$this->validate($params, [
|
||||
'works_type_id|作品类型id' => 'require',
|
||||
]);
|
||||
|
||||
$works_type = ModelWorksType::where('works_type_id', $params['works_type_id'])->find();
|
||||
if (!$works_type) throwErrorMsg('该作品类型不存在!');
|
||||
|
||||
$con = [
|
||||
['works_type.works_type_delete_time', 'NULL', null],
|
||||
['classes.classes_delete_time', 'NULL', null],
|
||||
['works.works_type_guid', '=', $works_type->works_type_guid],
|
||||
];
|
||||
$data = ModelWorks::field([
|
||||
'works.works_id',
|
||||
'works_type.works_type_id',
|
||||
'works.works_img',
|
||||
'works.works_name',
|
||||
'works.works_author',
|
||||
'works.works_intro',
|
||||
'works.works_likes_count',
|
||||
'works.works_order',
|
||||
'works_type.works_type_name',
|
||||
'classes.classes_name',
|
||||
])
|
||||
->where($con)
|
||||
->leftJoin('works_type', 'works_type.works_type_guid = works.works_type_guid')
|
||||
->leftJoin('classes', 'classes.classes_guid = works.classes_guid')
|
||||
->order('works_order', 'asc')
|
||||
->select();
|
||||
|
||||
return msg(0, "获取作品列表成功!", [
|
||||
'count' => count($data),
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
42
app/api/controller/Works/WorksType.php
Normal file
42
app/api/controller/Works/WorksType.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\Works;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\Works\WorksType as ModelWorksType;
|
||||
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\Traverse;
|
||||
use app\common\arw\adjfut\src\UploadFile;
|
||||
use app\common\exception\Tool;
|
||||
use think\facade\Db;
|
||||
use think\facade\Env;
|
||||
|
||||
|
||||
class WorksType extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取作品类型列表接口
|
||||
*
|
||||
* @param Request request
|
||||
* @return array
|
||||
* @date 2023-04-17
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getWorksTypeList(Request $request): array
|
||||
{
|
||||
$select = ModelWorksType::field(['works_type_name', 'works_type_id'])
|
||||
->where('works_type_parent_guid', "0")
|
||||
->order('works_type_order')
|
||||
->select();
|
||||
|
||||
return msg(0, "获取作品类型列表成功!", [
|
||||
'data' => $select,
|
||||
'count' => count($select)
|
||||
]);
|
||||
}
|
||||
}
|
@ -68,6 +68,8 @@ class Signup extends BaseModel
|
||||
*/
|
||||
public static function onBeforeInsert(self $model): void
|
||||
{
|
||||
BaseModel::setUserGuid(false);
|
||||
Tool::initModelFieldValue($model, ['signup_status' => 2]);
|
||||
$model->completeCreateField();
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class Works extends BaseModel
|
||||
*/
|
||||
public static function onBeforeUpdate(self $model): void
|
||||
{
|
||||
Tool::sortEditProc(self::class, $model->works_guid, $model->works_order);
|
||||
Tool::sortEditProc(self::class, $model->works_guid, $model->works_order, ['works_type_guid' => $model->works_type_guid]);
|
||||
$model->completeUpdateField();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user