feat:添加报名简介,修改报名方式流程排序问题
This commit is contained in:
parent
a12c749df6
commit
814960dcd6
64
app/admin/controller/Enrol/SignUpIntro.php
Normal file
64
app/admin/controller/Enrol/SignUpIntro.php
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\Enrol;
|
||||||
|
|
||||||
|
use app\BaseController;
|
||||||
|
use app\common\model\Enrol\SignUpIntro as ModelSignUpIntro;
|
||||||
|
use app\Request;
|
||||||
|
use think\Validate;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
use think\facade\Filesystem;
|
||||||
|
use app\common\exception\Tool;
|
||||||
|
|
||||||
|
|
||||||
|
class SignUpIntro extends BaseController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 获取报名简介内容
|
||||||
|
*/
|
||||||
|
public function getSignUpIntro(Request $request): array
|
||||||
|
{
|
||||||
|
$params = $request->param();
|
||||||
|
|
||||||
|
$query = ModelSignUpIntro::field([
|
||||||
|
'sign_up_intro_id',
|
||||||
|
'sign_up_intro_guid',
|
||||||
|
'sign_up_intro_title',
|
||||||
|
'sign_up_intro_subtitle',
|
||||||
|
'sign_up_intro_desc',
|
||||||
|
'sign_up_intro_content',
|
||||||
|
'sign_up_intro_img'
|
||||||
|
])->where(1)->find();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'code' => 0,
|
||||||
|
'data' => $query,
|
||||||
|
'msg' => 'ok'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑报名简介
|
||||||
|
*/
|
||||||
|
public function editSignUpIntro(Request $request): array
|
||||||
|
{
|
||||||
|
$params = $request->param();
|
||||||
|
$this->validate($params, [
|
||||||
|
'sign_up_intro_title|标题' => 'require',
|
||||||
|
'sign_up_intro_subtitle|副标题' => 'require',
|
||||||
|
'sign_up_intro_desc|简介' => 'require',
|
||||||
|
'sign_up_intro_content|内容' => 'require',
|
||||||
|
'sign_up_intro_img|描述图片' => 'require'
|
||||||
|
]);
|
||||||
|
$model = ModelSignUpIntro::where(1)->find();
|
||||||
|
$model->allowField([
|
||||||
|
'sign_up_intro_update_user_guid',
|
||||||
|
'sign_up_intro_title',
|
||||||
|
'sign_up_intro_subtitle',
|
||||||
|
'sign_up_intro_desc',
|
||||||
|
'sign_up_intro_content',
|
||||||
|
'sign_up_intro_img'
|
||||||
|
])->save($params);
|
||||||
|
return msg('编辑成功!');
|
||||||
|
}
|
||||||
|
}
|
@ -32,7 +32,7 @@ class EnterSchoolProcess extends BaseController
|
|||||||
'enter_school_process_intro',
|
'enter_school_process_intro',
|
||||||
'enter_school_process_sort'
|
'enter_school_process_sort'
|
||||||
])
|
])
|
||||||
->order('enter_school_process_sort', 'desc')
|
->order('enter_school_process_sort', 'asc')
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
|
|
||||||
|
38
app/api/controller/Enrol/SignUpIntro.php
Normal file
38
app/api/controller/Enrol/SignUpIntro.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\api\controller\Enrol;
|
||||||
|
|
||||||
|
use app\BaseController;
|
||||||
|
use app\common\model\Enrol\SignUpIntro as ModelSignUpIntro;
|
||||||
|
use app\Request;
|
||||||
|
use think\Validate;
|
||||||
|
use think\exception\ValidateException;
|
||||||
|
use think\facade\Filesystem;
|
||||||
|
use app\common\exception\Tool;
|
||||||
|
|
||||||
|
|
||||||
|
class SignUpIntro extends BaseController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 获取报名简介内容
|
||||||
|
*/
|
||||||
|
public function getSignUpIntro(Request $request): array
|
||||||
|
{
|
||||||
|
$params = $request->param();
|
||||||
|
|
||||||
|
$query = ModelSignUpIntro::field([
|
||||||
|
'sign_up_intro_id',
|
||||||
|
'sign_up_intro_title',
|
||||||
|
'sign_up_intro_subtitle',
|
||||||
|
'sign_up_intro_desc',
|
||||||
|
'sign_up_intro_content',
|
||||||
|
'sign_up_intro_img'
|
||||||
|
])->where(1)->find();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'code' => 0,
|
||||||
|
'data' => $query,
|
||||||
|
'msg' => 'ok'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -33,7 +33,7 @@ class SignUpProcess extends BaseController
|
|||||||
'sign_up_process_intro',
|
'sign_up_process_intro',
|
||||||
'sign_up_process_sort'
|
'sign_up_process_sort'
|
||||||
])
|
])
|
||||||
->order('sign_up_process_sort', 'desc')
|
->order('sign_up_process_sort', 'asc')
|
||||||
->select();
|
->select();
|
||||||
|
|
||||||
|
|
||||||
|
89
app/common/model/Enrol/SignUpIntro.php
Normal file
89
app/common/model/Enrol/SignUpIntro.php
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\Enrol;
|
||||||
|
|
||||||
|
use app\common\arw\adjfut\src\Validate;
|
||||||
|
use app\BaseModel;
|
||||||
|
use think\model\concern\SoftDelete;
|
||||||
|
use app\common\arw\adjfut\src\Excel;
|
||||||
|
use app\Request;
|
||||||
|
use app\common\exception\Tool;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
|
class SignUpIntro extends BaseModel
|
||||||
|
{
|
||||||
|
use SoftDelete;
|
||||||
|
// 删除字段
|
||||||
|
protected $deleteTime = 'sign_up_intro_delete_time';
|
||||||
|
// 设置主键名
|
||||||
|
protected $pk = 'sign_up_intro_guid';
|
||||||
|
// 设置废弃字段
|
||||||
|
protected $disuse = [];
|
||||||
|
// 设置字段信息
|
||||||
|
protected $schema = [
|
||||||
|
|
||||||
|
"sign_up_intro_id" => "int",
|
||||||
|
|
||||||
|
"sign_up_intro_guid" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_title" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_subtitle" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_desc" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_content" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_img" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_create_time" => "datetime",
|
||||||
|
|
||||||
|
"sign_up_intro_create_user_guid" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_update_time" => "datetime",
|
||||||
|
|
||||||
|
"sign_up_intro_update_user_guid" => "string",
|
||||||
|
|
||||||
|
"sign_up_intro_delete_time" => "datetime",
|
||||||
|
|
||||||
|
"sign_up_intro_delete_user_guid" => "string",
|
||||||
|
|
||||||
|
];
|
||||||
|
// 设置json类型字段
|
||||||
|
protected $json = [''];
|
||||||
|
// 开启自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'datetime';
|
||||||
|
// 创建时间
|
||||||
|
protected $createTime = 'sign_up_intro_create_time';
|
||||||
|
// 修改时间
|
||||||
|
protected $updateTime = 'sign_up_intro_update_time';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增前
|
||||||
|
*/
|
||||||
|
public static function onBeforeInsert(self $model): void
|
||||||
|
{
|
||||||
|
// self::checkRepeatData($model);
|
||||||
|
$model->completeCreateField();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新前
|
||||||
|
*/
|
||||||
|
public static function onBeforeUpdate(self $model): void
|
||||||
|
{
|
||||||
|
// self::checkRepeatData($model);
|
||||||
|
$model->completeUpdateField();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除前
|
||||||
|
*/
|
||||||
|
public static function onBeforeDelete(self $model): void
|
||||||
|
{
|
||||||
|
$model->completeDeleteField();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user