Merge branch 'master' of http://git.aerwen.net/php_Team/houde_web_api
This commit is contained in:
commit
67d139961e
@ -32,6 +32,7 @@ class EnrolIntro extends BaseController
|
||||
'enrol_intro_id',
|
||||
'enrol_intro_guid',
|
||||
'enrol_intro_title',
|
||||
'enrol_intro_sort',
|
||||
'enrol_intro_content'
|
||||
])
|
||||
->order('enrol_intro_create_time', 'asc');
|
||||
@ -54,7 +55,8 @@ class EnrolIntro extends BaseController
|
||||
$model->allowField([
|
||||
'enrol_intro_update_user_guid',
|
||||
'enrol_intro_title',
|
||||
'enrol_intro_content'
|
||||
'enrol_intro_content',
|
||||
'enrol_intro_sort'
|
||||
])->save($params);
|
||||
return msg('编辑成功!');
|
||||
}
|
||||
@ -74,7 +76,8 @@ class EnrolIntro extends BaseController
|
||||
'enrol_intro_create_user_guid',
|
||||
'enrol_intro_update_user_guid',
|
||||
'enrol_intro_title',
|
||||
'enrol_intro_content'
|
||||
'enrol_intro_content',
|
||||
'enrol_intro_sort'
|
||||
]);
|
||||
return msg('添加成功!');
|
||||
}
|
||||
|
55
app/api/controller/HonoraryAchievement/Achievement.php
Normal file
55
app/api/controller/HonoraryAchievement/Achievement.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\HonoraryAchievement;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\HonoraryAchievement\Achievement as ModelAchievement;
|
||||
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 Achievement extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取录取院校成绩列表
|
||||
*/
|
||||
public function getAchievementList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$con = [];
|
||||
$this->validate($params, [
|
||||
'school_category_id|录取院校类型id' => 'require',
|
||||
]);
|
||||
|
||||
$con = Tool::getOptionalQuery(['b.school_category_id', '=']);
|
||||
|
||||
$query = ModelAchievement::where($con)
|
||||
->field([
|
||||
'a.achievement_id',
|
||||
'a.school_category_guid',
|
||||
'b.school_category_name',
|
||||
'a.achievement_title',
|
||||
'a.achievement_content',
|
||||
'a.achievement_sub_content',
|
||||
'a.achievement_sort'
|
||||
])
|
||||
->alias('a')
|
||||
->leftJoin('school_category b', 'a.school_category_guid = b.school_category_guid')
|
||||
->hidden(['school_category_guid'])
|
||||
->order('achievement_sort', 'asc')
|
||||
->select();
|
||||
|
||||
|
||||
return msg(0, "获取录取院校成绩列表成功!", [
|
||||
'data' => $query,
|
||||
'count' => count($query)
|
||||
]);
|
||||
}
|
||||
}
|
61
app/api/controller/HonoraryAchievement/JointAchievement.php
Normal file
61
app/api/controller/HonoraryAchievement/JointAchievement.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\HonoraryAchievement;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\HonoraryAchievement\JointAchievement as ModelJointAchievement;
|
||||
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 JointAchievement extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取联考成绩列表
|
||||
*/
|
||||
public function getJointAchievementList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$con = [];
|
||||
|
||||
$query = ModelJointAchievement::where($con)
|
||||
->field([
|
||||
'joint_achievement_id',
|
||||
'joint_achievement_title',
|
||||
'joint_achievement_cover',
|
||||
'joint_achievement_sort',
|
||||
])
|
||||
->order('joint_achievement_sort', 'asc');
|
||||
|
||||
return msg("获取联考成绩列表成功!",$query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取联考成绩详情
|
||||
*/
|
||||
public function getJointAchievementInfo(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
|
||||
$this->validate($params, ['joint_achievement_id|联考成绩id' => 'require']);
|
||||
|
||||
$find = ModelJointAchievement::field([
|
||||
'joint_achievement_id',
|
||||
'joint_achievement_title',
|
||||
'joint_achievement_cover',
|
||||
'joint_achievement_sort',
|
||||
'joint_achievement_content'
|
||||
])
|
||||
->where('joint_achievement_id', $params['joint_achievement_id'])
|
||||
->find();
|
||||
|
||||
return msg(0, '获取联考成绩详情成功!', ['data' => $find]);
|
||||
}
|
||||
}
|
46
app/api/controller/HonoraryAchievement/SchoolCategory.php
Normal file
46
app/api/controller/HonoraryAchievement/SchoolCategory.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\HonoraryAchievement;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\HonoraryAchievement\SchoolCategory as ModelSchoolCategory;
|
||||
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 SchoolCategory extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取录取院校分类列表
|
||||
*/
|
||||
public function getSchoolCategoryList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$con = [];
|
||||
|
||||
$query = ModelSchoolCategory::where($con)
|
||||
->field([
|
||||
'school_category_id',
|
||||
'school_category_title',
|
||||
'school_category_name',
|
||||
'school_category_img',
|
||||
'school_category_sort'
|
||||
])
|
||||
->order('school_category_sort', 'asc')->select();
|
||||
|
||||
|
||||
|
||||
return msg(0,"获取录取院校分类列表成功!", [
|
||||
'data' => $query,
|
||||
'count' => count($query)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
56
app/api/controller/HonoraryAchievement/SchoolLeaders.php
Normal file
56
app/api/controller/HonoraryAchievement/SchoolLeaders.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\HonoraryAchievement;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\HonoraryAchievement\SchoolLeaders as ModelSchoolLeaders;
|
||||
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 SchoolLeaders extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取录取学院领军者列表
|
||||
*/
|
||||
public function getSchoolLeadersList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$con = [];
|
||||
|
||||
$this->validate($params, [
|
||||
'school_category_id|录取院校类型id' => 'require',
|
||||
]);
|
||||
$con = Tool::getOptionalQuery(['b.school_category_id', '=']);
|
||||
|
||||
$query = ModelSchoolLeaders::where($con)
|
||||
->field([
|
||||
'a.school_leaders_id',
|
||||
'a.school_category_guid',
|
||||
'b.school_category_name',
|
||||
'a.school_leaders_name',
|
||||
'a.school_leaders_school',
|
||||
'a.school_leaders_img',
|
||||
'a.school_leaders_sort'
|
||||
])
|
||||
->alias('a')
|
||||
->leftJoin('school_category b', 'a.school_category_guid = b.school_category_guid')
|
||||
->hidden(['school_category_guid'])
|
||||
->order('a.school_leaders_sort', 'asc')
|
||||
->select();
|
||||
|
||||
|
||||
return msg(0, "获取录取学院领军者列表成功!", [
|
||||
'data' => $query,
|
||||
'count' => count($query)
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller\News;
|
||||
|
||||
use app\BaseController;
|
||||
use app\common\model\News\News as ModelNews;
|
||||
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 News extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取新闻列表
|
||||
*/
|
||||
public function getNewsList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$con = [];
|
||||
|
||||
$con = Tool::getOptionalQuery(['news_type', '='],);
|
||||
|
||||
$query = ModelNews::where($con)
|
||||
->field([
|
||||
'news_id',
|
||||
'news_guid',
|
||||
'news_title',
|
||||
'news_intro',
|
||||
'news_type',
|
||||
'news_img',
|
||||
'news_create_time',
|
||||
])
|
||||
->append(['news_created_time'])
|
||||
->hidden(['news_create_time'])
|
||||
// ->append('news_create_time')
|
||||
->order('news_create_time', 'desc');
|
||||
|
||||
|
||||
|
||||
return msg("获取新闻列表成功!", $query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新闻详情
|
||||
*/
|
||||
public function getNewsInfo(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
|
||||
$this->validate($params, ['news_id' => 'require']);
|
||||
|
||||
$find = ModelNews::field([
|
||||
'news_id',
|
||||
'news_guid',
|
||||
'news_title',
|
||||
'news_author',
|
||||
'news_intro',
|
||||
'news_type',
|
||||
'news_img',
|
||||
'news_content',
|
||||
'news_num',
|
||||
'news_create_time'
|
||||
])
|
||||
->where('news_id', $params['news_id'])
|
||||
->find();
|
||||
if (!$find) throwErrorMsg('该新闻不存在!');
|
||||
|
||||
$last_next_id = Tool::getLastNextId(
|
||||
new ModelNews,
|
||||
['news_id', $find->news_id],
|
||||
'all',
|
||||
[['news_type', '=', $find->news_type]]
|
||||
);
|
||||
|
||||
return msg(0, '获取新闻详情成功!', [
|
||||
'data' => $find,
|
||||
'last_id' => $last_next_id[0],
|
||||
'next_id' => $last_next_id[1],
|
||||
]);
|
||||
}
|
||||
}
|
@ -30,6 +30,8 @@ class EnrolIntro extends BaseModel
|
||||
|
||||
"enrol_intro_content" => "string",
|
||||
|
||||
"enrol_intro_sort" => "int",
|
||||
|
||||
"enrol_intro_create_time" => "datetime",
|
||||
|
||||
"enrol_intro_create_user_guid" => "string",
|
||||
@ -54,13 +56,18 @@ class EnrolIntro extends BaseModel
|
||||
|
||||
|
||||
|
||||
//排序字段
|
||||
public $order_field = 'enrol_intro_sort';
|
||||
|
||||
/**
|
||||
* 新增前
|
||||
*/
|
||||
public static function onBeforeInsert(self $model): void
|
||||
{
|
||||
// self::checkRepeatData($model);
|
||||
Tool::sortInsertProc(
|
||||
self::class,
|
||||
$model->enrol_intro_sort,
|
||||
);
|
||||
$model->completeCreateField();
|
||||
}
|
||||
|
||||
@ -69,15 +76,11 @@ class EnrolIntro extends BaseModel
|
||||
*/
|
||||
public static function onBeforeUpdate(self $model): void
|
||||
{
|
||||
// self::checkRepeatData($model);
|
||||
Tool::sortEditProc(
|
||||
self::class,
|
||||
$model->enrol_intro_guid,
|
||||
$model->enrol_intro_sort,
|
||||
);
|
||||
$model->completeUpdateField();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除前
|
||||
*/
|
||||
public static function onBeforeDelete(self $model): void
|
||||
{
|
||||
$model->completeDeleteField();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user