first commit
This commit is contained in:
111
app/adminapi/validate/item/ItemCateValidate.php
Normal file
111
app/adminapi/validate/item/ItemCateValidate.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\validate\item;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 项目分类验证器
|
||||
* Class ItemCateValidate
|
||||
* @package app\adminapi\validate\item
|
||||
*/
|
||||
class ItemCateValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'name' => 'require',
|
||||
'sort' => 'require',
|
||||
'is_show' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'name' => '分类名称',
|
||||
'sort' => '排序',
|
||||
'is_show' => '是否显示',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return ItemCateValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['name','sort','is_show']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return ItemCateValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id','name','sort','is_show']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return ItemCateValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return ItemCateValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 更改状态场景
|
||||
* @return ArticleCateValidate
|
||||
* @author heshihu
|
||||
* @date 2022/2/21 18:02
|
||||
*/
|
||||
public function sceneStatus()
|
||||
{
|
||||
return $this->only(['id', 'is_show']);
|
||||
}
|
||||
|
||||
}
|
||||
103
app/adminapi/validate/item/ItemRecordValidate.php
Normal file
103
app/adminapi/validate/item/ItemRecordValidate.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
namespace app\adminapi\validate\item;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 项目记录验证器
|
||||
* Class ItemRecordValidate
|
||||
* @package app\adminapi\validate\item
|
||||
*/
|
||||
class ItemRecordValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'sn' => 'require',
|
||||
'contract_no' => 'require',
|
||||
'user_id' => 'require',
|
||||
'item_id' => 'require',
|
||||
'money' => 'require',
|
||||
'rate' => 'require',
|
||||
'cycle' => 'require',
|
||||
'total_num' => 'require',
|
||||
'wait_num' => 'require',
|
||||
'type' => 'require',
|
||||
'status' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'sn' => '订单编号',
|
||||
'contract_no' => '合同编号',
|
||||
'user_id' => '用户id',
|
||||
'item_id' => '项目id',
|
||||
'money' => '订单金额',
|
||||
'rate' => '利率',
|
||||
'cycle' => '周期',
|
||||
'total_num' => '总期数',
|
||||
'wait_num' => '剩余期数',
|
||||
'type' => '投资类型',
|
||||
'status' => '状态',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return ItemRecordValidate
|
||||
* @author BD
|
||||
* @date 2024/08/07 15:42
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['sn','contract_no','user_id','item_id','money','rate','cycle','total_num','wait_num','type','status']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return ItemRecordValidate
|
||||
* @author BD
|
||||
* @date 2024/08/07 15:42
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id','sn','contract_no','user_id','item_id','money','rate','cycle','total_num','wait_num','type','status']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return ItemRecordValidate
|
||||
* @author BD
|
||||
* @date 2024/08/07 15:42
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return ItemRecordValidate
|
||||
* @author BD
|
||||
* @date 2024/08/07 15:42
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
||||
114
app/adminapi/validate/item/ItemValidate.php
Normal file
114
app/adminapi/validate/item/ItemValidate.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\validate\item;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 项目验证器
|
||||
* Class ItemValidate
|
||||
* @package app\adminapi\validate\item
|
||||
*/
|
||||
class ItemValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'cid' => 'require',
|
||||
'type' => 'require',
|
||||
'title' => 'require',
|
||||
'min_money' => 'require',
|
||||
'max_money' => 'require',
|
||||
'rate' => 'require',
|
||||
'cycle' => 'require',
|
||||
'progress' => 'require',
|
||||
'progress_auto' => 'require',
|
||||
'is_show' => 'require',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'cid' => '项目分类',
|
||||
'type' => '投资类型',
|
||||
'title' => '项目标题',
|
||||
'min_money' => '最小投资额',
|
||||
'max_money' => '最大投资额',
|
||||
'rate' => '利率',
|
||||
'cycle' => '周期',
|
||||
'progress' => '项目进度',
|
||||
'progress_auto' => '自增进度',
|
||||
'is_show' => '是否显示',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return ItemValidate
|
||||
* @author BD
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['cid','type','title','min_money','max_money','rate','cycle','progress','progress_auto','is_show']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return ItemValidate
|
||||
* @author BD
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id','cid','type','title','min_money','max_money','rate','cycle','progress','progress_auto','is_show']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return ItemValidate
|
||||
* @author BD
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return ItemValidate
|
||||
* @author BD
|
||||
* @date 2024/01/16 13:23
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user